From 98d114a4327c015cd8a2c7542583a38de36b4637 Mon Sep 17 00:00:00 2001 From: Jeff Parsons Date: Thu, 21 Apr 2016 10:26:23 -0700 Subject: [PATCH] Fixed PC8080 build --- Gruntfile.js | 21 +- versions/pc8080/1.21.7/common.css | 262 ++++++ versions/pc8080/1.21.7/common.xsl | 59 ++ versions/pc8080/1.21.7/components.css | 148 ++++ versions/pc8080/1.21.7/components.xsl | 1138 +++++++++++++++++++++++++ versions/pc8080/1.21.7/document.css | 162 ++++ versions/pc8080/1.21.7/document.xsl | 452 ++++++++++ versions/pc8080/1.21.7/machine.xsl | 49 ++ versions/pc8080/1.21.7/manifest.xsl | 247 ++++++ versions/pc8080/1.21.7/outline.xsl | 47 + versions/pc8080/1.21.7/pc8080-dbg.js | 165 ++++ versions/pc8080/1.21.7/pc8080.js | 92 ++ 12 files changed, 2841 insertions(+), 1 deletion(-) create mode 100644 versions/pc8080/1.21.7/common.css create mode 100644 versions/pc8080/1.21.7/common.xsl create mode 100644 versions/pc8080/1.21.7/components.css create mode 100644 versions/pc8080/1.21.7/components.xsl create mode 100644 versions/pc8080/1.21.7/document.css create mode 100644 versions/pc8080/1.21.7/document.xsl create mode 100644 versions/pc8080/1.21.7/machine.xsl create mode 100644 versions/pc8080/1.21.7/manifest.xsl create mode 100644 versions/pc8080/1.21.7/outline.xsl create mode 100644 versions/pc8080/1.21.7/pc8080-dbg.js create mode 100644 versions/pc8080/1.21.7/pc8080.js diff --git a/Gruntfile.js b/Gruntfile.js index ad217bc1b..702f6e821 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -414,7 +414,8 @@ module.exports = function(grunt) { ], options: { process: function(content, srcPath) { - var s = content.replace(/()[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2"); + var s = content.replace(/()[^<]*(<\/xsl:variable>)/g, "$1pc8080$2"); + s = s.replace(/()[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2"); s = s.replace(/"[^"]*\/?(common.css|common.xsl|components.css|components.xsl|document.css|document.xsl)"/g, '"/versions/pc8080/' + pkg.version + '/$1"'); s = s.replace(/[ \t]*\/\*[^\*][\s\S]*?\*\//g, "").replace(/[ \t]*[ \t]*\n?/g, ""); return s; @@ -455,6 +456,24 @@ module.exports = function(grunt) { } } }, + "pc8080": { + files: [ + { + cwd: "modules/shared/templates/", + src: ["components.*"], + dest: "versions/pc8080/<%= pkg.version %>/", + expand: true + } + ], + options: { + process: function(content, srcPath) { + var s = content.replace(/()[^<]*(<\/xsl:variable>)/g, "$1pc8080$2"); + s = s.replace(/()[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2"); + s = s.replace(/[ \t]*\/\*[^\*][\s\S]*?\*\//g, "").replace(/[ \t]*[ \t]*\n?/g, ""); + return s; + } + } + }, "examples": { files: [ { diff --git a/versions/pc8080/1.21.7/common.css b/versions/pc8080/1.21.7/common.css new file mode 100644 index 000000000..48999bc28 --- /dev/null +++ b/versions/pc8080/1.21.7/common.css @@ -0,0 +1,262 @@ +@CHARSET "UTF-8"; +/** + @author Jeff Parsons (@jeffpar) + @website http://www.pcjs.org/ + @created 2013-05-05 + @modified 2014-02-23 + @license http://www.gnu.org/licenses/gpl.html + */ +body { + margin: 0; + background: #202020; +} +h1, h2 { + margin-top: 0; + color: #cccccc; +} +h1, h2, h3, h4 { + word-wrap: break-word; +} + +h4 a { + color: #cccccc !important; +} +p { + line-height: 1.5em; +} +img { + max-width: 100%; +} +a img { + vertical-align: bottom; +} +pre, code { + color: #000000; + background-color: #cccccc; + font-family: Monaco, Consolas, "Lucida Console", monospace; + font-size: 12px; +} +pre { + margin: 1em 2em; + padding: 1em; + border-radius: 5px; + overflow: auto; +} +code { + padding: 1px; +} +pre a, code a { + color: #006400 !important; +} +.common { + width: 100%; + margin: 0 auto; + color: #cccccc; +} +.common a { + + color: #7fc07f; + text-decoration: none; +} +.common hr { + border-color: #808080; +} +.common a:hover { + text-decoration: underline; +} +.common, .machine { + font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; + font-size: 15px; +} +.machine { + margin: 15px; + overflow: hidden; +} +.c1pjs { + overflow: visible; +} +.machine-placeholder { + text-align: center; + font-weight: bold; +} +.common-top { + background: #202020; + font-size: small; +} +.common-top-left { + float: left; + width: 60%; +} +.common-top-left ul { + line-height: 1.5em; + list-style-type: none; + margin: 0; + padding: 1em 1em 1em 9px; + overflow: hidden; +} +.common-top-left ul li { + display: block; + float: left; +} +.common-top-left ul li a { + border-right: 1px solid #6f6f6f; + padding: 2px 6px 2px 6px; +} +.common-top-left ul li:last-child a { + border-right: none; +} +.common-top-right { + float: right; + width: 40%; +} +.common-top-right p { + float: right; + margin: 0; + padding: 1em; +} +.common-middle { + clear: both; + padding: 1px 1em 1px 1em; + background: #404040; +} +.common-sidebar { + float: left; + font-size: small; + width: 140px; + padding-bottom: 20px; + overflow: hidden; + white-space: nowrap; + word-wrap: break-word; +} +.common-list { + list-style-type: none; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; +} +.common-list li { + + padding-bottom: 7px; +} +.common-list-data { + list-style-type: none; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; +} +.common-list-data li { + line-height: 1.5em; +} +.common-list-data-items, .common-list-data-subitems { + font-size: x-small; + list-style-type: none; + margin-top: 0; + margin-bottom: 0; + padding-left: 2em; +} +.common-list-data-items li, .common-list-data-subitems li { + padding-bottom: 0; +} +.common-main { + margin-left: 150px; + +} +.common-image-gallery { + margin: 0 auto; + text-align: center; +} +.common-image-gallery:after { + content: ''; + display: block; +} +.common-image-frame { + display: inline-block; + margin: 8px; + text-align: center; +} +.common-image-link { + padding: 5px; + border: 1px solid black; + border-radius: 5px; + background-color: #FAEBD7; +} +.common-image-label { + font-size: x-small; +} +.common-bottom { + clear: both; + padding-top: 1em; +} +.common-bottom:after { + content: ''; + display: block; + clear: both; +} +.common-reference { + float: left; + font-size: x-small; +} +.common-reference a { + text-decoration: none; +} +.common-copyright { + float: right; + font-size: x-small; +} +.common-copyright a { + text-decoration: none; +} +.md-list { +} +.md-list li { + line-height: 1.5em; + margin-bottom: 1em; +} +.md-list li p { + padding-left: 2em; +} +.md-list-compact { +} +.md-list-compact li { + margin-bottom: 0; +} +.md-list-none { + list-style-type: none; + padding-left: 2em; +} +.md-list-none li { + margin-bottom: 0; +} +@media screen and (max-width: 900px) { + + .common-sidebar { + width: 100%; + white-space: normal; + } + .common-list { + padding-left: 0; + } + .common-list-data { + padding-left: 0; + } + .common-sidebar h4, .common-list li, .common-list-data li, .common-list-data-items li { + width: 130px; + float: left; + overflow: hidden; + vertical-align: top; + padding-right: 1em; + margin-top: 0; + } + .common-list-data-subitems { + display: none; + } + .common-main { + clear: both; + margin-left: 0; + padding-left: 0; + padding-right: 0; + } + .md-list-none { + padding-left: 1em; + } +} diff --git a/versions/pc8080/1.21.7/common.xsl b/versions/pc8080/1.21.7/common.xsl new file mode 100644 index 000000000..0855d530f --- /dev/null +++ b/versions/pc8080/1.21.7/common.xsl @@ -0,0 +1,59 @@ + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+

Powered by JavaScript and GitHub

+
+
+
+ + +
+

+ +
+
+ +
diff --git a/versions/pc8080/1.21.7/components.css b/versions/pc8080/1.21.7/components.css new file mode 100644 index 000000000..03664918e --- /dev/null +++ b/versions/pc8080/1.21.7/components.css @@ -0,0 +1,148 @@ +@CHARSET "UTF-8"; + + +*:not(input,textarea) { + -webkit-user-select: none; +} +.pcjs-embed { +} +.pcjs-embed:after { + clear:both; +} +.pcjs-machine { +} +.pcjs-name, .pcjs-menu { + clear: both; + font-weight: bold; + padding-bottom: 4px; +} +.pcjs-menu { + float: left; +} +.pcjs-canvas { + width: 100%; + height: auto; +} +.pcjs-container { + color: #000000; + position: relative; +} +.pcjs-label { + font-size: small; + line-height: 19px; + vertical-align: middle; + float: left; + font-family: "Lucida Console", monospace; +} +.pcjs-controls textarea { + font-family: Monaco, monospace; + font-size: x-small; +} +.pcjs-fieldset { + border: none; + margin: 0; + padding: 0; +} +.pcjs-flag { + font-family: "Lucida Console", monospace; + font-size: small; + text-align: center; + line-height: 19px; + vertical-align: middle; +} +.pcjs-register { + font-family: "Lucida Console", monospace; + font-size: small; + text-align: center; + line-height: 19px; + vertical-align: middle; + border: 1px solid black; +} +.pcjs-switches { + float: left; +} +.pcjs-bitBucket { + float: left; + width: 19px; + height: 38px; +} +.pcjs-bitCell { + float: left; + width: 19px; + height: 19px; + margin-right: -1px; + margin-bottom: -1px; + border: 1px solid black; + text-align: center; + line-height: 19px; +} +.pcjs-bitCellLeft { + border-left: 1px solid black; +} +.pcjs-bitLabel { + font-size: xx-small; + text-align: center; +} +.pcjs-description, .pcjs-status { + font-size: x-small; + line-height: 2em; +} +.pcjs-key { + border: 1px solid black; + font-size: x-small; + text-align: center; + position: absolute; + height: 34px; + line-height: 34px; + background-color: #ffffff; +} +.pcjs-led { + float: left; + width: 8px; + height: 8px; + margin: 4px; + border: 1px solid black; + text-align: center; + line-height: 19px; + background-color: #000000; +} +.pcjs-screen { + clear: both; + height: auto; + position: relative; + line-height: 0; +} +.pcjs-screen textarea { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + opacity: 0; + border: 0; + padding: 0; + line-height: 0; +} +.pcjs-reference { + float: left; + font-size: x-small; +} +.pcjs-reference a { + text-decoration: none; +} +.pcjs-copyright { + float: right; + font-size: x-small; +} +.pcjs-copyright a { + text-decoration: none; +} + +@media screen and (max-width: 900px) { + .pcjs-textarea { + width: 100% !important; + } + .pcjs-registers { + width: 100% !important; + } +} diff --git a/versions/pc8080/1.21.7/components.xsl b/versions/pc8080/1.21.7/components.xsl new file mode 100644 index 000000000..4be8327a6 --- /dev/null +++ b/versions/pc8080/1.21.7/components.xsl @@ -0,0 +1,1138 @@ + + + + + + + + + + + pc + pcjs + pc8080 + 1.21.7 + www.pcjs.org + + + + + + + + + + + + + + + + + /devices/pc/machine/5150/mda/64kb/machine.xml + + + + + + + + + + + + + + + + + + + + + + + + + + float: + + + + js + + + +
+ + + + + + + + + + js + + + "" + + + + + +
+
+ + + + + + + + + + + + + + + , + + + + + + + + + + + + + .machine + . + . + + + + + + + + + + + + + + + + + + + + ,comment:'' + + + + + + border:1px solid black;border-radius:15px; + border:; + + + + + + left:; + + + + + + top:; + + + + + + + + width:; + width:;max-width:; + width:auto;max-width:; + + + + + + + + height:; + + + + + + padding:; + + padding-top:; + padding-right:; + padding-bottom:; + padding-left:; + + + + + + float:left; + float:right; + margin:0 auto;clear:both; + position:; + position:relative; + + + + + overflow:auto;width:100%; + background-color:; + + + + - -component + +
+ + + + + + +
+ + + + + + + + --object -screen + + +
+
+ +
+ +
+
+ + + + +
+ + +
[XML]
+ +
+ + +
+
+
+
+ + + + + text-align:center; + + + +

+
+ + +
+
+ + + + + + +
+
+ + + + type:'' + + + binding:'' + + + value:'' + + + + border:1px solid black; + border:; + + + + + + width:; + + + + + + height:; + + + + + + left:; + + + + + + top:; + + + + + + padding:; + + padding-top:; + padding-right:; + padding-bottom:; + padding-left:; + + + + + + float:left; + float:right; + margin:0 auto; + position:; + position:relative; + float:left; + + + + + + + + + + + + + + + + + + +
+ + + font-size:; + + + + + -label + + + + width:; + width:; + + + + + + + + text-align:right; + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+
+ +
+
+ +
+
+ + + + +
+
+ +
+
+
+ + +
+
+
+
+
+
+ + + + + + + + + + desc:'' + + ,href:'' + + + + + + + + + + + + + + + desc:'' + + ,href:'' + + + + + + + + ; + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + desc:'' + + ,href:'' + + + + + + + + + + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8088 + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + 1 + + + + + + + null + + + + + + + -1 + + + + + + + -1 + + + + + + + -1 + + + + + + ,model:,stepping:'',fpu:,cycles:,multiplier:,autoStart:,csStart:,csInterval:,csStop: + + + + + + + + + + + + + + + 8087 + + + + + + + + + + + + ,model:,stepping:'' + + + + + + + + + + + + + + + 5150 + + + + + + + + + + + + + + + + + + true + + + + + + false + + + + + + {} + + + + + + + + + + + + + + + + + chipset + ,model:'',scaleTimers:,sw1:'',sw2:'',sound:,floppies:,monitor:'',rtcDate:'' + + + + + + + + + + + + + + + + + + + + keyboard + ,model:'' + + + + + + + + + + + + + + + 0 + + + + + + + + + + + parallel + ,adapter:,binding:'' + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + 0 + + + + + + + 0 + + + + + serial + ,adapter:,binding:'',tabSize:,charBOL: + + + + + + + + + + + + + + + + + + + + mouse + ,serial:'' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fdc + ,autoMount:'',sortBy:'' + + + + + + + + + + + + + + + + + + + + + xt + + + + + hdc + ,drives:'',type:'' + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + null + + + + + + + + + + + + + + + + + rom + ,addr:,size:,alias:,file:'',notify:'' + + + + + + + + + + + + + + + 0 + + + + + + 0 + + + + + + true + + + + + ram + ,addr:,size:,test: + + + + + + + + + + + + + + + + + + + + + null + + + + + + + 256 + + + + + + + 224 + + + + + + 0 + + + + + + + + + + + + false + + + + + + + 80 + + + + + + + 25 + + + + + + + + + + + + + + + black + + + + + + + + + + + + + + false + + + + + video + ,model:'',mode:,screenWidth:,screenHeight:,memory:,switches:'',scale:,charCols:,charRows:,fontROM:'',screenColor:'',touchScreen:'',autoLock: + + + + + + + + + + + + + + + + + + + + + + + + + + debugger + ,commands:'',messages:'' + + + + + + + + + + + + + + panel + + + + + + + + + + + + + + + + + + + + + true + + + + + + + 20 + + + + + + 0 + + + + + + + + + + + + computer + ,autoPower:,busWidth:,resume:,state:'' + + + + + + + +
diff --git a/versions/pc8080/1.21.7/document.css b/versions/pc8080/1.21.7/document.css new file mode 100644 index 000000000..7072b406e --- /dev/null +++ b/versions/pc8080/1.21.7/document.css @@ -0,0 +1,162 @@ +@CHARSET "UTF-8"; + +.page { + margin: 2% 2%; + padding: 2% 2%; + min-width: 30em; + overflow: auto; + font-size: large; + font-family: Helvetica, Arial, sans-serif; + background: #303030; + color: #ccc; + +} +.page-header { +} +.page-header-title { + text-align: center; + +} +.page a { + color: #7fc07f; + text-decoration: none; +} +a.footlink, a.paralink { + text-decoration: none; +} +a.footlink:link, a.paralink:link { + color: blue; +} +a.footlink:visited, a.paralink:visited { + color: blue; +} +.galleryitem { + float: left; + width: 200px; +} +.item { + float: left; + width: 2em; + text-indent: 1em; +} +.list { + margin-left: 3em; + text-indent: 0; + text-align: justify; +} +ul { + list-style: none; +} +div.pnumber { + float: left; + width: 2em; + text-indent: 1em; +} +div.pitem { + margin-left: 10em; +} +p.indent, .justified p { + text-indent: 2em; + text-align: justify; + line-height: 1.5em; +} +p.noindent { + text-indent: 0; + text-align: justify; +} +p.center, .center { + text-align: center; +} +li.para { + margin-top: 1em; + margin-bottom: 1em; +} +.left { + text-align: left; +} +.right { + text-align: right; +} +blockquote.tag { + font-size: small; + font-family: Monaco, Fixed, monospace; + margin-top: 0; + margin-bottom: 0; +} +.blockquote { + padding-left: 1em; + text-indent: 0; + text-align: justify; +} +.italics { + font-style: italic; +} +.medium { + font-size: medium; +} +.small { + font-size: x-small; +} +.smallcaps { + font-variant: small-caps; +} +.strike { + text-decoration: line-through; +} +.summation, .bracelist { + display: inline-block; + position: relative; + vertical-align: middle; + text-align: center; + margin-bottom: 0.5ex; + text-indent: 0; +} +.bracelist-symbol { + font-size: 3em; + vertical-align: -40%; +} +.summation .summation-lower, .summation .summation-upper, .bracelist-item { + display: block; + font-size: 75%; + text-align: center; +} +.summation .summation-upper { + margin-bottom: 0; + margin-left: 0.8ex; + font-style: italic; +} +.summation .summation-lower{ + margin-bottom: -0.6ex; + font-style: italic; +} +.summation .summation-symbol { + font-size: 2em; +} +p sup { + vertical-align: baseline; + position: relative; + bottom: .5em; + font-size: small; +} +p sub { + vertical-align: baseline; + position: relative; + bottom: -.5em; + font-size: small; +} +.footnote { + font-size: medium; + text-indent: 1em; + text-align: justify; + margin-top: .5em; +} +.image-right { + float: right; + margin-left: 1em; + margin-top: 1em; + margin-bottom: 1em; +} +.image-caption { + font-size: small; + text-align: center; +} \ No newline at end of file diff --git a/versions/pc8080/1.21.7/document.xsl b/versions/pc8080/1.21.7/document.xsl new file mode 100644 index 000000000..b17419fb6 --- /dev/null +++ b/versions/pc8080/1.21.7/document.xsl @@ -0,0 +1,452 @@ + + + + + +]> + + + + + + + + + +

+
+ + + + + + + +

+
+ +

+
+
+
+ + + + + + +
+
+ + +
+ +   + + +
+
+ +
+
+ + + + + + + + + + + + + + + + +

+
+ + +

+
+ + +

+
+ + +
+
+ + +
+
+ + + + + + + + + + + + + + +
+
+ + +
+
+ + +
  • +
    + + +
    image
    +
    + + +
    +
    + + + + +
    {.}
    +
    + +
    {.}
    +
    +
    +
    + + + + + + + + + + < + > + + + + × + + ÷ + σ + + + + + + + + + + + + { + + + + + + + + + + [] + + + + +
    + +
    +
    + + + , and + + + + + MDY + + + + + + + + + + + + + + + + + + + + January + February + March + April + May + June + July + August + September + October + November + December + + + , + + + + + +

    + +
    +
    + + +
    + {.}
    +
    +
    +
    + + + +

    Timeline

    +
    + +

    +
    +
    + +
    +
    + + + + + + + + + +

    +
    + +
    +
    +
    + + + +

    People

    +
    + +

    +
    +
    + +
    +
    + + +

    + +
    + + +

    +
      + +
    +
    + + + + + + + + + + +
  • + +
  • +
    + + + +

    +
    +

    + +

    +
    +
    + + + + false + + + + + + [Original] + + + + + + + + + + [] + + +
    by
    + + +
    + [Source: + + + + + + + ] +
    +
    +
    + + + +

    Resources

    +
    + +

    +
    +
    + +
    +
    + + +

    + +
    + + + +

    +
    +
      + +
    +
    + + +
  • +
    + + + +

    +
    +
    + +
    +
    + + + +

    +
    + +
    + + + +

    +
    +
      + +
    +
    + + + + + +
      + +
    +
    + + + + +
  • +
    + +
  • +
    + +
  • +
    +
    +
    + + +
  • +
    + + + + + + + + + + +
    + < ="" + + ></> + ></> + /> + +
    +
    + +
    diff --git a/versions/pc8080/1.21.7/machine.xsl b/versions/pc8080/1.21.7/machine.xsl new file mode 100644 index 000000000..6a4b8cfb0 --- /dev/null +++ b/versions/pc8080/1.21.7/machine.xsl @@ -0,0 +1,49 @@ + + + + +]> + + + + + + + + + + + <xsl:value-of select="$SITEHOST"/> + + + + +
    + +
    +

    +
    + + + + js + , + +
    +
    + +
    + + + + -dbg + + + + + + +
    + +
    diff --git a/versions/pc8080/1.21.7/manifest.xsl b/versions/pc8080/1.21.7/manifest.xsl new file mode 100644 index 000000000..7156049d8 --- /dev/null +++ b/versions/pc8080/1.21.7/manifest.xsl @@ -0,0 +1,247 @@ + + + + +]> + + + + + + + + + + + <xsl:value-of select="$SITEHOST"/> + + + + +
    + +
    +

    Document Manifest

    +
    +
      + + + + None + + + + + + + + + + + + + + + + +
    +
    +
    +

    + +
    +
    +
    + + +
    + + + + + + + + + + + <xsl:value-of select="$SITEHOST"/> + + + + +
    + +
    +

    Software Manifest

    +
    +
      + + + + None + + + + + Unknown + + + + + None + + + + + None + + + + + + + + + + + + + UpdatedReleased + + Unknown + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + + + +

    No default machine specified for '' in manifest.xml

    +
    + +
    +
    +
    + + + + -dbg + + + + + + +
    + + + + + Unknown + +
  • +
      + + + + + + + + +
    • + + + + + + + + + + + + + + + + + + + + + + + + + +
        + +
      • + + + + + + +
      • +
        +
      +
      +
    • +
      + + + + + + + + +
    +
  • +
    +
    + +
    diff --git a/versions/pc8080/1.21.7/outline.xsl b/versions/pc8080/1.21.7/outline.xsl new file mode 100644 index 000000000..1dc120db7 --- /dev/null +++ b/versions/pc8080/1.21.7/outline.xsl @@ -0,0 +1,47 @@ + + + + +]> + + + + + + + + + + + + + + + + + + <xsl:value-of select="title"/><xsl:text> | </xsl:text><xsl:value-of select="$SITEHOST"/> + + + + + +
    +
    + +
    +
    + + + + -dbg + + + + + + +
    + +
    diff --git a/versions/pc8080/1.21.7/pc8080-dbg.js b/versions/pc8080/1.21.7/pc8080-dbg.js new file mode 100644 index 000000000..1cf4e251b --- /dev/null +++ b/versions/pc8080/1.21.7/pc8080-dbg.js @@ -0,0 +1,165 @@ +(function(){var g;function da(a,b){var c;if(a){b||(b=16);if("$"==a.charAt(0))b=16,a=a.substr(1);else if("0x"==a.substr(0,2))b=16,a=a.substr(2);else{var d=a.charAt(a.length-1).toLowerCase();"h"==d?(b=16,d=null):"."==d&&(b=10,d=null);null==d&&(a=a.substr(0,a.length-1))}var e,d=a,f=b;(f&&10!=f?16==f?null!==d.match(/^[0-9a-f]+$/i):2==f&&null!==d.match(/^[01]+$/i):null!==d.match(/^[0-9]+$/))&&!isNaN(e=parseInt(a,b))&&(c=e|0)}return c} +function n(a,b){var c="";void 0===b?b=8:8=d?48:55),c=String.fromCharCode(d)+c;a>>=4}return c}function q(a){return"0x"+n(a,4)}function ea(a,b){var c=a,d=a.lastIndexOf("/");0<=d&&(c=a.substr(d+1));d=c.indexOf("&");0":">",'"':""","'":"'"};function ma(a){return a.replace(/[&<>"']/g,function(a){return la[a]})}function ra(a,b){return(a+" ").slice(0,b)}function sa(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")} +function ta(a,b,c){var d=0,e=a.length,f=0;for(void 0===c&&(c=function(a,b){return a>b?1:a>1,h;h=c(b,a[k]);0a?"0":"")+a}var b=new Date;return b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())} +function wa(a,b){var c;if(Array.prototype.indexOf)return a.indexOf(b,c);c=c||0;0>c&&(c+=a.length);0>c&&(c=0);for(var d=a.length;c=this.J?12:24>=this.J?14:15;this.X=1<>2;this.s=this.X-1;this.I=this.L/this.X|0;this.K=this.I-1;this.A=[];this.D=[];this.F=this.G=!1;this.P=[];this.T=[];a=new H;zb(a,this.C);this.B=Array(this.I);for(b=0;b>>a.O;0a.X?a.X:c;if(f&&f.size){if(f.type==d){if(b+c<=f.w)return f.eb+=f.w-b,f.w=b,!0;if(b>=f.w+f.eb){h=f.size-(b-k);h>c&&(h=c);f.eb=b-f.w+h;c-=h;b=k+a.X;continue}}return Bb(1,b,c)}f=a.B[e];b=new H(b,h,a.X,d);zb(b,a.C,f);a.B[e++]=b;b=k+a.X;c-=h}return 0>=c?!0:Bb(2,b,c)}function Cb(a,b){return a.B[(b&a.u)>>>a.O].bb(b&a.s,b)} +function Db(a,b){if(void 0===b)return a.F=!a.F,a.F;void 0===a.A[b]&&(a.A[b]=[null,!1]);a.A[b][1]=!a.A[b][1];return a.A[b][1]}function Eb(a,b){if(void 0===b)return a.G=!a.G,a.G;void 0===a.D[b]&&(a.D[b]=[null,!1]);a.D[b][1]=!a.D[b][1];return a.D[b][1]}function Bb(a,b,c){v("Memory block error ("+a+": "+n(b)+","+n(c)+")");return!1}var Rb;if(tb){var Sb=new ArrayBuffer(2);(new DataView(Sb)).setUint16(0,256,!0);Rb=256===(new Uint16Array(Sb))[0]}else Rb=!1;var Tb=Rb; +function H(a,b,c,d){this.id=Ub+=2;this.b=null;this.w=a;this.eb=b;this.size=c||0;this.type=d||Vb;this.F=d==Wb;zb(this);this.ma=this.Rb=!1;if(c)if(tb)this.A=new ArrayBuffer(c),this.D=new DataView(this.A,0,c),this.H=new Uint8Array(this.A,0,c),this.I=new Uint16Array(this.A,0,c>>1),this.b=new Int32Array(this.A,0,c>>2),Xb(this,Tb?Yb:Zb);else{this.b=Array(c>>2);for(a=0;a>2),b=0;b>8,c)},P:function(a){return this.b[a>>2]>>>((a&3)<<3)&255},ea:function(a){var b=a>>2;a=(a&3)<<3;var c=this.b[b]>>a;return 24>a?c&65535:c&255|(this.b[b+1]&255)<<8},Fa:function(a,b){var c=a>>2,d=(a&3)<<3;this.b[c]=this.b[c]&~(255<>2,d=(a&3)<<3;24>d?this.b[c]=this.b[c]&~(65535<>8);this.ma=!0},L:function(a,b){if(this.C&&null!=this.w){var c=this.C;ec(c,this.w+a,1,c.M)&&c.S(!0)}return this.bb(a,b)},Y:function(a,b){if(this.C&&null!=this.w){var c=this.C;ec(c,this.w+a,2,c.M)&&c.S(!0)}return this.Ib(a,b)},qa:function(a,b,c){if(this.C&&null!=this.w){var d=this.C;ec(d,this.w+a,1,d.F)&&d.S(!0)}this.F?this.u(a,b,c):this.Sa(a,b,c)},Ua:function(a,b,c){if(this.C&& +null!=this.w){var d=this.C;ec(d,this.w+a,2,d.F)&&d.S(!0)}this.F?this.u(a,b,c):this.Lb(a,b,c)},K:function(a){return this.H[a]},M:function(a){return this.H[a]},T:function(a){return this.D.getUint16(a,!0)},da:function(a){return a&1?this.H[a]|this.H[a+1]<<8:this.I[a>>1]},ga:function(a,b){this.H[a]=b;this.ma=!0},ra:function(a,b){this.H[a]=b;this.ma=!0},Ta:function(a,b){this.D.setUint16(a,b,!0);this.ma=!0},gb:function(a,b){a&1?(this.H[a]=b,this.H[a+1]=b>>8):this.I[a>>1]=b;this.ma=!0}}; +function zb(a,b,c){a.C=b;a.B=a.s=0;c&&((a.B=c.B)&&dc(a,cc,!1),(a.s=c.s)&&bc(a,cc,!1))}function fc(a,b){b?0===--a.s&&(a.G=a.F?a.u:a.Sa):0===--a.B&&(a.lb=a.bb)}function bc(a,b,c){c&&a.s||(a.G=!a.F&&b[2]||a.u);if(c||void 0===c)a.Sa=b[2]||a.u,a.Lb=b[3]||a.Va}function dc(a,b,c){c&&a.B||(a.lb=b[0]||a.J);if(c||void 0===c)a.bb=b[0]||a.J,a.Ib=b[1]||a.aa}function Xb(a,b){b||(b=gc);dc(a,b,void 0);bc(a,b,void 0)} +var gc=[],$b=[H.prototype.P,H.prototype.ea,H.prototype.Fa,H.prototype.hb],cc=[H.prototype.L,H.prototype.Y,H.prototype.qa,H.prototype.Ua];if(tb)var Zb=[H.prototype.K,H.prototype.T,H.prototype.ga,H.prototype.Ta],Yb=[H.prototype.M,H.prototype.da,H.prototype.ra,H.prototype.gb]; +function hc(a,b){x.call(this,"CPU",a,hc,1);var c=a.cycles||b,d=a.multiplier||1;this.i={};this.i.Qa=c;this.i.ya=d;this.i.pb=Math.round(this.i.Qa/1E4)/100;this.i.wa=this.i.pb*this.i.ya;this.j.V=!1;this.j.ob=!1;this.j.Ab=a.autoStart;this.j.Bb=!1;this.j.Ha=!1;this.i.Wa=this.i.Na=0;this.i.Xa=a.csStart;this.i.Ma=a.csInterval;this.i.Oa=a.csStop;this.aa=this.Ea.bind(this);G(this)}z(hc);var ic=["power","reset"];g=hc.prototype; +g.Ka=function(a,b,c,d){this.s=a;this.B=b;this.C=d;for(b=0;b=a.i.Na&&(a.i.Na+=a.i.Ma,c=!0);0<=a.i.Oa&&a.i.Oa<=pc(a)&&(a.i.Ma=a.i.Oa=-1,lc(a),a.S(),c=!0);c&&a.g(pc(a)+" cycles: checksum="+n(a.i.Wa))}} +g.ba=function(a,b,c){var d=this;a=!1;switch(b){case "power":case "reset":this.H[b]=c;a=!0;break;case "run":this.H[b]=c;c.onclick=function(){var a;if(a=d.s)if(a=d.s,a.j.U)a=!0;else{var b=null,c,h=C(a.id);for(c=0;cc&&(c=60);2>c&&(c=2);var d=1;b&&1a.i.va/a.i.wa?b=1:d=!0;a.i.ya=b;b=a.i.pb*a.i.ya;if(a.i.wa!=b){a.i.wa=b;b=a.i.wa.toFixed(2)+"Mhz";var e=a.H.setSpeed;e&&(e.textContent=b);a.g("target speed: "+b)}c&&a.s&&a.s.cb()}rc(a,a.I);a.I=0;a.i.La=ua();a.i.xa=0;sc(a);return d} +g.Ea=function(a){if(pb(this,!0)){if(!this.j.V){qc(this);this.s&&this.s.start(this.i.La,pc(this));this.j.V=!0;this.j.ob=!0;this.D&&this.D.Wb();var b=this.H.run;b&&(b.textContent="Halt");this.s&&(this.s.ca(!0),a&&this.s.cb(!0))}this.i.rb>=this.i.Qa&&sc(this,!0);this.i.$a=0;this.i.kb=ua();this.i.xa&&(a=this.i.kb-this.i.xa,a>this.i.Eb&&(this.i.La+=a,this.i.La>this.i.kb&&(this.i.La=this.i.kb)));try{do{var c=this.j.Ha?1:this.i.Vb;this.D&&(this.D.Kb(),c=this.D.Yb(0,c),c=this.D.Xb(c));try{this.Ra(c)}catch(e){if("number"!= +typeof e)throw e;}var d=this.G-this.u;this.I+=d;this.i.$a+=d;rc(this,0,!0);oc(this,d);this.i.Za-=d;0>=this.i.Za&&(this.i.Za+=this.i.Gb);this.i.Ya-=d;0>=this.i.Ya&&(this.i.Ya+=this.i.Fb,this.s&&this.s.ca());this.i.Pa-=d;if(0>=this.i.Pa){this.i.Pa+=this.i.qb;break}}while(this.j.V)}catch(e){this.S();I(this);this.s&&this.s.stop(ua(),pc(this));pb(this,!1);sb(this,e.stack||e.message);return}c=setTimeout;d=this.aa;this.i.xa=ua();a=this.i.Eb;this.i.$a&&(a=Math.round(a*this.i.$a/this.i.qb));a-=this.i.xa-this.i.kb; +if(b=this.i.xa-this.i.La)this.i.va=Math.round(this.I/(10*b))/100,864E5<=b&&(this.J=0,this.D&&this.D.Kb(!0),qc(this));if(0>a||this.i.va>1?128:0}function Yc(a){Xc(a)||(a.R^=a.A>>1|a.A>>2,a.F^=32896)}function Wc(a){return a.Ca&-2262|(a.b&a.A?1:0)|(ub[a.R&255]?4:0)|((a.R^a.F)&16?16:0)|(a.b&a.A-1?0:64)|Xc(a)}function Vc(a,b){a.A=256;a.b=a.R=a.F=0;b&1&&(a.b|=a.A);b&4||(a.R|=1);b&16&&(a.F|=16);b&64||(a.b|=a.A-1);b&128&&Yc(a);a.Ca=a.Ca&-513|b&512|2} +g.ba=function(a,b,c){var d=!1;switch(b){case "A":case "B":case "C":case "D":case "E":case "H":case "L":case "SP":case "PC":case "F":case "C":case "P":case "A":case "Z":case "S":case "V":this.H[b]=c;this.T++;d=!0;break;default:d=this.parent.ba.call(this,a,b,c)}return d};function Zc(a){var b;b=a.N+1|0;var c;c=a.N;c=a.sa[(c&a.P)>>>a.O].lb(c&a.M,c);a.N=b;return c} +function N(a,b,c,d){d=d||2;a.H[b]&&(void 0===c&&(sb(a,"Value for "+b+" is invalid"),a.S()),c=!a.j.V||a.j.Bb?n(c,d):"--------".substr(0,d),a.H[b].textContent!=c&&(a.H[b].textContent=c))} +g.ca=function(a){this.T&&(a||!this.j.V||this.j.Bb)&&(N(this,"A",this.za),N(this,"B",this.ka),N(this,"C",this.na),N(this,"D",this.oa),N(this,"E",this.Aa),N(this,"H",this.pa),N(this,"L",this.Ba),N(this,"SP",this.Da,4),N(this,"PC",this.N,4),a=Wc(this),N(this,"F",a,2),N(this,"S",a&128,1),N(this,"Z",a&64,1),N(this,"A",a&16,1),N(this,"P",a&4,1),N(this,"C",a&1,1));if(a=this.H.speed)a.textContent=this.j.V&&this.i.va?this.i.va.toFixed(2)+"Mhz":"Stopped"}; +g.Ra=function(a){this.j.ib=!0;var b=this.j.Qb=this.C&&$c(this.C),c=a?this.j.ob?0:1:-1;this.j.ob=!1;this.G=this.u=a;this.D&&!a&&this.D.Kb();a||(this.K|=4);do{if(this.L&&this.L&4){this.K=this.u=0;break}if(b){if(ad(this.C,this.N,c)){this.S();break}c=1}this.K=0;this.Y[Zc(this)].call(this)}while(0>>0,k],r=ta(p,l,a.tb);0>r&&p.splice(-(r+1),0,l)}m&&(h.a=m.replace(/''/g,'"'))}a.G.push({Zb:b,w:c,Ub:d,ha:e,ub:f})}delete this.ha}return!0};bd.prototype.ia=function(){return!0}; +function cd(a,b,c,d){if(d)a.Z("Unable to load system ROM (error "+d+": "+b+")");else{kb(a.wb,b,c);if("["==c.charAt(0)||"{"==c.charAt(0))try{var e=eval("("+c+")"),f=e.bytes,k=e.data;if(f)a.s=f;else if(k)for(a.s=Array(4*k.length),d=c=0;c>8&255,a.s[d++]=k[c]>>16&255,a.s[d++]=k[c]>>24&255;else a.s=e;a.ha=e.symbols;if(!a.s.length){v("Empty ROM: "+b);return}if(1==a.s.length){v(a.s[0]);return}}catch(h){a.Z("ROM data error: "+h.message);return}else for(b=c.replace(/\n/gm, +" ").replace(/ +$/,"").split(" "),a.s=Array(b.length),e=0;e>>d.O].Sa(e&d.s,a.s[c]&255,e)}b=!0}else b=!1;if(b){b=[];"number"==typeof a.A?b.push(a.A):null!=a.A&&a.A.length&&(b=a.A);for(c=0;c>>e.O;0>>=e.O;0Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=ya().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height= +(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Va.aspect);f&&.3<=f&&3.33>=f&&(Pa("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");Ja("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);e.getContext("2d");d=new gd(d);mb(d,c)}}); +function hd(a){x.call(this,"Debugger",a,hd);this.T=this.Fa=this.J=0;this.L=P();this.vb=P();this.D=-1;this.A=[];this.da=!1;this.Y=P();this.G=[];this.aa={};this.u=this.M=this.F=[];id(this);this.qa=0;jd(this);this.Ta=[];kd(this,a.messages);this.Va=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return mc(b,a)}):void 0===global.$&&(global.$=function(a){return mc(b,a)})}z(hd); +var ld={"?":"help/print","a [#]":"assemble","b [#]":"breakpoint",c:"clear output","d [#]":"dump memory","e [#]":"edit memory",f:"frequencies","g [#]":"go [to #]",h:"halt","i [#]":"input port #","if":"eval expression",k:"stack trace",ln:"list nearest symbol(s)",m:"messages","o [#]":"output port #",p:"step over",print:"print expression",r:"dump/set registers",reset:"reset machine","t [#]":"trace","u [#]":"unassemble",x:"execution options",v:"print version","var":"assign variable"},md="NONE ACI ADC ADD ADI ANA ANI CALL CC CM CNC CNZ CP CPE CPO CZ CMA CMC CMP CPI DAA DAD DCR DCX DI EI HLT IN INR INX JMP JC JM JNC JNZ JP JPE JPO JZ LDA LDAX LHLD LXI MOV MVI NOP ORA ORI OUT PCHL POP PUSH RAL RAR RET RC RM RNC RNZ RP RPE RPO RZ RLC RRC RST SBB SBI SHLD SPHL STA STAX STC SUB SUI XCHG XRA XRI XTHL".split(" "), +nd="B C D E H L M A F BC DE HL PSW SP PC".split(" "),od=[[45],[42,2323,32],[71,2387],[29,2323],[28,17],[22,17],[44,17,32],[63],[45,32768],[21,6419],[40,2387],[23,2323],[28,273],[22,273],[44,273,32],[64],[45,32768],[42,2579,32],[71,2643],[29,2579],[28,529],[22,529],[44,529,32],[52],[45,32768],[21,6675],[40,2643],[23,2579],[28,785],[22,785],[44,785,32],[53],[45,32768],[42,2835,32],[68,99],[29,2835],[28,1041],[22,1041],[44,1041,32],[20],[45,32768],[21,6931],[41,99],[23,2835],[28,1297],[22,1297],[44, +1297,32],[16],[45,32768],[42,3347,32],[70,97],[29,3347],[28,1553],[22,1553],[44,1553,32],[72],[45,32768],[21,7443],[39,97],[23,3347],[28,1809],[22,1809],[44,1809,32],[17],[43,17,17],[43,17,273],[43,17,529],[43,17,785],[43,17,1041],[43,17,1297],[43,17,1553],[43,17,1809],[43,273,17],[43,273,273],[43,273,529],[43,273,785],[43,273,1041],[43,273,1297],[43,273,1553],[43,273,1809],[43,529,17],[43,529,273],[43,529,529],[43,529,785],[43,529,1041],[43,529,1297],[43,529,1553],[43,529,1809],[43,785,17],[43,785, +273],[43,785,529],[43,785,785],[43,785,1041],[43,785,1297],[43,785,1553],[43,785,1809],[43,1041,17],[43,1041,273],[43,1041,529],[43,1041,785],[43,1041,1041],[43,1041,1297],[43,1041,1553],[43,1041,1809],[43,1297,17],[43,1297,273],[43,1297,529],[43,1297,785],[43,1297,1041],[43,1297,1297],[43,1297,1553],[43,1297,1809],[43,1553,17],[43,1553,273],[43,1553,529],[43,1553,785],[43,1553,1041],[43,1553,1297],[43,1553,1553],[43,1553,1809],[43,1809,17],[43,1809,273],[43,1809,529],[43,1809,785],[43,1809,1041], +[43,1809,1297],[43,1809,1553],[43,1809,1809],[3,17],[3,273],[3,529],[3,785],[3,1041],[3,1297],[3,1553],[3,1809],[2,17],[2,273],[2,529],[2,785],[2,1041],[2,1297],[2,1553],[2,1809],[73,17],[73,273],[73,529],[73,785],[73,1041],[73,1297],[73,1553],[73,1809],[66,17],[66,273],[66,529],[66,785],[66,1041],[66,1297],[66,1553],[66,1809],[5,17],[5,273],[5,529],[5,785],[5,1041],[5,1297],[5,1553],[5,1809],[76,17],[76,273],[76,529],[76,785],[76,1041],[76,1297],[76,1553],[76,1809],[46,17],[46,273],[46,529],[46, +785],[46,1041],[46,1297],[46,1553],[46,1809],[18,17],[18,273],[18,529],[18,785],[18,1041],[18,1297],[18,1553],[18,1809],[58],[50,2323],[34,35],[30,35],[11,35],[51,2323],[4,33],[65],[62],[54],[38,35],[30,32803],[15,35],[7,35],[1,33],[65],[57],[50,2579],[33,35],[48,33],[10,35],[51,2579],[74,33],[65],[55],[54,32768],[31,35],[27,33],[8,35],[7,32803],[67,33],[65],[61],[50,2835],[37,35],[78],[14,35],[51,2835],[6,33],[65],[60],[49],[36,35],[75],[13,35],[7,32803],[77,33],[65],[59],[50,3091],[35,35],[24], +[12,35],[51,3091],[47,33],[65],[56],[69],[32,35],[25],[9,35],[7,32803],[19,33],[65]],Q={cpu:1,bus:64,mem:128,port:256,timer:2048,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:536870912,warn:1073741824,halt:-2147483648};g=hd.prototype; +g.Ka=function(a,b,c,d){this.B=b;this.b=c;this.s=a;(a=jc(a,"messages"))&&kd(this,a);this.gb=od;pd(this,function(a){a:{var b=d.b.sa,c=a[0],h=a=0,l=b.length;if(c){a=T(U(d,c));if(-1===a){d.g("invalid address: "+c);break a}h=a>>>d.b.O;l=1}d.g("blockid physical blockaddr used size type");d.g("-------- --------- ---------- ------ ------ ----");for(var c=-1,m=0;l--;){var p=b[h];p.type==c?m++||d.g("..."):(c=p.type,m=ac[c],p&&d.g(n(p.id)+" %"+n(h<>>c.O,c=e!=c.s?c.B[f].Ib(e,d):c.B[f++].bb(e,d)|c.B[f&c.K].bb(0,d+1)<<8;b&&qd(a,b)}return c}; +g.sb=function(a,b,c){var d=T(a);if(-1!==d){var e=this.B;e.B[(d&e.u)>>>e.O].Sa(d&e.s,b&255,d);c&&qd(a,c);I(this.b,!0)}};g.Mb=function(a,b,c){var d=T(a);if(-1!==d){var e=this.B,f=d&e.s,k=(d&e.u)>>>e.O;f!=e.s?e.B[k].Lb(f,b&65535,d):(e.B[k++].Sa(f,b&255,d),e.B[k&e.K].Sa(0,b>>8&255,d+1));c&&qd(a,c);I(this.b,!0)}};function P(a){return{w:a||0,fa:!1}}function rd(a){return[a.w,a.fa]}function sd(a){return{w:a[0],fa:a[1]}} +function U(a,b,c){var d;c=(c?a.L:a.vb).w;if(void 0!==b){d=b=td(a,b);var e;if(d.match(/^[a-z_][a-z0-9_]*$/i))for(d=d.toUpperCase(),c=0;cc&&(c=wa(nd,a.substr(b,2))));return c}function zd(a,b){var c=0,d=Ad(a,b);if(void 0!==d)switch(b){case 7:case 0:case 1:case 2:case 3:case 4:case 5:case 8:c=2;break;case 9:case 10:case 11:case 12:case 13:case 14:c=4}return c?n(d,c):"??"} +function Ad(a,b){var c;if(0<=b){var d=a.b;switch(b){case 7:c=d.za;break;case 8:c=Wc(d)&255;break;case 0:c=d.ka;break;case 1:c=d.na;break;case 9:c=d.ka<<8|d.na;break;case 2:c=d.oa;break;case 3:c=d.Aa;break;case 10:c=d.oa<<8|d.Aa;break;case 4:c=d.pa;break;case 5:c=d.Ba;break;case 11:c=d.pa<<8|d.Ba;break;case 12:c=d.za<<8|Wc(d)&255;break;case 13:c=d.Da;break;case 14:c=d.N}}return c} +function Bd(a,b){b=td(a,b);for(var c=0,d,e;0<=(c=b.indexOf("@",c));)e=yd(b,c+1),0<=e&&(b=b.substr(0,c)+zd(a,e)+b.substr(c+1+nd[e].length)),c++;for(c=0;0<=(c=b.indexOf("#",c));)e=b.substr(c+1,2),d=da(e,16),null!=d&&32<=d&&128>d?(d=e+" '"+String.fromCharCode(d)+"'",b=b.replace("#"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("$",c));)e=b.substr(c+1,9),(d=U(a,e))?(d=e+' "'+xd(a,d)+'"',b=b.replace("$"+e,d),c+=d.length):c++;for(c=0;0<=(c=b.indexOf("^",c));)e=b.substr(c+1,9),(d=U(a,e))?(qd(d),d=e+' "'+ +xd(a,d,11)+'"',b=b.replace("^"+e,d),c+=d.length):c++;return b}g.message=function(a,b){b&&(a+=" at "+n(P(this.b.N).w,4));if(!this.ra||a!=this.ra)if(this.ra=a,this.W&-2147483648&&(this.S(),a+=" (cpu halted)"),this.g(a),this.b){var c=this.b;c.i.Pa=0;c.G-=c.u;c.u=0;I(c)}};function Cd(a,b,c,d){a.message(b.Ua+"."+(null!=d?"outPort":"inPort")+"("+q(c)+",unknown"+(null!=d?",0x"+n(d,2):"")+")")} +function jd(a){var b;if($c(a)){if(!a.K||!a.K.length){a.K=Array(1E3);for(b=0;b>>d.O],!1)}a.M=["br"];if(void 0!==a.F)for(b=1;b>>d.O],!0);a.F=["bw"];a.xb=0}g.ta=function(a,b,c){var d=!0;c||Jd(this,a,b,!1,!0);if(a!=this.u){var e=T(b);if(-1===e)this.g("invalid address: "+n(b.w,4)),d=!1;else{var f=this.b;f.sa[e>>>f.O].ta(e&f.M,a==this.F)}}d&&(a.push(b),c?b.fa=!0:(Kd(this,a,a.length-1,"set"),jd(this)));return d}; +function Jd(a,b,c,d,e){var f=!1;c=T(c);for(var k=1;k>>d.O],b==a.F));h.fa||jd(a);break}}return f}function Ld(a,b){for(var c=1;c>24,4);break;case 3:B=n(r.fb(K,2),4);break;default:B="imm("+q(t)+")"}r=B}else 16==K&&(r=nd[(t&3840)>>8]);if(!r||!r.length){f="INVALID";break}0=":6,">":6,"<=":6,"<":6,">>>":7,">>":7,"<<":7,"-":8,"+":8,"%":9,"/":9,"*":9}; +function Qd(a,b,c){for(c=c||-1;c--&&b.length;){var d=b.pop();if(2>a.length)return!1;var e=a.pop(),f=a.pop();switch(d){case "*":d=f*e;break;case "/":if(!e)return!1;d=f/e;break;case "%":if(!e)return!1;d=f%e;break;case "+":d=f+e;break;case "-":d=f-e;break;case "<<":d=f<>":d=f>>e;break;case ">>>":d=f>>>e;break;case "<":d=f":d=f>e?1:0;break;case ">=":d=f>=e?1:0;break;case "==":d=f==e?1:0;break;case "!=":d=f!=e?1:0;break;case "&":d=f&e;break; +case "^":d=f^e;break;case "|":d=f|e;break;case "&&":d=f&&e?1:0;break;case "||":d=f||e?1:0;break;default:return!1}a.push(d|0)}return!0} +function ud(a,b,c){var d;if(b){b=td(a,b);for(var e=0,f=!1,k=b,h=[],l=[],m=b.split(/(\|\||&&|\||^|&|!=|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/);e>=1;k=p+"b"+k;d>>=8}d="0x"+n(c)+" "+c+". ("+k+")"}a.g((null!=b?b+": ":"")+d);return e}function se(a,b){if(b)return re(a,b,a.aa[b]);var c=0;for(b in a.aa)re(a,b,a.aa[b]),c++;return 0b[0]?1:a[0]>>0;for(b=0;b>>0,h=f.Ub;if(e>=k&&e>1|d.A>>2,d.F^=32896));break;case "I":k?(d=a.b,d.Ca|=512):(d=a.b,d.Ca&=-513);break;default:a.g("unknown register: "+d);return}}if(!f){a.g("invalid value: "+e);return}I(a.b);a.g("updated registers:")}a.g(V(a,7)+V(a,8)+V(a,0)+V(a,1)+V(a,2)+V(a,3)+V(a,4)+V(a,5)+V(a,13)+Od(a,"I")+Od(a,"S")+Od(a,"Z")+Od(a,"A")+Od(a,"P")+Od(a,"C"));c&&(a.L=P(a.b.N),Fd(a,n(a.L.w,4)))}} +function ye(a,b){b=sa(b);var c=b.match(/^(['"])(.*?)\1$/);c?a.g(Bd(a,c[2])):ud(a,b,!0)}function ze(a,b,c){var d="t"!=b;c=Rd(a,c,null,!0)||1;var e=1==c?0:1;"tc"==b&&(e=c,c=1);Ka(c,function(){return pb(a,!0)&&a.Ra(e,d,!1)},function(){I(a.b);pb(a,!1)})} +function Fd(a,b,c,d){if(b=U(a,b,!0)){void 0===d&&(d=1);var e=256;if(void 0!==c){d=U(a,c,!0);if(!d||d.wh[0].indexOf("+"))){var m=h[0]+":";h[2]&&(m+=" "+h[2]);a.g(m)}h[3]&&(k=h[3],f=null);f=Nd(a,b,k,f);a.g(f);a.L=b;e-=b.w-l;c++}}} +function wd(a,b,c,d){if(c)if(b){0>a.D&&a.A.length&&(a.D=0);if(0>a.D||b!=a.A[a.D])a.A.splice(0,0,b),a.D=0;a.D--}else b=a.A[a.D+1];a=[];if(b){b=b.toLowerCase().replace(/""/g,"'");c=0;var e=null;d=d||";";for(var f=0;f<=b.length;f++){var k=b.charAt(f);if('"'==k||"'"==k)e?k==e&&(e=null):e=k;else if(k==d&&!e||!k)a.push(sa(b.substring(c,f))),c=f+1}}return a} +function Md(a,b,c){var d=!0;try{b.length&&"end"!=b?c||a.g(">> "+b):(a.da&&(a.g("ended assemble at "+n(a.Y.w,4)),a.L=a.Y,a.da=!1),b="");var e=b.charAt(0);if('"'==e||"'"==e)return!0;a.ra=null;if(rb(a)&&0m||"z"aa.length&&(a.g("note: only "+aa.length+" available"),L=aa.length);D-=L;0>D&&(null==aa[aa.length-1].w?(L=D+L,D=0):D+=aa.length);var vc=[];"call"==Xd&& +(Ga=1E5,vc=["CALL"]);for(void 0!==Wd&&a.g(L+" instructions earlier:");0=aa.length&&(D=0);a.yb=L;Zd++;Ga--}}Zd||(a.g("no "+Yd+"history available"),a.yb=void 0)}else{var Fb=U(a,Y);if(Fb){var Gb=0;na&&("l"==na.charAt(0)&&(na=na.substr(1)||Ve),Gb=Rd(a,na)>>>0,65536>4||1,wc="dd"== +Da?4:"dw"==Da?2:1,be=0;bezc;zc++){var Ib=a.la(Fb,1),Hb=Hb|Ib<<(xc++<<3);xc==wc&&($a+=n(Hb,2*wc),$a+=1==wc?7==zc?"-":" ":" ",Hb=xc=0);yc+=32<=Ib&&128>Ib?String.fromCharCode(Ib):"."}oa&&(oa+="\n");oa+=Y+" "+$a+" "+yc}oa&&a.g(oa);a.vb=Fb}}}}break;case "e":if("else"==f[0])break;var Jb=1,ce=255,de=a.la,ee=a.sb;"ew"==f[0]&&(Jb=2,ce=65535,de=a.fb,ee=a.Mb);var fe=Jb<<1,ge=f[1];if(null==ge)a.g("edit memory commands:"),a.g("\teb [a] [...] edit bytes at address a"), +a.g("\tew [a] [...] edit words at address a");else{var Kb=U(a,ge);if(Kb)for(var Lb=2;LbJc;){for(var pa=null,af=256;65536>db.w>>>0;){ie.w=a.fb(db,2);if(null==db.w||!af--)break; +for(var bf=a,Nb=ie,je=null,eb=Nb.w,ke=eb,Kc=1;6>=Kc&&eb;Kc++){if(2>>=Pc)&ff;if(void 0!==Pb){if(Pb[0])Pb[0](ja,Qb,void 0);S.C&&S.G!=Pb[1]&&Id(S.C,ja,Qb)}else S.C&& +(Cd(S.C,S,ja,Qb),S.G&&Id(S.C,ja,Qb));Pc+=fb<<3;ja+=fb;Oc-=fb}a.g(q(Mc)+": "+("0x"+n(Nc,2)))}}else a.g("output commands:"),a.g("\to [p] [b]\twrite byte [b] to port [p]"),a.g("warning: port accesses can affect hardware state");break;case "p":if("print"==f[0]){ye(a,b.substr(5));break}var pe="pr"==f[0]?1:0,gf=1+pe;if(a.P)a.g("step in progress");else{var Qc=P(a.b.N);switch(a.la(Qc)){case 205:a.P=gf,qd(Qc,3)}a.P?(a.ta(a.u,Qc,!0),a.Ea()||(a.s&&a.s.cb(),a.P=0)):ze(a,pe?"tr":"t")}break;case "r":if("reset"== +b){a.s&&a.s.reset();break}Ed(a,f);break;case "t":ze(a,f[0],f[1]);break;case "u":Fd(a,f[1],f[2],8);break;case "v":if("var"==f[0]){we(a,b.substr(3))||(d=!1);break}a.g("PC8080 version 1.21.7 ("+a.b.Db+",RELEASE"+(tb?",TYPEDARRAYS":",LONGARRAYS")+")");a.g(ya());break;case "x":a:if(f[1]&&"?"!=f[1])switch(f[1]){case "cs":var gb;void 0!==f[3]&&(gb=+f[3]);switch(f[2]){case "int":a.b.i.Ma=gb;break;case "start":a.b.i.Xa=gb;break;case "stop":a.b.i.Oa=gb;break;default:a.g("unknown cs option");break a}void 0!== +gb&&lc(a.b);a.g("checksums "+(a.b.j.Ha?"enabled":"disabled"));break;case "sp":void 0!==f[2]&&(qc(a.b,+f[2])||a.g("warning: using 1x multiplier, previous target not reached"));a.g("target speed: "+(a.b.i.wa.toFixed(2)+"Mhz")+" ("+a.b.i.ya+"x)");break;default:a.g("unknown option: "+f[1])}else a.g("execution options:"),a.g("\tcs int #\tset checksum cycle interval to #"),a.g("\tcs start #\tset checksum cycle start count to #"),a.g("\tcs stop #\tset checksum cycle stop count to #"),a.g("\tsp #\t\tset speed multiplier to #"); +break;case "?":if(f[1]){ye(a,b.substr(1));break}var hb="commands:",Rc;for(Rc in ld)hb+="\n"+ra(Rc,7)+ld[Rc];$c(a)||(hb+="\nnote: frequency/history disabled if no exec breakpoints");a.g(hb);break;default:a.g("unknown command: "+b),d=!1}}}catch(qe){a.g("debugger error: "+(qe.stack||qe.message)),d=!1}return d}function mc(a,b,c){b=wd(a,b,c);for(var d in b)if(!Md(a,b[d]))return!1;return!0}Qa(function(){for(var a=F(document,"pc8080","debugger"),b=0;bJe){if(Fe(d,this.K)){this.F=new J(this,W,"failsafe");Fe(this.F)&&(Oe(this,d),a=2,Ce(this.F));M(this.F,"timestamp",va());De(this.F);var e=this.s&&!this.G;if(1==a||za("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=Ee(d)){var f=Ge(d,"code"),k=Ge(d,"data");f&&("ok"==f?Fe(d,k):("error"==f&&"no machine state"!= +k?(this.Z("Error: "+k),"unable to verify user"==k&&(Ia("user",""),this.u=null)):this.g(f+": "+k),Ce(d),Fe(d)?(c=Ee(d),e=!0):c=!1))}e&&Ne(this,c?d:null)}else 2==a&&d.clear()}else Ne(this);delete this.K;delete this.L}e=C(this.id);for(f=0;fa[1];a=a[2];this.j.U=!0;var d=this.H.power;d&&(d.textContent="Shutdown");this.T||(this.g("PC8080 v"+W+"\nCopyright \u00a9 2012-2016 Jeff Parsons \nLicense: GPL version 3 or later "),this.T=!0);this.b&&(Pe(this,this.b,b,c,a),nc(this.b));this.Y&&(Oe(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.A=0}; +function Oe(a,b){if(za("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.ea,d=a.u||"",e=b.toString(),f={app:"PC8080"};f.ver=W;f.url=c;f.user=d;f.type="bug";f.data=e;u("http://www.pcjs.org/api/v1/report",f,!0)}} +function Ae(a,b,c){var d,e="none";if(a.A)return null;a.A--;var f=new J(a,W),k=new J(a,W,"validate"),h=va();M(k,"timestamp",h);M(f,"timestamp",h);M(f,"version","1.21.7");M(f,"url",window?window.location.href:null);M(f,"browser",ya());a.b&&a.b.ia&&(c&&a.b.S(),d=a.b.ia(b,c),"object"===typeof d&&M(f,a.b.id,d),c&&(a.b.j.U=!1,!1===d&&(e=null)));for(var h=C(a.id),l=0;lh.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(h=window.location.pathname+h);d?"}"==d.slice(-1)?(d=d.slice(0,-1),1]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(h?' url="'+h+'"':""))}e||(a=a.replace(/().*?(<\/xsl:variable>)/,"$1pc8080$2")); +h=null;if("<"==a.charAt(0))try{e||(a=a.replace(/\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(h=new window.ActiveXObject("Microsoft.XMLDOM"),h.async=!1,h.loadXML(a)):h=(new window.DOMParser).parseFromString(a,"text/xml")}catch(r){h=null,a=r.message}else a="unrecognized XML: "+(255/g.exec(a)){var e=d[2];b("Loading "+e+"...");u(e,null,!0,function(f,k,h){if(h||!k)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=k.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=h[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);h[0]!=l&&(k=k.replace(h[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}k=k.replace(/<\?xml[^>]*>[\r\n]*/, +"");a=a.replace(d[0],k);jf(a,b,c)}})}else c(a,null)} +function kf(a,b,c,d){function e(a){if(void 0===h){var b=k&&F(k,"machine-warning");h=b&&b[0]||k}h&&(h.innerHTML=ma(a))}function f(a){e("Error: "+a);l&&(--Se||Sa(!0));l=!1}var k,h,l=!0;Se++;jb[a]={};try{if(k=document.getElementById(a)){var m;if("object"==typeof resources&&(m=resources.css)){var p=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";r.styleSheet?r.styleSheet.cssText=m:r.appendChild(document.createTextNode(m));p.appendChild(r)}c|| +(c="/versions/pc8080/1.21.7/components.xsl");m=function(d,h){h?Te(c,null,null,!1,e,function(d,m){if(m)if(kb(a,c,d),e("Processing "+b+"..."),window.ActiveXObject||"ActiveXObject"in window){var l=h.transformNode(m);l?(k.outerHTML=l,--Se||Sa(!0)):f("transformNodeToObject failed")}else document.implementation&&document.implementation.createDocument?(l=new XSLTProcessor,l.importStylesheet(m),(l=l.transformToFragment(h,document))?k.parentNode?(k.parentNode.replaceChild(l,k),--Se||Sa(!0)):f("invalid machine element: "+ +a):f("transformToFragment failed")):f("unable to transform XML: unsupported browser");else f(d)}):f(d)};"<"!=b.charAt(0)?Te(b,a,d,!0,e,m):hf(b,null,a,d,!1,e,m)}else f("missing machine element: "+a)}catch(t){f(t.message)}return l}window.embedPC8080=function(a,b,c,d){Sa(!1);return kf(a,b,c,d)};window.enableEvents=Sa;window.sendEvent=Ta; +function lf(a,b,c,d){if(!c&&b){d.push(b);a=jb[d[0]];b=null;for(var e in a)if(ka(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?u(b,null,!0,function(a,b){mf(b,d)}):mf(null,d)}else v("Error ("+c+") requesting "+a)} +function mf(a,b){var c,d,e,f=b[0],k=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=jb[f],l={},m;for(m in h){var p=h[m],r=fa(m);if("xml"==r){for(r=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=r.exec(h[m]);){var t=d[2];t&&(h[t]||(p=p.replace(d[0],"")))}d=m=ea(m)}else"xsl"==r&&(e=m=ea(m));l[m]=p}a&&(l[m="css"]=a);b[2]&&(l[m="parms"]=b[2]);b[3]&&(l[m="state"]=b[3]);d&&e?(m=JSON.stringify(l),k+=".js",c=c[1]+"var resources="+m+";"+c[2]+c[3],c=c.replace(/\u00A9/g, +"©"),m=k,h=null,l="data:application/javascript,",l=Ja("Firefox")?l+encodeURIComponent(c):l+encodeURI(c),m&&(h=document.createElement("a"),"string"!=typeof h.download&&(h=null)),h?(h.href=l,h.download=m,document.body.appendChild(h),h.click(),document.body.removeChild(h),c="Check your Downloads folder for "+m+"."):(window.open(l),c="Check your browser for a new window/tab containing the requested data"+(m?" ("+m+")":"")+"."),c+=', copy it to your web server as "'+k+'", and then add the following to your web page:\n\n', +c+='
    \n',c+="...\n",c+='