mirror of
https://github.com/boramalper/system-7.git
synced 2024-11-23 21:31:13 +00:00
first public version!
This commit is contained in:
parent
eaf6d7ca8a
commit
3dcd890f36
BIN
android-hs.png
Normal file
BIN
android-hs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 251 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 38 KiB |
BIN
checkered-bg.png
Normal file
BIN
checkered-bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -6082,6 +6082,7 @@ var SDL = {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
switch (event.type) {
|
||||
case "touchstart":
|
||||
case "touchmove":
|
||||
|
104
index.html
104
index.html
@ -4,7 +4,6 @@
|
||||
<meta charset="utf-8">
|
||||
<title>System 7</title>
|
||||
<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, width=device-width, height=device-height">
|
||||
<link rel="manifest" href="manifest.json">
|
||||
|
||||
<script>window.archive_setup=[]</script>
|
||||
|
||||
@ -40,20 +39,69 @@
|
||||
<body class="navia embedded ia-module tiles">
|
||||
<!-- Wraps all page content -->
|
||||
<div id="wrap">
|
||||
|
||||
<!--HTML-->
|
||||
<div id="emulate">
|
||||
<div id="canvasholder">
|
||||
<canvas id="canvas" style="width:100%;height:100%" width="300" height="150"></canvas>
|
||||
<div id="gamepadtext"></div>
|
||||
<button id="keyboardBtn" onclick="keyboardBtnClicked()">⌨️</button> <!-- keyboard emoji -->
|
||||
<input id="keyboardInput" type="text">
|
||||
<input id="keyboardInput" type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
|
||||
</div>
|
||||
</div><!--/#emulate-->
|
||||
|
||||
<div id="description">
|
||||
<h1>System 7</h1>
|
||||
<i>A System 7 (aka Mac OS 7) emulator for mobile devices.</i>
|
||||
|
||||
<h2>Usage</h2>
|
||||
<ul>
|
||||
<li>Drag your finger across the emulator screen to move the pointer.
|
||||
<ul>
|
||||
<li>On iOS, the emulator screen acts like a <em>touchpad</em> (<i>i.e.</i>
|
||||
the cursor will move as your finger moves, but won't be located under your finger).</li>
|
||||
<li>On Android, the emulator screen acts like a <em>touchscreen</em> (<i>i.e.</i>
|
||||
the cursor will always be located under your finger).</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>If your device has 3D Touch, press hard, otherwise keep your finger at least 500 ms on screen
|
||||
for mouse click.</li>
|
||||
</ul>
|
||||
|
||||
<p>To start using, add this webpage to your Home Screen!</p>
|
||||
|
||||
<div id="images" style="display: flex; justify-content: space-around;">
|
||||
<div>
|
||||
<img class="screenshot" src="ios-hs.jpg" />
|
||||
<br>
|
||||
<center><strong>On iOS</strong></center>
|
||||
</div>
|
||||
<div>
|
||||
<img class="screenshot" src="android-hs.png" />
|
||||
<br>
|
||||
<center><strong>On Android</strong></center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Bugs</h2>
|
||||
<ul>
|
||||
<li>On iOS, keyboard keys are repeated unpredictably a few times.</li>
|
||||
<li>On Android, keyboard doesn't work at all.
|
||||
</ul>
|
||||
|
||||
<p>BUGFIXes are welcome! Find us on <a href="https://github.com/boramalper/system-7">GitHub</a>.</p>
|
||||
|
||||
<h2>Author</h2>
|
||||
<p>Based on <a href="https://archive.org/details/@jason_scott">Jason Scott</a>'s awesome work on <a href="https://archive.org/details/mac_MacOS_7.0.1_compilation">Internet Archive</a>.</p>
|
||||
|
||||
<p>Modified by <a href="http://boramalper.org">Bora M. Alper</a> <bora et boramalper dot org>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
body.embedded {
|
||||
background-color:black;
|
||||
}
|
||||
@ -68,33 +116,37 @@
|
||||
/*cursor: none;*/
|
||||
}
|
||||
|
||||
#keyboardBtn {
|
||||
#keyboardInput {
|
||||
width: 20%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#keyboardInput {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
img.emularity-splash-image {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#description {
|
||||
display: none;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#images {
|
||||
max-width: calc(100vw - 2 * 8px);
|
||||
}
|
||||
|
||||
.screenshot {
|
||||
height: 40vh;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
"use strict";
|
||||
|
||||
if ("standalone" in navigator && !navigator.standalone) {
|
||||
alert("Add to Home Screen to be able to use it!");
|
||||
return;
|
||||
}
|
||||
|
||||
AJS.emulate_setup({"url":"\/stream\/mac_MacOS_7.0.1_compilation?module=pce-macplus&scale=1","identifier":"mac_MacOS_7.0.1_compilation","module":"pce-macplus","scale":"1","screenshot":"\/serve\/mac_MacOS_7.0.1_compilation\/_screenshot.gif"});
|
||||
AJS.emulate();
|
||||
|
||||
// prevIsDeep is to be saved by pce-macplus.js
|
||||
var prevIsDeep = false, isDeep = false;
|
||||
|
||||
function main() {
|
||||
// https://stackoverflow.com/a/34516083/4466589
|
||||
if ("standalone" in navigator && navigator.standalone || window.matchMedia('(display-mode: standalone)').matches) {
|
||||
Pressure.set("#canvas", {
|
||||
start: function(event){
|
||||
// this is called on force start
|
||||
@ -120,12 +172,24 @@
|
||||
// NOTE: this is only called if the polyfill option is disabled!
|
||||
// this is called once there is a touch on the element and the device or browser does not support Force or 3D touch
|
||||
}
|
||||
},
|
||||
{
|
||||
only: "touch",
|
||||
polyfillSpeedUp: 500 // 500 ms
|
||||
});
|
||||
|
||||
function keyboardBtnClicked() {
|
||||
document.getElementById("keyboardInput").focus();
|
||||
AJS.emulate_setup({"url":"\/stream\/mac_MacOS_7.0.1_compilation?module=pce-macplus&scale=1","identifier":"mac_MacOS_7.0.1_compilation","module":"pce-macplus","scale":"1","screenshot":"\/serve\/mac_MacOS_7.0.1_compilation\/_screenshot.gif"});
|
||||
AJS.emulate();
|
||||
|
||||
} else {
|
||||
$("#emulate").css("display", "none");
|
||||
$("#description").css("display", "block");
|
||||
$("html").css("height", "auto");
|
||||
$("body").css("margin", "0px 8px 0px 8px").css("height", "auto").css("width", "auto").css("position", "initial").css("overflow", "initial");
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -197,7 +197,7 @@ var Module = null;
|
||||
cfgr.extraArgs(modulecfg.extra_args));
|
||||
}
|
||||
|
||||
splash.setTitle("Downloading game data...");
|
||||
splash.setTitle("Downloading data...");
|
||||
return Promise.all(get_files(cfgr, metadata, modulecfg, filelist));
|
||||
},
|
||||
function () {
|
||||
@ -250,7 +250,7 @@ var Module = null;
|
||||
var mounts = Object.keys(drives),
|
||||
len = mounts.length;
|
||||
mounts.forEach(function (drive, i) {
|
||||
var title = "Game File ("+ (i+1) +" of "+ len +")",
|
||||
var title = "Hard Disk ("+ (i+1) +" of "+ len +")",
|
||||
filename = drives[drive],
|
||||
url = (filename.includes("/")) ? get_zip_url(filename)
|
||||
: get_zip_url(filename, get_item_name(game));
|
||||
@ -295,7 +295,7 @@ var Module = null;
|
||||
var game_files = Object.keys(game_files_counter),
|
||||
len = game_files.length;
|
||||
game_files.forEach(function (filename, i) {
|
||||
var title = "Game File ("+ (i+1) +" of "+ len +")",
|
||||
var title = "Hard Disk ("+ (i+1) +" of "+ len +")",
|
||||
url = (filename.includes("/")) ? get_zip_url(filename)
|
||||
: get_zip_url(filename, get_item_name(game));
|
||||
files.push(cfgr.mountFile('/'+ filename,
|
||||
@ -328,7 +328,7 @@ var Module = null;
|
||||
game_files = files_with_ext_from_filelist(filelist, meta.emulator_ext);
|
||||
game_files.forEach(function (file, i) {
|
||||
if (file) {
|
||||
var title = "Game File ("+ (i+1) +" of "+ game_files.length +")",
|
||||
var title = "Hard Disk ("+ (i+1) +" of "+ game_files.length +")",
|
||||
url = (file.name.includes("/")) ? get_zip_url(file.name)
|
||||
: get_zip_url(file.name, get_item_name(game));
|
||||
files.push(cfgr.mountFile('/'+ file.name,
|
||||
@ -370,7 +370,7 @@ var Module = null;
|
||||
var game_files = Object.keys(game_files_counter),
|
||||
len = game_files.length;
|
||||
game_files.forEach(function (filename, i) {
|
||||
var title = "Game File ("+ (i+1) +" of "+ len +")",
|
||||
var title = "Hard Disk ("+ (i+1) +" of "+ len +")",
|
||||
ext = filename.match(/\.([^.]*)$/)[1],
|
||||
url = (filename.includes("/")) ? get_zip_url(filename)
|
||||
: get_zip_url(filename, get_item_name(game));
|
||||
@ -1158,7 +1158,7 @@ var Module = null;
|
||||
if (splash.failed_loading) {
|
||||
return;
|
||||
}
|
||||
splash.setTitle("Failed to download game data!");
|
||||
splash.setTitle("Failed to download data!");
|
||||
splash.failed_loading = true;
|
||||
})
|
||||
.then(function () {
|
||||
@ -1201,7 +1201,7 @@ var Module = null;
|
||||
}
|
||||
|
||||
if (game_data.emulatorJS) {
|
||||
splash.setTitle("Launching Emulator");
|
||||
splash.setTitle("Launching System 7");
|
||||
return attach_script(game_data.emulatorJS);
|
||||
} else {
|
||||
splash.setTitle("Non-system disk or disk error");
|
||||
|
BIN
ios-hs.jpg
Normal file
BIN
ios-hs.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 159 KiB |
Loading…
Reference in New Issue
Block a user