commit before switching this from static site to app

This commit is contained in:
roormonger
2026-03-29 20:53:35 -04:00
parent 37e349d3e3
commit 68a1e99e78
88 changed files with 1443 additions and 62 deletions

Binary file not shown.

Binary file not shown.

27
public/emu/cores/nes.js Normal file
View File

@@ -0,0 +1,27 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404: Page not found</title>
<style>
body, html {
background-color: #000;
}
h2, p {
color: #fff;
}
a {
color: #0000EE;
text-decoration: underline;
cursor: pointer;
}
a:visited {
color: #800080;
}
</style>
</head>
<body>
<h2>404: Page not found</h2>
<p>Idk where you're trying to go, but its not here....</p>
<a herf="#" onclick="history.back()">Go Back?</a>
</body>
</html>

27
public/emu/cores/nes.wasm Normal file
View File

@@ -0,0 +1,27 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404: Page not found</title>
<style>
body, html {
background-color: #000;
}
h2, p {
color: #fff;
}
a {
color: #0000EE;
text-decoration: underline;
cursor: pointer;
}
a:visited {
color: #800080;
}
</style>
</head>
<body>
<h2>404: Page not found</h2>
<p>Idk where you're trying to go, but its not here....</p>
<a herf="#" onclick="history.back()">Go Back?</a>
</body>
</html>

View File

@@ -0,0 +1 @@
{ "core": "fceumm", "buildStart": "2026-02-04T02:44:07+00:00", "buildEnd": "2026-02-04T02:45:32+00:00", "options": {} }

27
public/emu/emulator.js Normal file
View File

@@ -0,0 +1,27 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404: Page not found</title>
<style>
body, html {
background-color: #000;
}
h2, p {
color: #fff;
}
a {
color: #0000EE;
text-decoration: underline;
cursor: pointer;
}
a:visited {
color: #800080;
}
</style>
</head>
<body>
<h2>404: Page not found</h2>
<p>Idk where you're trying to go, but its not here....</p>
<a herf="#" onclick="history.back()">Go Back?</a>
</body>
</html>

1
public/emu/emulator.min.css vendored Normal file

File diff suppressed because one or more lines are too long

2
public/emu/emulator.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

264
public/emu/loader.js Normal file
View File

