forked from Namaneo/Junie
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (43 loc) · 1.72 KB
/
index.html
File metadata and controls
54 lines (43 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>
<script type="text/javascript" src="matoya.js"></script>
<script type="text/javascript" src="database.js"></script>
<script type="text/javascript" src="logging.js"></script>
<script type="text/javascript" src="events.js"></script>
<script type="text/javascript" src="emulators.js"></script>
<script type="text/javascript">
//Retrieve context parameters
const params = decodeURI(window.location.hash).split('/');
const system = params[1];
const core = systems[system];
const game = params[2];
//Adjust request URL prefixes
const _fetch = window.fetch;
window.fetch = request => {
request = location.pathname + request.replace(location.origin, '');
request = request.replace('//', '/');
return _fetch(request);
}
//Start core execution
MTY_Start(`${core.library}.wasm`, {
js_get_host: (value, length) => MTY_StrToC(window.location.hostname, value, length),
js_get_port: () => window.location.port ?? 0,
js_is_secure: () => location.protocol.indexOf('https') != -1,
js_get_system: (value, length) => MTY_StrToC(system, value, length),
js_get_core: (value, length) => MTY_StrToC(core.name, value, length),
js_get_game: (value, length) => MTY_StrToC(game, value, length),
js_clear_request: (index) => delete MTY.reqs[index],
js_read_file: JUN_ReadFile,
js_write_file: JUN_WriteFile,
}, () => history.back(), 'webgl');
//Prevent mobile keyboard
MTY.clip.readOnly = true;
</script>
</body>
</html>