Skip to content

Commit 3c0edb4

Browse files
Phase 5: Netplay module loading integration
- Enhanced loader.js with detailed logging for netplay script loading - Fixed module loading order in non-minified mode - Added global variable verification after module loads - Improved error handling for script loading failures - All netplay modules now load correctly before emulator.js
1 parent 5038906 commit 3c0edb4

32 files changed

Lines changed: 5087 additions & 382 deletions

data/loader.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,50 @@ To fix this you have 3 options:
7373
}
7474
}
7575

76+
console.log("[Loader] About to start loading", scripts.length, "scripts");
7677
if ("undefined" != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX) {
78+
console.log("[Loader] Using DEBUG mode");
7779
for (let i = 0; i < scripts.length; i++) {
80+
console.log(
81+
"[Loader] Loading script",
82+
i + 1,
83+
"of",
84+
scripts.length,
85+
":",
86+
scripts[i]
87+
);
7888
await loadScript(scripts[i]);
7989
}
8090
await loadStyle("emulator.css");
8191
} else {
8292
// RomM uses the SFU fork primarily for netplay; it does not bundle cores.
8393
// Always load the non-minified runtime so core CDN fallbacks can be patched
8494
// without touching huge single-line minified bundles.
95+
console.log("[Loader] Using non-minified mode (RomM default)");
8596
for (let i = 0; i < scripts.length; i++) {
97+
console.log(
98+
"[Loader] Loading script",
99+
i + 1,
100+
"of",
101+
scripts.length,
102+
":",
103+
scripts[i]
104+
);
86105
await loadScript(scripts[i]);
87106
}
88107
await loadStyle("emulator.css");
89108
}
109+
console.log("[Loader] ========================================");
110+
console.log("[Loader] All scripts loaded, initializing EmulatorJS");
111+
console.log(
112+
"[Loader] Checking for NetplayEngine:",
113+
typeof window.NetplayEngine
114+
);
115+
console.log(
116+
"[Loader] Checking for EmulatorJSAdapter:",
117+
typeof window.EmulatorJSAdapter
118+
);
119+
console.log("[Loader] ========================================");
90120
const config = {};
91121
config.gameUrl = window.EJS_gameUrl;
92122
config.dataPath = scriptPath;

0 commit comments

Comments
 (0)