Demonstration of C1Pjs loading and running *without* a web server

file:///pcjs/configs/c1p/machines/8kb/large/debugger/demo.html (your root directory may vary)
This commit is contained in:
Jeff Parsons 2014-10-29 16:41:32 -07:00 • committed by jeffpar
commit f2e092e57c
10 changed files with 408 additions and 317 deletions

View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html style="background-color: #1d1d1d">
<head>
<title>pcjs.org | /configs/c1p/machines/8kb/large/debugger/</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="../../../../../../versions/images/current/favicon.ico">
<link rel="stylesheet" type="text/css" href="../../../../../../my_modules/shared/templates/common.css">
<link rel="stylesheet" type="text/css" href="../../../../../../my_modules/c1pjs-client/templates/components.css">
</head>
<body>
<div class="common">
<div class="common-top">
<div class="common-top-left">
<ul>
<li><a href="../../../../../../">Home</a></li>
<li><a href="../../../../../../apps/pc/">Apps</a></li>
<li><a href="../../../../../../disks/pc/">Disks</a></li>
<li><a href="../../../../../../configs/">Machines</a></li>
<li><a href="../../../../../../docs/">Docs</a></li>
<li><a href="../../../../../../pubs/">Pubs</a></li>
<li><a href="../../../../../../blog/">Blog</a></li>
<li><a href="../../../../../../docs/about/">About</a></li>
</ul>
</div>
<div class="common-top-right">
<p>Powered by <a href="http://nodejs.org" target="_blank">Node.js</a> and <a href="http://aws.amazon.com/about-aws/whats-new/2013/03/11/announcing-aws-elastic-beanstalk-for-node-js/" target="_blank">AWS</a></p>
</div>
</div>
<div class="common-middle">
<h4>Directory of C:\<a href="../../../../../../">PCJS.ORG</a>\CONFIGS\C1P\MACHINES\8KB\LARGE\DEBUGGER</h4>
<div class="common-sidebar">
<ul class="common-list">
<li><a href="../../../../../../configs/c1p/machines/8kb/large">\..</a></li>
<li><a href="../../../../../../configs/c1p/machines/8kb/large/debugger/demo.html">\DEMO.HTML</a></li>
<li><a href="../../../../../../configs/c1p/machines/8kb/large/debugger/machine.xml">\MACHINE.XML</a></li>
</ul>
</div>
<div class="common-main">
<div id="c1p8kb" class="machine-placeholder"><p>Embedded C1P</p><p class="machine-warning">Waiting for C1Pjs to load</p></div>
<div class="common-bottom">
<p class="common-reference"></p>
<p class="common-copyright">
<span class="common-copyright"><a href="http://www.pcjs.org/">pcjs.org</a> website © 2012-2014 by <a href="http://twitter.com/jeffpar">@jeffpar</a></span><br/>
<span class="common-copyright">PCjs and C1Pjs released under <a href="http://gnu.org/licenses/gpl.html">GPL version 3 or later</a></span>
</p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/defines.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/dumpapi.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/reportapi.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/strlib.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/usrlib.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/weblib.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/component.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/defines.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/panel.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/cpu.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/rom.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/ram.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/keyboard.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/video.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/serial.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/disk.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/debugger.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/c1pjs-client/lib/computer.js"></script>
<script type="text/javascript" src="../../../../../../my_modules/shared/lib/embed.js"></script>
<script type="text/javascript">window.embedC1P("c1p8kb","machine.xml","../../../../../../my_modules/c1pjs-client/templates/components.xsl");</script>
</body>
</html>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.7/machine.xsl"?>
<?xml-stylesheet type="text/xsl" href="../../../../../../versions/c1pjs/1.15.7/machine.xsl"?>
<machine id="c1p8kb" class="c1p" border="1" width="100%" style="background-color:#FAEBD7;padding-bottom:8px">
<name>OSI Challenger 1P (8Kb) with Debugger</name>
<computer id="c1p" name="Challenger 1P">
@ -16,9 +16,9 @@
<debugger id="debugger"/>
<ram id="ram8K" size="0x2000"/>
<rom id="romNull" size="0x8000"/>
<rom id="romBasic" size="0x2000" image="/devices/c1p/roms/basic-gcpatch.hex"/>
<rom id="romSystem" size="0x0800" image="/devices/c1p/roms/system.hex"/>
<video id="video" screenwidth="512" screenheight="384" cols="32" rows="32" charset="/devices/c1p/video/chargen2x.png" width="512px" padding="8px">
<rom id="romBasic" size="0x2000" image="../../../../../../devices/c1p/roms/basic-gcpatch.hex"/>
<rom id="romSystem" size="0x0800" image="../../../../../../devices/c1p/roms/system.hex"/>
<video id="video" screenwidth="512" screenheight="384" cols="32" rows="32" charset="../../../../../../devices/c1p/video/chargen2x.png" width="512px" padding="8px">
<name>Video Display</name>
</video>
<keyboard id="keyboard" padleft="8px">
@ -26,6 +26,6 @@
<control type="button" class="input" binding="ctrl-o">CTRL-O</control>
<control type="button" class="input" binding="break">BREAK</control>
</keyboard>
<serial ref="/configs/c1p/serial/samples.xml"/>
<panel ref="/configs/c1p/panels/default.xml"/>
<serial ref="../../../../serial/samples.xml"/>
<panel ref="../../../../panels/default.xml"/>
</machine>