@@ -0,0 +1,264 @@
const folderPath = (path) => {
const filename = path.split("/").pop();
return path.substring(0, path.length - filename.length);
};
function isAbsoluteUrl(path) {
return /^[a-zA-Z][\w.+-]*:\/\//i.test(path);
}
let scriptPath = (typeof window.EJS_pathtodata === "string") ? window.EJS_pathtodata : folderPath((new URL(document.currentScript.src)).pathname);
if (!scriptPath.endsWith("/")) {
scriptPath += "/";
}
if (!scriptPath.startsWith("/") && !isAbsoluteUrl(scriptPath)) {
scriptPath = "../" + scriptPath;
}
const debug = window.EJS_DEBUG_XX === true;
if (debug) {
console.log("Script Path:", scriptPath);
}
function resolvePath(path) {
if ("undefined" != typeof EJS_paths && typeof EJS_paths[path] === "string") {
return EJS_paths[path];
} else if (path.endsWith("emulator.min.js") || path.endsWith("css")) {
return scriptPath + path;
} else {
return scriptPath + "src/" + path;
}
}
async function loadScript(file) {
try {
const script = resolvePath(file);
const module = await import(script);
return module.default;
} catch(e) {
if (debug) console.error(e);
const module = await filesMissing(file);
return module.default;
}
}
function loadStyle(file) {
return new Promise(function(resolve) {
let css = document.createElement("link");
css.rel = "stylesheet";
css.href = resolvePath(file);
css.onload = resolve;
css.onerror = () => {
filesMissing(file).then(e => resolve());
}
document.head.appendChild(css);
})
}
async function filesMissing(file) {
console.error("Failed to load " + file);
let minifiedFailed = file.includes("min");
const errorMessage = `Failed to load ${file} because it's likely that the minified files are missing.
To fix this you have 3 options:
1. You can download the zip from the latest release here: https://github.com/EmulatorJS/EmulatorJS/releases/latest - Recommended
2. You can download the zip from here: https://cdn.emulatorjs.org/stable/data/emulator.min.zip and extract it to the data/ folder
3. You can build the files by running "npm i && npm run build" in the data/minify folder.`;
console[minifiedFailed ? "warn" : "error"](errorMessage);
if (minifiedFailed) {
console.log("Attempting to load non-minified files");
if (file === "emulator.min.js") {
return await loadScript("emulator.js");
} else {
await loadStyle("emulator.css");
}
}
}
function getLanguagePath(language) {
if ("undefined" != typeof EJS_paths && typeof EJS_paths[language] === "string") {
return { path: EJS_paths[language], fallback: null };
}
const base = scriptPath + "localization/" + language + ".json";
let fallback = null;
if (language.includes("-") || language.includes("_")) {
fallback = scriptPath + "localization/" + language.split(/[-_]/)[0] + ".json";
}
return { path: base, fallback };
}
async function fetchJson(path) {
try {
const response = await fetch(path);
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return await response.json();
} catch (e) {
console.warn("Failed to fetch language file:", path, e.message);
return null;
}
}
function mergeLanguages(baseJson, overrideJson) {
if (!baseJson || !overrideJson) return baseJson || overrideJson || {};
return { ...baseJson, ...overrideJson };
}
async function loadLanguage(config) {
const defaultLangs = ["en", "en-US"];
if (!config.language || defaultLangs.includes(config.language)) return config;
console.log("Language:", config.language);
let langData = {};
const paths = getLanguagePath(config.language);
try {
const specificJson = await fetchJson(paths.path);
if (paths.fallback) {
const fallbackJson = await fetchJson(paths.fallback);
langData = mergeLanguages(fallbackJson, specificJson || {});
} else {
langData = specificJson || {};
}
config.langJson = langData;
} catch (e) {
if (paths.fallback) {
const fallbackLang = config.language.split(/[-_]/)[0];
console.warn(`Language '${config.language}' not found, trying '${fallbackLang}'`);
const fallbackJson = await fetchJson(paths.fallback);
if (fallbackJson) {
langData = fallbackJson;
config.langJson = langData;
config.language = fallbackLang;
}
} else {
console.warn(`No language file found for '${config.language}'`);
delete config.language;
delete config.langJson;
}
}
return config;
}
const config = {
debug: debug,
gameUrl: window.EJS_gameUrl,
dataPath: scriptPath,
system: window.EJS_core,
biosUrl: window.EJS_biosUrl,
gameName: window.EJS_gameName,
color: window.EJS_color,
adUrl: window.EJS_AdUrl,
adMode: window.EJS_AdMode,
adTimer: window.EJS_AdTimer,
adSize: window.EJS_AdSize,
alignStartButton: window.EJS_alignStartButton,
VirtualGamepadSettings: window.EJS_VirtualGamepadSettings,
buttonOpts: window.EJS_Buttons,
volume: window.EJS_volume,
defaultControllers: window.EJS_defaultControls,
startOnLoad: window.EJS_startOnLoaded,
fullscreenOnLoad: window.EJS_fullscreenOnLoaded,
filePaths: window.EJS_paths,
loadState: window.EJS_loadStateURL,
cacheLimit: window.EJS_CacheLimit,
cacheConfig: window.EJS_cacheConfig,
cheats: window.EJS_cheats,
cheatPath: window.EJS_cheatPath,
defaultOptions: window.EJS_defaultOptions,
gamePatchUrl: window.EJS_gamePatchUrl,
gameParentUrl: window.EJS_gameParentUrl,
netplayUrl: window.EJS_netplayServer,
netplayICEServers: window.EJS_netplayICEServers,
gameId: window.EJS_gameID,
backgroundImg: window.EJS_backgroundImage,
backgroundBlur: window.EJS_backgroundBlur,
backgroundColor: window.EJS_backgroundColor,
controlScheme: window.EJS_controlScheme,
threads: window.EJS_threads,
disableCue: window.EJS_disableCue,
startBtnName: window.EJS_startButtonName,
softLoad: window.EJS_softLoad,
capture: window.EJS_screenCapture,
externalFiles: window.EJS_externalFiles,
dontExtractRom: window.EJS_dontExtractRom,
dontExtractBIOS: window.EJS_dontExtractBIOS,
disableLocalStorage: window.EJS_disableLocalStorage,
forceLegacyCores: window.EJS_forceLegacyCores,
noAutoFocus: window.EJS_noAutoFocus,
videoRotation: window.EJS_videoRotation,
hideSettings: window.EJS_hideSettings,
browserMode: window.EJS_browserMode,
additionalShaders: window.EJS_shaders,
fixedSaveInterval: window.EJS_fixedSaveInterval,
disableAutoUnload: window.EJS_disableAutoUnload,
disableBatchBootup: window.EJS_disableBatchBootup
};
async function prepareLanguage() {
try {
const systemLang = Intl.DateTimeFormat().resolvedOptions().locale;
config.language = window.EJS_language || systemLang;
if (config.language && window.EJS_disableAutoLang !== false) {
return await loadLanguage(config);
}
} catch (e) {
console.warn("Language detection failed:", e.message);
delete config.language;
delete config.langJson;
}
}
(async function() {
let EmulatorJS;
if (debug) {
EmulatorJS = await loadScript("emulator.js");
await loadStyle("emulator.css");
} else {
EmulatorJS = await loadScript("emulator.min.js");
await loadStyle("emulator.min.css");
}
if (!EmulatorJS) {
console.error("EmulatorJS failed to load. Check for missing files.");
return;
}
await prepareLanguage();
if (debug) {
console.log("Language:", config.language);
console.log("Language JSON loaded:", !!config.langJson);
}
window.EJS_emulator = new EmulatorJS(EJS_player, config);
window.EJS_adBlocked = (url, del) => window.EJS_emulator.adBlocked(url, del);
const handlers = [
["ready", window.EJS_ready],
["start", window.EJS_onGameStart],
["loadState", window.EJS_onLoadState],
["saveState", window.EJS_onSaveState],
["loadSave", window.EJS_onLoadSave],
["saveSave", window.EJS_onSaveSave]
];
handlers.forEach(([event, callback]) => {
if (typeof callback === "function") {
window.EJS_emulator.on(event, callback);
}
});
if (typeof window.EJS_onSaveUpdate === "function") {
window.EJS_emulator.on("saveUpdate", window.EJS_onSaveUpdate);
window.EJS_emulator.enableSaveUpdateEvent();
}
})();

View File

@@ -0,0 +1,27 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404: Page not found</title>
<style>
body, html {
background-color: #000;
}
h2, p {
color: #fff;
}
a {
color: #0000EE;
text-decoration: underline;
cursor: pointer;
}
a:visited {
color: #800080;
}
</style>
</head>
<body>
<h2>404: Page not found</h2>
<p>Idk where you're trying to go, but its not here....</p>
<a herf="#" onclick="history.back()">Go Back?</a>
</body>
</html>

View File

@@ -0,0 +1,340 @@
{
"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",
"LOADED STATE FROM BROWSER": "LOADED STATE FROM BROWSER",
"SAVED STATE TO BROWSER": "SAVED STATE 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",
"Autofire": "Autofire"
}