@pkg-nec/emulatorjs 4.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/.gitattributes +1 -0
  2. package/CHANGES.md +528 -0
  3. package/CODE_OF_CONDUCT.md +128 -0
  4. package/CONTRIBUTING.md +31 -0
  5. package/LICENSE +674 -0
  6. package/README.md +284 -0
  7. package/data/compression/README.md +11 -0
  8. package/data/compression/extract7z.js +1 -0
  9. package/data/compression/extractzip.js +1 -0
  10. package/data/compression/libunrar.js +519 -0
  11. package/data/compression/libunrar.wasm +0 -0
  12. package/data/cores/README.md +22 -0
  13. package/data/cores/package.json +65 -0
  14. package/data/emulator.css +1614 -0
  15. package/data/loader.js +170 -0
  16. package/data/localization/README.md +63 -0
  17. package/data/localization/af-FR.json +339 -0
  18. package/data/localization/ar-AR.json +301 -0
  19. package/data/localization/ben-BEN.json +301 -0
  20. package/data/localization/de-GER.json +301 -0
  21. package/data/localization/el-GR.json +301 -0
  22. package/data/localization/en-US.json +339 -0
  23. package/data/localization/es-ES.json +310 -0
  24. package/data/localization/fa-AF.json +310 -0
  25. package/data/localization/hi-HI.json +301 -0
  26. package/data/localization/it-IT.json +302 -0
  27. package/data/localization/ja-JA.json +301 -0
  28. package/data/localization/jv-JV.json +301 -0
  29. package/data/localization/ko-KO.json +336 -0
  30. package/data/localization/pt-BR.json +361 -0
  31. package/data/localization/retroarch.json +617 -0
  32. package/data/localization/ro-RO.json +310 -0
  33. package/data/localization/ru-RU.json +301 -0
  34. package/data/localization/tr-TR.json +310 -0
  35. package/data/localization/vi-VN.json +302 -0
  36. package/data/localization/zh-CN.json +351 -0
  37. package/data/src/GameManager.js +464 -0
  38. package/data/src/compression.js +142 -0
  39. package/data/src/emulator.js +6158 -0
  40. package/data/src/gamepad.js +167 -0
  41. package/data/src/nipplejs.js +1 -0
  42. package/data/src/shaders.js +236 -0
  43. package/data/src/socket.io.min.js +7 -0
  44. package/data/src/storage.js +125 -0
  45. package/data/version.json +5 -0
  46. package/docs/Logo-light.png +0 -0
  47. package/docs/Logo.png +0 -0
  48. package/docs/Logo.svg +4487 -0
  49. package/docs/contributors.json +46 -0
  50. package/docs/contributors.md +125 -0
  51. package/docs/favicon.ico +0 -0
  52. package/index.html +269 -0
  53. package/package.json +35 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "ignore": [
3
+ "ethanaobrien",
4
+ "allancoding",
5
+ "michael-j-green",
6
+ "ElectronicsArchiver"
7
+ ],
8
+ "missing": [
9
+ {
10
+ "login": "jurcaalexandrucristian",
11
+ "contributions": 1,
12
+ "avatar_url": "https://avatars.githubusercontent.com/u/74395896?v=4",
13
+ "html_url": "https://github.com/jurcaalexandrucristian"
14
+ },
15
+ {
16
+ "login": "Grey41",
17
+ "contributions": 2,
18
+ "avatar_url": "https://avatars.githubusercontent.com/u/85015029?v=4",
19
+ "html_url": "https://github.com/Grey41"
20
+ },
21
+ {
22
+ "login": "eric183",
23
+ "contributions": 1,
24
+ "avatar_url": "https://avatars.githubusercontent.com/u/10773980?v=4",
25
+ "html_url": "https://github.com/eric183"
26
+ },
27
+ {
28
+ "login": "Protektor-Desura",
29
+ "contributions": 1,
30
+ "avatar_url": "https://avatars.githubusercontent.com/u/1195496?v=4",
31
+ "html_url": "https://github.com/Protektor-Desura"
32
+ },
33
+ {
34
+ "login": "cheesykyle",
35
+ "contributions": 1,
36
+ "avatar_url": "https://avatars.githubusercontent.com/u/17484761?v=4",
37
+ "html_url": "https://github.com/cheesykyle"
38
+ },
39
+ {
40
+ "login": "imneckro",
41
+ "contributions": 1,
42
+ "avatar_url": "https://avatars.githubusercontent.com/u/42493772?v=4",
43
+ "html_url": "https://github.com/imneckro"
44
+ }
45
+ ]
46
+ }
@@ -0,0 +1,125 @@
1
+ <br>
2
+ <div align = center>
3
+
4
+ # Contributors
5
+
6
+ <br>
7
+ <br>
8
+
9
+ ![Ethan Avatar]
10
+
11
+ ### Owner
12
+
13
+ ***Main Contributor***
14
+
15
+ <a href="https://github.com/ethanaobrien" target="_blank">**![Badge Ethan GitHub]**</a>
16
+
17
+ <a href="https://ethanthesleepy.one" target="_blank">**![Badge Ethan Website]**</a>
18
+
19
+ <br>
20
+ <br>
21
+
22
+ ![Allan Avatar]
23
+
24
+ ### Co-Owner
25
+
26
+ ***Maintainer, Along with Various Fixes and Additions***
27
+
28
+ <a href="https://github.com/allancoding" target="_blank">**![Badge Allan GitHub]**</a>
29
+
30
+ <a href="https://allancoding.dev/" target="_blank">**![Badge Allan Website]**</a>
31
+
32
+ <br>
33
+ <br>
34
+
35
+ ![BinBashBanana Avatar]
36
+
37
+ ### Back-End Developer
38
+
39
+ ***RetroArch Core Development***
40
+
41
+ <a href="https://github.com/BinBashBanana" target="_blank">**![Badge BinBashBanana GitHub]**</a> 
42
+
43
+ <a href="https://binbashbanana.github.io/" target="_blank">**![Badge BinBashBanana Website]**</a>
44
+
45
+ <br>
46
+ <br>
47
+
48
+ ![Michael Avatar]
49
+
50
+ ***External Project Maintainer***
51
+
52
+ <a href="https://github.com/michael-j-green" target="_blank">**![Badge Michael GitHub]**</a> 
53
+
54
+ <a href="https://www.mrgtech.net/" target="_blank">**![Badge Michael Website]**</a>
55
+
56
+ <br>
57
+ <br>
58
+
59
+ ![Archiver Avatar]
60
+
61
+ ***Documentation Design***
62
+
63
+ <a href="https://github.com/ElectronicsArchiver" target="_blank">**![Badge Archiver GitHub]**</a>
64
+
65
+ <a href="https://github.com/MarkedDown" target="_blank">**![Badge Archiver Marked]**</a>
66
+
67
+ <br>
68
+ <br>
69
+ <br>
70
+
71
+ <!-- Others -->
72
+ <a href="https://github.com/n-at" target="_blank" title="n-at - Contributions: 40" alt="n-at"><img src="https://avatars.githubusercontent.com/u/2185280?v=4&size=95" width="95px"></a>&nbsp;
73
+ <a href="https://github.com/gantoine" target="_blank" title="gantoine - Contributions: 4" alt="gantoine"><img src="https://avatars.githubusercontent.com/u/3247106?v=4&size=95" width="95px"></a>&nbsp;
74
+ <a href="https://github.com/incredibleIdea" target="_blank" title="incredibleIdea - Contributions: 4" alt="incredibleIdea"><img src="https://avatars.githubusercontent.com/u/23035551?v=4&size=95" width="95px"></a>&nbsp;
75
+ <a href="https://github.com/angelmarfil" target="_blank" title="angelmarfil - Contributions: 3" alt="angelmarfil"><img src="https://avatars.githubusercontent.com/u/59626670?v=4&size=95" width="95px"></a>&nbsp;
76
+ <a href="https://github.com/t3chnob0y" target="_blank" title="t3chnob0y - Contributions: 3" alt="t3chnob0y"><img src="https://avatars.githubusercontent.com/u/18381004?v=4&size=95" width="95px"></a>&nbsp;
77
+ <a href="https://github.com/pastisme" target="_blank" title="pastisme - Contributions: 2" alt="pastisme"><img src="https://avatars.githubusercontent.com/u/166672781?v=4&size=95" width="95px"></a>&nbsp;
78
+ <a href="https://github.com/E-Sh4rk" target="_blank" title="E-Sh4rk - Contributions: 2" alt="E-Sh4rk"><img src="https://avatars.githubusercontent.com/u/13153243?v=4&size=95" width="95px"></a>&nbsp;
79
+ <a href="https://github.com/Grey41" target="_blank" title="Grey41 - Contributions: 2" alt="Grey41"><img src="https://avatars.githubusercontent.com/u/85015029?v=4&size=95" width="95px"></a>&nbsp;
80
+ <a href="https://github.com/ZhaoTonggang" target="_blank" title="ZhaoTonggang - Contributions: 1" alt="ZhaoTonggang"><img src="https://avatars.githubusercontent.com/u/81669862?v=4&size=95" width="95px"></a>&nbsp;
81
+ <a href="https://github.com/pjft" target="_blank" title="pjft - Contributions: 1" alt="pjft"><img src="https://avatars.githubusercontent.com/u/22025709?v=4&size=95" width="95px"></a>&nbsp;
82
+ <a href="https://github.com/noel-forester" target="_blank" title="noel-forester - Contributions: 1" alt="noel-forester"><img src="https://avatars.githubusercontent.com/u/62397558?v=4&size=95" width="95px"></a>&nbsp;
83
+ <a href="https://github.com/jonas0b1011001" target="_blank" title="jonas0b1011001 - Contributions: 1" alt="jonas0b1011001"><img src="https://avatars.githubusercontent.com/u/43352574?v=4&size=95" width="95px"></a>&nbsp;
84
+ <a href="https://github.com/debuggerx01" target="_blank" title="debuggerx01 - Contributions: 1" alt="debuggerx01"><img src="https://avatars.githubusercontent.com/u/19624835?v=4&size=95" width="95px"></a>&nbsp;
85
+ <a href="https://github.com/andrigamerita" target="_blank" title="andrigamerita - Contributions: 1" alt="andrigamerita"><img src="https://avatars.githubusercontent.com/u/37557992?v=4&size=95" width="95px"></a>&nbsp;
86
+ <a href="https://github.com/TimKieu" target="_blank" title="TimKieu - Contributions: 1" alt="TimKieu"><img src="https://avatars.githubusercontent.com/u/90356683?v=4&size=95" width="95px"></a>&nbsp;
87
+ <a href="https://github.com/SooHyuck" target="_blank" title="SooHyuck - Contributions: 1" alt="SooHyuck"><img src="https://avatars.githubusercontent.com/u/104526248?v=4&size=95" width="95px"></a>&nbsp;
88
+ <a href="https://github.com/iits-reza" target="_blank" title="iits-reza - Contributions: 1" alt="iits-reza"><img src="https://avatars.githubusercontent.com/u/56708670?v=4&size=95" width="95px"></a>&nbsp;
89
+ <a href="https://github.com/oyepriyansh" target="_blank" title="oyepriyansh - Contributions: 1" alt="oyepriyansh"><img src="https://avatars.githubusercontent.com/u/83062406?v=4&size=95" width="95px"></a>&nbsp;
90
+ <a href="https://github.com/MattiaPell" target="_blank" title="MattiaPell - Contributions: 1" alt="MattiaPell"><img src="https://avatars.githubusercontent.com/u/47603639?v=4&size=95" width="95px"></a>&nbsp;
91
+ <a href="https://github.com/kellenmace" target="_blank" title="kellenmace - Contributions: 1" alt="kellenmace"><img src="https://avatars.githubusercontent.com/u/5306336?v=4&size=95" width="95px"></a>&nbsp;
92
+ <a href="https://github.com/IvanMazzoli" target="_blank" title="IvanMazzoli - Contributions: 1" alt="IvanMazzoli"><img src="https://avatars.githubusercontent.com/u/7896815?v=4&size=95" width="95px"></a>&nbsp;
93
+ <a href="https://github.com/iGoodie" target="_blank" title="iGoodie - Contributions: 1" alt="iGoodie"><img src="https://avatars.githubusercontent.com/u/8591785?v=4&size=95" width="95px"></a>&nbsp;
94
+ <a href="https://github.com/jurcaalexandrucristian" target="_blank" title="jurcaalexandrucristian - Contributions: 1" alt="jurcaalexandrucristian"><img src="https://avatars.githubusercontent.com/u/74395896?v=4&size=95" width="95px"></a>&nbsp;
95
+ <a href="https://github.com/eric183" target="_blank" title="eric183 - Contributions: 1" alt="eric183"><img src="https://avatars.githubusercontent.com/u/10773980?v=4&size=95" width="95px"></a>&nbsp;
96
+ <a href="https://github.com/Protektor-Desura" target="_blank" title="Protektor-Desura - Contributions: 1" alt="Protektor-Desura"><img src="https://avatars.githubusercontent.com/u/1195496?v=4&size=95" width="95px"></a>&nbsp;
97
+ <a href="https://github.com/cheesykyle" target="_blank" title="cheesykyle - Contributions: 1" alt="cheesykyle"><img src="https://avatars.githubusercontent.com/u/17484761?v=4&size=95" width="95px"></a>&nbsp;
98
+ <a href="https://github.com/imneckro" target="_blank" title="imneckro - Contributions: 1" alt="imneckro"><img src="https://avatars.githubusercontent.com/u/42493772?v=4&size=95" width="95px"></a>&nbsp;
99
+
100
+ <!-- Others End -->
101
+
102
+ <!----------------------------------{ Ethan }----------------------------------->
103
+ [Badge Ethan GitHub]: https://img.shields.io/badge/Ethan_O'_Brien-181717.svg?style=for-the-badge&logo=GitHub&logoColor=white
104
+ [Badge Ethan Website]: https://img.shields.io/badge/ethanthesleepy.one-lightgray.svg?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKTSURBVEhLtdVbaM5hHMDxlzmvHNoyzbHEZlphyanckRslh0SK2sUutms3btyhKBdiEgoX5GK5IOdQIo0UEW2hOZ/mkOOcvt/1PH9v75937zK/+vTufd49p9//9zz/zP+OovBZSAzACAzFD3xFl9ErfP4tirEQyzAVfWF8Qwv24TA+o1vhaqfjPL4HP+GqHdy/3YXtrXARg1BQjMRGvMcHnMQLOGATjsCBn+IYXsL/24bRyBsDsQVu+TVWwvS8ggPNx1g8xhssxgxcgrs7irw7mQcH78AiWARbw/dm9IOxAabJT9M5GabKne1Cb6RiCK7Df9qOSajBRTiYO5sQLICTXsM0VGATPuEd3GkqGuDgskJu4A4+wgnuhzbdghPodmizj2my/w70RxKWa1xpT7iAUUhyZeWMgZVTj5nBWhhWUmzTLGyGcRCxfTZMkwfSlCcxBU9g6VXZQLir1XBF5j/3UK6Cvx3o/PY7fI7P4DlKdpDd2XqPEX93oNww10budWO7/TrHjAO0wx/6oAyWnuJ9U4rYJmu9BIZVE9s9Rx42D94XJCv3jvEhm6orMFWGuZwDD9ZlxJ3Yz3KthpV2E4YL9Nrw4K1AG5JYD9PjIP9qN+KhTMIqsgLcWi1cvSt0R3ayuoYHlbDi7mFiaKvDW5ger5g/xjo4wXN4x7jlPfD5HEe8rp3MSXfCvDvJ1dB2GqnVx7B298MT6urWYDm82Jx0LtzZXbjaJTDnZ+Dgp+BlmDdM1Qm4agdx5Q/D90bsDX/7AD2xTuyzOwt3UlAMhgfIEnSw+PBNX/YLR95V5zAeqcg9ndnhGfFWXIpxKIdXin1c9SM8gCs/BAskFfkmiOEB8kU/LLCPO/OF5Iuo2+/jHoxM5hef3tZ5zF6TlgAAAABJRU5ErkJggg==
105
+ [Ethan Avatar]: https://avatars.githubusercontent.com/u/77750390?s=90 'Ethan O\'Brien'
106
+
107
+ <!---------------------------{ ElectronicsArchiver }--------------------------->
108
+ [Badge Archiver GitHub]: https://img.shields.io/badge/ElectronicsArchiver-181717.svg?style=for-the-badge&logo=GitHub&logoColor=white
109
+ [Badge Archiver Marked]: https://img.shields.io/badge/MarkedDown-49a2d5.svg?style=for-the-badge&logo=GitHub&logoColor=white
110
+ [Archiver Avatar]: https://avatars.githubusercontent.com/u/85485984?s=90 'ElectronicsArchiver - トトも'
111
+
112
+ <!----------------------------------{ Allan }---------------------------------->
113
+ [Badge Allan GitHub]: https://img.shields.io/badge/allancoding-181717.svg?style=for-the-badge&logo=GitHub&logoColor=white
114
+ [Badge Allan Website]: https://img.shields.io/badge/allancoding.dev-lightgray.svg?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAATCAYAAACKsM07AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALJSURBVEhLtZVNSFRRGIbfc2emctLUimmV4KIWBbNpUf4lZAYRBBH0syioTZA/1cKKcVGkbqQkCKJNGRlRVLpwMSiWlakhakaaWv7kIFqZVKhDznjv13vGASWTGdCel4d75zuHc+6ZOeeODdGjaAF101ZdiIZoJ9CDn6M+6qDbaDuNiBG+RiKPjg4C1Z1ABe/1g53QDZGIZoIc+pODV1lKVTmVul8P3GZtNT2mOyyFU/QkB181oFT1gGGItl+pB5zEzrZ8ekR3XAz93XqU0pcFbKBptHI7kJmh1J5QNUydSHUH8Ia3egIv/aXr8xERqKKiIsnP1w+y/HBsoLS0lBP9Hzwej9iys7MvB1MDaJJGeMWLFJWKErMYKUYqcs3TSFCJeCQP0SFv4UQMcq0cDDPXrTIEGI95EVvUVtyVO6ixatAoDaiQexhkpur9s7uo1qpFuVWOdmlDkOlHH3ziwxPrMSqtpygzr2JIhjAogzikDiOByVK78VyewWTOmnnolm7csm7iPaPHWMFoQiv4kTIOUQKdFmlBl3TiA7qwSW3Gd4whQ2XCpVxYyejV+Jg+fIKL6WWu2IoxKl/gVm5uLTt6pAfjzLr69VD6Nygo0G+AOV6+8CMYFPj9FpKSHPD5gtwRbKDpO5143eAPtcXFGpgOCPsCu7KccLn0zp2jsLAQ9kAggImJiXBplslJP9rbfmNkJIi0dCeGPgcxPDyD+HgDlsTgXcc0vn2dgV2/NIhp8gXlTkRMTLgQRo+tHA7HNRouzcFN4LIsy22z2eoyLSs1WWRHuClEr2G8alaq1TTNvYZhNPEsLTgHQb20CJynB/j+ie0zjIZ5J9nLmv4Vj1N92hfln0f4Lzy06yNQbzcML5c2pUT2JwMHWV9Lb+hOS6WQ7hsD4vhH4OT9UXpGN0QimhVodL9LtJmuoRtpGV1W9CQl9ELoU1QAfwCDI3HISCyhigAAAABJRU5ErkJggg==
115
+ [Allan Avatar]: https://avatars.githubusercontent.com/u/74841470?s=90 'Allancoding - Allan Niles'
116
+
117
+ <!----------------------------------{ BinBashBanana }---------------------------------->
118
+ [Badge BinBashBanana GitHub]: https://img.shields.io/badge/BinBashBanana-181717.svg?style=for-the-badge&logo=GitHub&logoColor=white
119
+ [Badge BinBashBanana Website]: https://img.shields.io/badge/binbashbanana.github.io-lightgray.svg?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAA3lBMVEVHcEwiIgAYGAqfngcdHhIVFRHHyZkAAAAbGxMfGQVub1TR0Ak+Py05PBnb2QohIBeblnJ2d1tiYkthYQCOkG60swiamQciHBQoKBySk3BLSwIpLhEtMBlPSBJgXgOpqAe4LiBLDAqoqoJ3d1tlYgXBw5SzsgiDgwWio3wsLB+kowiSkQdrblVMTDheWUOkpn6dmwZ/fQWYmwc6CQkeJQKfoHmNjAZBTgMjJwRESQI6RQRmVEBiDw1sRSB0GhaQOzCBexOEhF13YyfU1qPkaCnOPiHEwgm1tAiRkAiurQs+wUq/AAAAQ3RSTlMABCP9GhL8ASoKcvtKIf5D/o5YLqTK6FY5ukIyedNR/P19zlpt+cOMzVLg4FFXcsKmu/JYbtTt48ySw9Ka/vv+9DT+PQB0UwAAAKhJREFUGBlNwQUSgkAABdAP7LK7tIXd3d0tYNz/Qs4wKr6HEDEY5YhQOVPIcBk/xtDmPJ9m+JBs06a8y/HBhDGvHqppwhAS2tI5+X5lP07GBQAzq6rOOQgqjuepMQYkm9nB9XI7FkdaR60JIKZRiPLrOWUg9ThDSOpZj76MCGtbd6WBPyRlKW4OfxIpXXFLEiKJll5ebfOE4Muc6LN1cbfBj1TKCboovAFtNA6G3DFC7wAAAABJRU5ErkJggg==
120
+ [BinBashBanana Avatar]: https://avatars.githubusercontent.com/u/51469593?s=90 'BinBashBanana'
121
+
122
+ <!----------------------------------{ Michael }---------------------------------->
123
+ [Badge Michael GitHub]: https://img.shields.io/badge/michael–j–green-181717.svg?style=for-the-badge&logo=GitHub&logoColor=white
124
+ [Badge Michael Website]: https://img.shields.io/badge/www.mrgtech.net-lightgray.svg?style=for-the-badge&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAe1BMVEVHcEwUFhkUFhkUFhkUFhkUFhkUFhkqKioTFRkTFhkVFxocHBwVFxkRESIYGBgVFxr///8YGh35+fkhIyY6PD7y8vL8/Pzc3d1maGpKTE5dXmC/v8DNzs6HiInU1dWrrK3j5OSam5wnKSwsLjBxcnR9foCAgYLq6urp6upDOJtqAAAAD3RSTlMA+e3V54a0Bm9NpRHaDxUPtKeMAAABIElEQVQYGVXBB3KkQBAAwQYGtyupehye9Ub/f+FBcFKgTFkd67zI0gSSNCvy+iibsjL8YapSFuWBjQ/BszmUIlKxuj8np+qm151VJXI0gO2+1bXn88npu7OAOUoN2NnFOViw/ajNbIFacqBrLoGNvarrgFwKuL914D9rR33foZAMXnqy/Lq1+oRMUpj0ys7QTJBKgnf6YG9ynkQgaNOz99QAAkHjjb1OA0iCd/HG3uw8iaQwusCOb0cw8gEPndm56gMyKcC3MfDDX5vWQyE52D62gc1w0tgDudQsuhhfwdrbMKrGjkUtX4ZFf2rcpY2NNqeehfkUqVj54Xxx7nIePKtKRMoDG7tgcyhlUVaGP0xVyuazzovMJJCkH0Vef8niH/cwItH/Rh67AAAAAElFTkSuQmCC
125
+ [Michael Avatar]: https://avatars.githubusercontent.com/u/84688932?s=90 'michael-j-green - Michael Green'
Binary file
package/index.html ADDED
@@ -0,0 +1,269 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>EmulatorJS</title>
5
+ <link rel = icon href = docs/favicon.ico sizes = "16x16 32x32 48x48 64x64" type = image/vnd.microsoft.icon>
6
+ <meta name = viewport content = "width = device-width, initial-scale = 1">
7
+ <style>
8
+ body, html {
9
+ height: 100%;
10
+ background-color: black;
11
+ color: white;
12
+ }
13
+
14
+ body {
15
+ margin: 0;
16
+ overflow: hidden;
17
+ }
18
+
19
+ body, #box, #top {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ flex-direction: column;
24
+ }
25
+
26
+ #box {
27
+ color: #aaa;
28
+ height: 20em;
29
+ width: 30em;
30
+ max-width: 80%;
31
+ max-height: 80%;
32
+ background-color: #333;
33
+ border-radius: 0.4em;
34
+ border: 2px solid #555;
35
+ position: relative;
36
+ flex-direction: column;
37
+ transition-duration: 0.2s;
38
+ overflow: hidden;
39
+ font-family: monospace;
40
+ font-weight: bold;
41
+ font-size: 20px;
42
+ margin: 5px;
43
+ text-align: center;
44
+ padding: 10px;
45
+ }
46
+
47
+ #box:hover, #box[drag] {
48
+ border-color: #38f;
49
+ color: #ddd
50
+ }
51
+
52
+ #input {
53
+ cursor: pointer;
54
+ position: absolute;
55
+ left: 0;
56
+ top: 0;
57
+ width: 100%;
58
+ height: 100%;
59
+ opacity: 0;
60
+ }
61
+
62
+ #display {
63
+ width: 100%;
64
+ height: 100%
65
+ }
66
+
67
+ select, button {
68
+ padding: 0.6em 0.4em;
69
+ margin: 0.5em;
70
+ width: 15em;
71
+ max-width: 100%;
72
+ font-family: monospace;
73
+ font-weight: bold;
74
+ font-size: 16px;
75
+ background-color: #444;
76
+ color: #aaa;
77
+ border-radius: 0.4em;
78
+ border: 1px solid #555;
79
+ cursor: pointer;
80
+ transition-duration: 0.2s
81
+ }
82
+
83
+ select:hover, button:hover {
84
+ background-color: #666;
85
+ color: #ddd
86
+ }
87
+
88
+ .logo {
89
+ width: 130px;
90
+ height: 130px;
91
+ filter: drop-shadow(0 0 10px white);
92
+ }
93
+
94
+ #top {
95
+ margin: 5px;
96
+ }
97
+ </style>
98
+ </head>
99
+
100
+ <body>
101
+ <div id="top">
102
+ <h1>EmulatorJS Demo</h1>
103
+ <img src="docs/Logo-light.png" alt="Logo" class="logo">
104
+ <br>
105
+ </div>
106
+ <div id="box">
107
+ <input type = file id = input>
108
+ Drag ROM file or click here
109
+ </div>
110
+
111
+ <script>
112
+ let enableDebug = false;
113
+ let enableThreads = false;
114
+ const queryString = window.location.search;
115
+ const urlParams = new URLSearchParams(queryString);
116
+ if (parseInt(urlParams.get('debug')) === 1 || urlParams.get('debug') === "true") {
117
+ enableDebug = true;
118
+ console.log("Debug is enabled");
119
+ } else {
120
+ console.log("Debug is disabled");
121
+ }
122
+
123
+ if (parseInt(urlParams.get('threads')) === 1 || urlParams.get('threads') === "true") {
124
+ if (window.SharedArrayBuffer) {
125
+ enableThreads = true;
126
+ console.log("Threads are enabled");
127
+ } else {
128
+ console.warn("Threads are disabled as SharedArrayBuffer is not available. Threads requires two headers to be set when sending you html page. See https://stackoverflow.com/a/68630724");
129
+ console.log("Threads are disabled");
130
+ }
131
+ } else {
132
+ console.log("Threads are disabled");
133
+ }
134
+
135
+ if (urlParams.get('rom')) {
136
+ console.log(`Loading ROM from URL: roms/${urlParams.get('rom')}`);
137
+ run(false, urlParams.get('rom'));
138
+ }
139
+
140
+ async function run(upload, file) {
141
+ const url = upload ? input.files[0] : `roms/${file}`;
142
+ const parts = upload ? input.files[0].name.split(".") : file.split(".");
143
+
144
+ const core = await (async (ext) => {
145
+ if (["fds", "nes", "unif", "unf"].includes(ext))
146
+ return "nes"
147
+
148
+ if (["smc", "fig", "sfc", "gd3", "gd7", "dx2", "bsx", "swc"].includes(ext))
149
+ return "snes"
150
+
151
+ if (["z64", "n64"].includes(ext))
152
+ return "n64"
153
+
154
+ if (["pce"].includes(ext))
155
+ return "pce"
156
+
157
+ if (["ngp", "ngc"].includes(ext))
158
+ return "ngp"
159
+
160
+ if (["ws", "wsc"].includes(ext))
161
+ return "ws"
162
+
163
+ if (["col", "cv"].includes(ext))
164
+ return "coleco"
165
+
166
+ if (["d64"].includes(ext))
167
+ return "vice_x64sc"
168
+
169
+ if (["nds", "gba", "gb", "z64", "n64"].includes(ext))
170
+ return ext
171
+
172
+ return await new Promise(resolve => {
173
+ var coreValues = {
174
+ "Nintendo 64": "n64",
175
+ "Nintendo Game Boy": "gb",
176
+ "Nintendo Game Boy Advance": "gba",
177
+ "Nintendo DS": "nds",
178
+ "Nintendo Entertainment System": "nes",
179
+ "Super Nintendo Entertainment System": "snes",
180
+ "PlayStation": "psx",
181
+ "Virtual Boy": "vb",
182
+ "Sega Mega Drive": "segaMD",
183
+ "Sega Master System": "segaMS",
184
+ "Sega CD": "segaCD",
185
+ "Atari Lynx": "lynx",
186
+ "Sega 32X": "sega32x",
187
+ "Atari Jaguar": "jaguar",
188
+ "Sega Game Gear": "segaGG",
189
+ "Sega Saturn": "segaSaturn",
190
+ "Atari 7800": "atari7800",
191
+ "Atari 2600": "atari2600",
192
+ "Arcade": "arcade",
193
+ "NEC TurboGrafx-16/SuperGrafx/PC Engine": "pce",
194
+ "NEC PC-FX": "pcfx",
195
+ "SNK NeoGeo Pocket (Color)": "ngp",
196
+ "Bandai WonderSwan (Color)": "ws",
197
+ "ColecoVision": "coleco",
198
+ "Commodore 64": "vice_x64sc",
199
+ "Commodore 128": "vice_x128",
200
+ "Commodore VIC20": "vice_xvic",
201
+ "Commodore Plus/4": "vice_xplus4",
202
+ "Commodore PET": "vice_xpet"
203
+ }
204
+
205
+ const cores = Object.keys(coreValues).sort().reduce(
206
+ (obj, key) => {
207
+ obj[key] = coreValues[key];
208
+ return obj;
209
+ },
210
+ {}
211
+ );
212
+
213
+ const button = document.createElement("button")
214
+ const select = document.createElement("select")
215
+
216
+ for (const type in cores) {
217
+ const option = document.createElement("option")
218
+
219
+ option.value = cores[type]
220
+ option.textContent = type
221
+ select.appendChild(option)
222
+ }
223
+
224
+ button.onclick = () => resolve(select[select.selectedIndex].value)
225
+ button.textContent = "Load game"
226
+ box.innerHTML = ""
227
+
228
+ box.appendChild(select)
229
+ box.appendChild(button)
230
+ })
231
+ })(parts.pop())
232
+
233
+ const div = document.createElement("div")
234
+ const sub = document.createElement("div")
235
+ const script = document.createElement("script")
236
+
237
+ sub.id = "game"
238
+ div.id = "display"
239
+
240
+ const top = document.getElementById("top");
241
+ top.remove();
242
+ box.remove()
243
+ div.appendChild(sub)
244
+ document.body.appendChild(div)
245
+
246
+ window.EJS_player = "#game";
247
+ window.EJS_gameName = parts.shift();
248
+ window.EJS_biosUrl = "";
249
+ window.EJS_gameUrl = url;
250
+ window.EJS_core = core;
251
+ window.EJS_pathtodata = "data/";
252
+ window.EJS_startOnLoaded = true;
253
+ window.EJS_DEBUG_XX = enableDebug;
254
+ window.EJS_disableDatabases = true;
255
+ window.EJS_threads = enableThreads;
256
+
257
+ script.src = "data/loader.js";
258
+ document.body.appendChild(script);
259
+ }
260
+
261
+ input.onchange = async () => {
262
+ run(true);
263
+ }
264
+
265
+ box.ondragover = () => box.setAttribute("drag", true);
266
+ box.ondragleave = () => box.removeAttribute("drag");
267
+ </script>
268
+ </body>
269
+ </html>
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@pkg-nec/emulatorjs",
3
+ "version": "4.2.3",
4
+ "type": "module",
5
+ "description": "EmulatorJS is a frontend for RetroArch in the web browser.",
6
+ "homepage": "https://github.com/pkg-nec/EmulatorJS#readme",
7
+ "license": "GPL-3.0",
8
+ "sideEffects": true,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/pkg-nec/EmulatorJS.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/pkg-nec/EmulatorJS/issues"
15
+ },
16
+ "scripts": {
17
+ "start": "http-server",
18
+ "minify": "node minify/minify.js",
19
+ "build": "node build.js",
20
+ "update": "node update.js"
21
+ },
22
+ "dependencies": {
23
+ "@node-minify/clean-css": "^9.0.1",
24
+ "@node-minify/core": "^9.0.2",
25
+ "@node-minify/terser": "^9.0.1",
26
+ "http-server": "^14.1.1",
27
+ "node-7z": "^3.0.0",
28
+ "node-fetch": "^3.3.2",
29
+ "nipplejs": "^0.10.2",
30
+ "socket.io": "^4.8.1"
31
+ },
32
+ "optionalDependencies": {
33
+ "@emulatorjs/cores": "latest"
34
+ }
35
+ }