View file

@ -154,7 +154,7 @@ C1PROM.prototype.setByte = function(addr, addrFrom)
C1PROM.prototype.convertImage = function(sImageName, sImageData, nErrorCode)
{
if (nErrorCode) {
this.println("ROM load error (" + nErrorCode + ")");
this.println("Error loading ROM \"" + sImageName + "\" (" + nErrorCode + ")");
return;
}
if (sImageData[0] == "[") {
@ -168,7 +168,7 @@ C1PROM.prototype.convertImage = function(sImageName, sImageData, nErrorCode)
//
// System exceptions throw an object with a message property, whereas exceptions I throw myself do not (they're just strings)
//
this.println("ROM data error: " + (e.message || e));
this.println("Error processing ROM \"" + sImageName + "\": " + (e.message || e));
return;
}
}

View file

@ -180,10 +180,14 @@ web.loadResource = function(sURL, fAsync, data, componentNotify, fnNotify, pNoti
* pending, any debugging activity means most of them simply get dropped on floor, so what may actually be
* happening are mis-notifications rather than redundant notifications.
*
xmlHTTP.onreadystatechange = undefined;
* xmlHTTP.onreadystatechange = undefined;
*/
sURLData = xmlHTTP.responseText;
if (xmlHTTP.status == 200) {
/*
* The normal "success" case is an HTTP status code of 200, but when testing with files loaded
* from the local file system (ie, when using the "file:" protocol), we have to be a bit more "flexible".
*/
if (xmlHTTP.status == 200 || !xmlHTTP.status && sURLData.length && web.getHostProtocol() == "file:") {
Component.log("xmlHTTP.onreadystatechange(" + sURL + "): returned " + sURLData.length + " bytes");
}
else {
@ -284,6 +288,16 @@ web.getHostURL = function()
return (window? window.location.href : null);
};
/**
* getHostProtocol()
*
* @return {string}
*/
web.getHostProtocol = function()
{
return (window? window.location.protocol : "file:");
};
/**
* getUserAgent()
*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -21,7 +21,7 @@
<li><a href="/apps/pc/">Apps</a></li>
<li><a href="/disks/pc/">Disks</a></li>
<li><a href="/configs/">Machines</a></li>
<li><a href="/docs/pcjs/">Docs</a></li>
<li><a href="/docs/">Docs</a></li>
<li><a href="/pubs/">Pubs</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/docs/about/">About</a></li>

View file

@ -21,7 +21,7 @@
<li><a href="/apps/pc/">Apps</a></li>
<li><a href="/disks/pc/">Disks</a></li>
<li><a href="/configs/">Machines</a></li>
<li><a href="/docs/pcjs/">Docs</a></li>
<li><a href="/docs/">Docs</a></li>
<li><a href="/pubs/">Pubs</a></li>
<li><a href="/blog/">Blog</a></li>
<li><a href="/docs/about/">About</a></li>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long