|
1 | 1 | (async function () { |
2 | | - console.log("[Loader] ========================================"); |
3 | | - console.log("[Loader] loader.js executing - START"); |
4 | | - console.log("[Loader] ========================================"); |
5 | 2 | const scripts = [ |
6 | 3 | // Netplay modules first (in dependency order) |
7 | 4 | "netplay/core/input/frameworks/SimpleController.js", |
|
60 | 57 | })(); |
61 | 58 | // Debug logging for netplay modules |
62 | 59 | if (file.includes("netplay")) { |
63 | | - console.log("[Loader] 📦 About to load netplay script:", file); |
64 | | - console.log("[Loader] 📦 Full URL will be:", script.src); |
65 | 60 | } |
66 | 61 | script.onload = () => { |
67 | 62 | if (file.includes("netplay")) { |
68 | | - console.log("[Loader] ✅ Netplay script loaded successfully:", file); |
69 | 63 | // Verify critical globals after loading key files |
70 | | - if (file === "netplay/core/NetplayEngine.js") { |
71 | | - const exists = typeof window.NetplayEngine !== "undefined"; |
72 | | - console.log( |
73 | | - "[Loader] 🔍 NetplayEngine global check:", |
74 | | - exists ? "✅ EXISTS" : "❌ MISSING" |
75 | | - ); |
76 | | - if (!exists) { |
77 | | - console.error( |
78 | | - "[Loader] ⚠️ WARNING: NetplayEngine.js loaded but window.NetplayEngine is undefined!" |
79 | | - ); |
80 | | - } |
81 | | - } |
82 | | - if (file === "netplay/adapters/emulatorjs/EmulatorJSAdapter.js") { |
83 | | - const exists = typeof window.EmulatorJSAdapter !== "undefined"; |
84 | | - console.log( |
85 | | - "[Loader] 🔍 EmulatorJSAdapter global check:", |
86 | | - exists ? "✅ EXISTS" : "❌ MISSING" |
87 | | - ); |
88 | | - if (!exists) { |
89 | | - console.error( |
90 | | - "[Loader] ⚠️ WARNING: EmulatorJSAdapter.js loaded but window.EmulatorJSAdapter is undefined!" |
91 | | - ); |
92 | | - } |
93 | | - } |
94 | 64 | } |
95 | 65 | resolve(); |
96 | 66 | }; |
|
157 | 127 | } |
158 | 128 | } |
159 | 129 |
|
160 | | - console.log("[Loader] About to start loading", scripts.length, "scripts"); |
161 | 130 | if ("undefined" != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX) { |
162 | | - console.log("[Loader] Using DEBUG mode"); |
163 | 131 | for (let i = 0; i < scripts.length; i++) { |
164 | | - console.log( |
165 | | - "[Loader] Loading script", |
166 | | - i + 1, |
167 | | - "of", |
168 | | - scripts.length, |
169 | | - ":", |
170 | | - scripts[i] |
171 | | - ); |
172 | 132 | await loadScript(scripts[i]); |
173 | 133 | } |
174 | 134 | await loadStyle("emulator.css"); |
175 | 135 | } else { |
176 | 136 | // RomM uses the SFU fork primarily for netplay; it does not bundle cores. |
177 | 137 | // Always load the non-minified runtime so core CDN fallbacks can be patched |
178 | 138 | // without touching huge single-line minified bundles. |
179 | | - console.log("[Loader] Using non-minified mode (RomM default)"); |
180 | 139 | for (let i = 0; i < scripts.length; i++) { |
181 | | - console.log( |
182 | | - "[Loader] Loading script", |
183 | | - i + 1, |
184 | | - "of", |
185 | | - scripts.length, |
186 | | - ":", |
187 | | - scripts[i] |
188 | | - ); |
189 | 140 | await loadScript(scripts[i]); |
190 | 141 | } |
191 | 142 | await loadStyle("emulator.css"); |
192 | 143 | } |
193 | | - console.log("[Loader] ========================================"); |
194 | | - console.log("[Loader] All scripts loaded, initializing EmulatorJS"); |
195 | | - console.log( |
196 | | - "[Loader] Checking for NetplayEngine:", |
197 | | - typeof window.NetplayEngine |
198 | | - ); |
199 | | - console.log( |
200 | | - "[Loader] Checking for EmulatorJSAdapter:", |
201 | | - typeof window.EmulatorJSAdapter |
202 | | - ); |
203 | | - console.log("[Loader] ========================================"); |
204 | 144 | const config = {}; |
205 | 145 | config.gameUrl = window.EJS_gameUrl; |
206 | 146 | config.dataPath = scriptPath; |
|
0 commit comments