fixed embedui

This commit is contained in:
Steven Hugg 2020-06-13 08:47:10 -05:00
parent 3f04fca6d4
commit 9396a2ddbb
3 changed files with 45 additions and 11 deletions

View File

@ -412,3 +412,27 @@ cc65 headers
example headers (presets/*/*.h)
libcv headers (src/worker/lib)
ASM includes
NETPLAY
runs alongside of emulator, doesn't modify controls (just state)
when controls change: player sends control inputs + frame#
add latency so clients more often are in sync
if miss latency window, client syncs state (moves forward a few frames?)
state checksum?
socket.io
X86
https://github.com/freebasic/fbc
GW-BASIC
http://www.grifo.com/SOFT/Pacific/uk_pacific.html
http://www.cpm.z80.de/small_c.html
https://github.com/open-watcom
Free Pascal
https://bellard.org/tcc/
https://wiki.osdev.org/Smaller_C
https://yasm.tortall.net/
https://wiki.osdev.org/Tool_Comparison

View File

@ -530,8 +530,8 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<!--
<script src="javatari.js/src/main/Javatari.js"></script>
<script src="javatari.js/temp/javatari.part.concat.js"></script>
<script src="src/common/cpu/z80.js"></script>
-->
<script src="src/cpu/z80.js"></script>
<script src="jsnes/dist/jsnes.min.js"></script>
<script src="src/common/cpu/6809.js"></script>
<!--<script src="jsnes/lib/dynamicaudio-min.js" type="text/javascript" charset="utf-8"></script>-->

View File

@ -130,11 +130,10 @@ function recordVideo(intervalMsec, maxFrames, callback) {
});
}
function startPlatform(qs) {
async function startPlatform(qs) {
if (!PLATFORMS[platform_id]) throw Error("Invalid platform '" + platform_id + "'.");
platform = new PLATFORMS[platform_id]($("#emuscreen")[0]);
platform.start();
await platform.start();
// start recorder when click on canvas (TODO?)
if (qs['rec']) {
findPrimaryCanvas().on('focus', () => {
@ -164,21 +163,32 @@ function startPlatform(qs) {
return true;
}
function loadPlatform(qs) {
// TODO: merge with ui
async function loadPlatform(qs) {
if (qs.data) qs = qs.data;
platform_id = qs['p'];
if (!platform_id) throw('No platform variable!');
var platformfn = 'gen/platform/' + platform_id.split(/[.-]/)[0] + '.js'; // required file
var machinefn = platformfn.replace('/platform/', '/machine/'); // optional file
loadScript(platformfn).then( () => {
return loadScript(machinefn).catch(() => { console.log('skipped',machinefn); }); // optional file skipped
}).then( () => {
try {
await loadScript(platformfn); // load platform file
} catch (e) {
console.log(e);
throw('Platform "' + platform_id + '" not supported.');
return;
}
try {
await loadScript(machinefn); // load machine file
} catch (e) {
console.log('skipped',machinefn); // optional file skipped
}
try {
console.log("starting platform", platform_id); // loaded required <platform_id>.js file
startPlatform(qs);
}).catch( (e) => {
await startPlatform(qs);
} catch (e) {
console.log(e);
alert('Platform "' + platform_id + '" not supported.');
});
}
}
export function loadScript(scriptfn:string) : Promise<Event> {