Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Merge branch 'next-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpar committed Feb 18, 2016
2 parents d3198ab + 99cbb8a commit 13270fd
Show file tree
Hide file tree
Showing 280 changed files with 17,006 additions and 2,593 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
.settings
node_modules
npm-debug.log
archive/
/books
/notes
/states
/videos
/web
private/
src/
static/
tmp/
_site
.sass-cache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Updating PCjs

To start developing features for a new version of PCjs, here are the recommended steps:

1. Change the version number in the root [package.json](/package.json)
1. Change the version number in the root [package.json](package.json) and [_config.yml](_config.yml)
2. Run the "grunt promote" task to bump the version in all the machine XML files
3. Make changes
4. Run "grunt" to build new versions of the apps (eg, "/versions/pcjs/1.x.x/pc.js")
Expand Down
5 changes: 3 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ right_brace: "}"

# Build settings

exclude: ["index.html", "**/index.html", "logs", "node_modules", "**/c64", "**/private", "src", "**/src", "**/static", "tmp", "videos", "web", ".git", ".idea"]
exclude: ["index.html", "**/index.html", "**/archive", "logs", "node_modules", "**/c64", "**/private", "src", "**/src", "tmp", "videos", "web", ".git", ".idea"]
markdown: kramdown
kramdown:
input: GFM
Expand All @@ -31,7 +31,7 @@ gems:

pcjs:
domain: pcjs.org # whereas site.url is used for linking purposes, site.pcjs.domain is used for display purposes
version: 1.20.8 # IMPORTANT: keep pcjs.version in sync with package.json:version
version: 1.20.9 # IMPORTANT: keep pcjs.version in sync with package.json:version
compiled: true # by default, the compiled pcjs.version scripts will be used (eg, pc.js or pc-dbg.js)
pc_scripts: # if pcjs.compiled is false, the following scripts will be included instead, in the order listed
- /modules/shared/lib/defines.js
Expand Down Expand Up @@ -79,6 +79,7 @@ pcjs:
- /modules/pcjs/lib/state.js
- /modules/pcjs/lib/computer.js
- /modules/shared/lib/embed.js
- /modules/shared/lib/save.js
c1p_scripts:
- /modules/shared/lib/defines.js
- /modules/shared/lib/dumpapi.js
Expand Down
88 changes: 88 additions & 0 deletions _developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,91 @@ developer: true

pcjs:
compiled: false
#
# Since pcjs.compiled is false, the following scripts will be included instead, in the order listed;
# and since nodebug.js is included immediately after defines.js, DEBUG code is disabled by default.
#
# Note that the Node web server is considerably smarter than the Jekyll templates we're using; Node
# will automatically skip (or include) nodebug.js depending on whether the server is in DEBUG mode,
# and will include nodebugger.js (and skip debugger.js) if DEBUGGER is disabled. The Node server
# also ensures that only one uncompiled copy of each of JavaScript file is included on a given page,
# regardless how many different machines are loaded on the page.
#
# But, you're a developer, otherwise you wouldn't be starting Jekyll like this:
#
# bundle exec jekyll serve --config _config.yml,_developer.yml
#
# so deal with it! ;-)
#
# NOTE: If you're debugging PCjs source code, you'll probably be happier using a JetBrains IDE like WebStorm,
# launching PCjs pages via Node rather than Jekyll, and using the JetBrains Chrome debugger plug-in.
#
pc_scripts:
- /modules/shared/lib/defines.js
- /modules/shared/lib/nodebug.js
- /modules/shared/lib/diskapi.js
- /modules/shared/lib/dumpapi.js
- /modules/shared/lib/reportapi.js
- /modules/shared/lib/userapi.js
- /modules/shared/lib/strlib.js
- /modules/shared/lib/usrlib.js
- /modules/shared/lib/weblib.js
- /modules/shared/lib/component.js
- /modules/pcjs/lib/defines.js
- /modules/pcjs/lib/x86.js
- /modules/pcjs/lib/interrupts.js
- /modules/pcjs/lib/messages.js
- /modules/pcjs/lib/panel.js
- /modules/pcjs/lib/bus.js
- /modules/pcjs/lib/memory.js
- /modules/pcjs/lib/cpu.js
- /modules/pcjs/lib/x86seg.js
- /modules/pcjs/lib/x86cpu.js
- /modules/pcjs/lib/x86fpu.js
- /modules/pcjs/lib/x86func.js
- /modules/pcjs/lib/x86ops.js
- /modules/pcjs/lib/x86op0f.js
- /modules/pcjs/lib/x86modb.js
- /modules/pcjs/lib/x86modw.js
- /modules/pcjs/lib/x86modb16.js
- /modules/pcjs/lib/x86modw16.js
- /modules/pcjs/lib/x86modb32.js
- /modules/pcjs/lib/x86modw32.js
- /modules/pcjs/lib/x86modsib.js
- /modules/pcjs/lib/chipset.js
- /modules/pcjs/lib/rom.js
- /modules/pcjs/lib/ram.js
- /modules/pcjs/lib/keyboard.js
- /modules/pcjs/lib/video.js
- /modules/pcjs/lib/parallelport.js
- /modules/pcjs/lib/serialport.js
- /modules/pcjs/lib/mouse.js
- /modules/pcjs/lib/disk.js
- /modules/pcjs/lib/fdc.js
- /modules/pcjs/lib/hdc.js
- /modules/pcjs/lib/debugger.js
- /modules/pcjs/lib/state.js
- /modules/pcjs/lib/computer.js
- /modules/shared/lib/embed.js
- /modules/shared/lib/save.js
c1p_scripts:
- /modules/shared/lib/defines.js
- /modules/shared/lib/nodebug.js
- /modules/shared/lib/dumpapi.js
- /modules/shared/lib/reportapi.js
- /modules/shared/lib/strlib.js
- /modules/shared/lib/usrlib.js
- /modules/shared/lib/weblib.js
- /modules/shared/lib/component.js
- /modules/c1pjs/lib/defines.js
- /modules/c1pjs/lib/panel.js
- /modules/c1pjs/lib/cpu.js
- /modules/c1pjs/lib/rom.js
- /modules/c1pjs/lib/ram.js
- /modules/c1pjs/lib/keyboard.js
- /modules/c1pjs/lib/video.js
- /modules/c1pjs/lib/serial.js
- /modules/c1pjs/lib/disk.js
- /modules/c1pjs/lib/debugger.js
- /modules/c1pjs/lib/computer.js
- /modules/shared/lib/embed.js
1 change: 1 addition & 0 deletions _includes/build.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="buildpc" id="{{ include.id }}"></div>
34 changes: 33 additions & 1 deletion _includes/machine-engines.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
{% comment %}
As documented in /modules/markout/lib/markout.js, our Node web server recognizes the following machine properties
in the Front Matter of Markdown files, for compatibility with the Jekyll web server:

'id' (eg, "ibm5150")
'name' (eg, "IBM PC (Model 5150) with Monochrome Display")
'type' (eg, "pc" or "pc-dbg")
'config' (eg, "machine.xml")
'template' (eg, "machine.xsl")
'uncompiled' (eg, true)
'parms'

And the following properties (along with any property not listed above) will be added to the 'parms' property:

'autopower' (eg, "true")
'automount' (eg, {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pc/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}})
'state' (eg, "state.json")
'messages' (eg, "disk")

And all our JavaScript components expect multi-word property names to use camelCase, so that conversion happens both
here and in markout.js. Examples include 'autopower' ('autoPower') and 'automount' ('autoMount').

{% endcomment %}
{% for machine in page.machines %}
{% capture machine_embed %}window.embed{{ machine.type | remove:'-dbg' | upcase }}{% endcapture %}
{% if machine.autopower == nil %}
{% assign machine_autopower = "true" %}
{% else %}
{% capture machine_autopower %}{{ machine.autopower }}{% endcapture %}
{% endif %}
{% unless machine.config %}
{% assign machine_config = "machine.xml" %}
{% else %}
Expand All @@ -10,7 +38,7 @@
{% else %}
{% assign machine_template = machine.template %}
{% endunless %}
{% capture machine_parms %}{{ site.left_brace }}state:"{{ machine.state }}",autoMount:{{ machine.automount|jsonify }},messages:"{{ machine.messages }}"{{ site.right_brace }}{% endcapture %}
{% capture machine_parms %}{{ site.left_brace }}autoPower:{{ machine_autopower }},state:"{{ machine.state }}",autoMount:{{ machine.automount|jsonify }},messages:"{{ machine.messages }}"{{ site.right_brace }}{% endcapture %}
{% if site.pcjs.compiled == true and machine.uncompiled != true %}
{% capture machine_script %}<script type="text/javascript" src="{{ site.baseurl }}/versions/{{ machine.type | remove:'-dbg' }}js/{{ site.pcjs.version }}/{{ machine.type }}.js"></script>{% endcapture %}
{% unless machine_scripts contains machine_script %}
Expand All @@ -35,4 +63,8 @@
{% endif %}
{% endif %}
<script type="text/javascript">{{ machine_embed }}('{{ machine.id }}','{{ machine_config }}','{{ machine_template }}','{{ machine_parms }}');</script>
{% if page.build %}
<script type="text/javascript" src="{{ site.baseurl }}/modules/build/lib/build.js"></script>
<script type="text/javascript">buildPC("{{ page.build }}");</script>
{% endif %}
{% endfor %}
11 changes: 10 additions & 1 deletion _includes/machine.html
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
<div class="machine" id="{{ include.id }}"></div>
<div class="machine" id="{{ include.id }}">
{% assign machine_name = "PCjs: The Virtual IBM PC" %}
{% for machine in page.machines %}
{% if include.id == machine.id and machine.name%}
{% assign machine_name = machine.name %}
{% break %}
{% endif %}
{% endfor %}
[{{ machine_name }}]
</div>
2 changes: 1 addition & 1 deletion _layouts/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
var totalPages = parseInt(aParms['total'], 10) || 999;
var frame = document.getElementById('framePDF');
if (pdf && frame) {
pdf = pdf.replace('/static/', '/');
pdf = pdf.replace('/archive/', '/');
var i = pdf.indexOf("/pages/");
if (i > 0) {
var sReturnLink = pdf.substr(0, i+1);
Expand Down
2 changes: 1 addition & 1 deletion _posts/2015-06-01-debugging-the-ibm-vga-rom.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ could only be used in PC, XT, and AT-compatible systems. I'll refer to it here
The VGA ROM used here is assumed to have come from an original IBM VGA. It's unknown if IBM ever made any
revisions to the VGA ROM. With the introduction of the PS/2 family and the VGA, IBM decided to no longer publish
the source code for its ROMs, so I've created some assemblable source code from the IBM VGA ROM
[here](/devices/pc/video/ibm/vga/ibm-vga.nasm).
[here](/devices/pc/video/ibm/vga/).

I've finally started debugging a machine configuration that uses the IBM VGA ROM. Since the VGA and the 80386 are
contemporaries, I'm using an [80386 machine configuration](/devices/pc/machine/compaq/deskpro386/vga/2048kb/machine.xml).
Expand Down
121 changes: 121 additions & 0 deletions _posts/2016-02-17-saving-disks-and-machines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
layout: post
title: "Saving Disks and Machines"
date: 2016-02-17 14:00:00
permalink: /blog/2016/02/17/
---

PCjs (v1.20.9) now offers some new, *much* easier ways to save disks and machines, thanks to the new
[Save Disk](/blog/2016/02/17/#saving-disks) and [Save Machine](/blog/2016/02/17/#saving-machines) features.
With one click, PCjs can now generate a single download containing everything you need to embed any of our
IBM PC demos on your own web page.

Saving Disks
---

Floppy disk images can now be saved to your desktop computer by simply clicking the **Save** button next
to the floppy disk controls. Select the drive first, and then whatever diskette is shown as being "loaded"
in that drive will be saved in your local machine's Downloads folder when you click **Save**.

If you made any changes to that disk after it was loaded, those changes will be included, so if you want a pristine
copy of the disk, click the **Load** button first. PCjs will ask you to confirm that you really want to reload the
disk and discard any changes.

Note that the disk *should* be downloaded as an **.img** file, which is nothing more than a sector-by-sector binary
dump of the disk. For example, a 360Kb double-sided double-density (DSDD) disk contains 9 512-byte sectors on each
of the 40 tracks on each of its 2 sides, so when you **Save** a 360Kb disk, the downloaded file should be exactly
368,640 bytes large.

The Mac OS X operating system can automatically mount most **.img** files (from disks created by DOS 2.0 or later).
Older 1.x DOS disks, along with most non-DOS disks, do not have a BIOS Parameter Block (BPB) in the boot sector, so
most modern operating systems won't recognize the disk format. Other operating systems, like Windows, may require
third-party software in order to mount an **.img** file, and some third-party software may prefer a different extension,
such as **.ima** or **.bin**.

It's also recommended that make your **.img** files *read-only*, so that if you do mount them on your desktop
computer, neither you nor the operating system will inadvertently modify the contents of the disk. On OS X, this is
easily done with the **chmod** utility.

For example, if you saved the disk named "PC-DOS 2.00 (Disk 1)", it should have been downloaded as "PCDOS200-DISK2.img"
in your Downloads folder, so the OS X Terminal command `chmod -w PCDOS200-DISK2.img` will make it read-only, and
`chmod +w PCDOS200-DISK2.img` will make it writable again.

Saving Machines
---

Saving the entire state of any existing IBM PC machine is also possible with a single click. You can choose to save
a machine in its initial state, or make changes to any of the machine's disks and then save it. All your changes should
be preserved.

Under the bottom-left corner of any IBM PC on the PCjs [website](/), you should now see a
[**Save Machine**] link. When you click that link, PCjs will generate a large "blob" of JavaScript containing
everything that machine needs to run, including:

* The machine XML configuration file (eg, "machine.xml")
* The machine XSL transformation file (eg, "components.xsl")
* The machine CSS stylesheet file (eg, "components.css")
* The machine state file (eg, "state.json")
* The PCjs machine emulation script (eg, "pc.js")
* Copies of all the disk images mounted by the machine

Let's say you want to save the IBM PC on the PCjs [home page](/). When you click **Save Machine**, two things should
happen:

* A file will be downloaded ("pc.json")
* A popup will appear with some markup to copy-and-paste

The popup should provide the following information:

Check your Downloads folder for "pc.json", copy it to your web server as "pc.js",
and then add the following to your web page:

<div id="ibm5150"></div>
...
<script type="text/javascript" src="pc.js"></script>
<script type="text/javascript">embedPC("ibm5150","machine.xml","components.xsl");</script>

The machine should appear where the <div> is located.

Rename the downloaded file from **pc.json** to **pc.js**, copy it to your own web server, then create or edit
a web page and insert the above text. If **pc.js** and your web page are in different folders, then you'll also
need to change *src* to indicate the location of **pc.js**.

Some notes:

* PCjs asks the browser to name the downloaded file **pc.json** instead of **pc.js** because a file with a ".js"
extension may cause the Chrome web browser to block the download. And not all browsers support named downloads;
PCjs will attempt to open a new window/tab if that seems to be the case.

* Your version of Chrome may also impose size limitations on the download. If nothing downloads, the machine may
be too large for your browser, so try a different browser (eg, Firefox or Safari).

* If you have modified any floppy disks mounted by the machine *or* any of the machine's hard disks, those
modifications should be saved along with the machine.

* Any floppy disks mounted during the lifetime of the machine will be added to the machine's state. So, for example,
if you want your copy of the machine to include all the Windows 1.01 SDK disks, make sure you have loaded each disk
once before clicking **Save Machine**.

* Any floppy disks *not* mounted during the lifetime of the machine will be *removed* from the machine's list of
available disks; we don't want machines running on other websites to be consuming our bandwidth.

* The machine's current state, including memory and screen contents, are included as part of the saved
machine state. So, even if the original machine always powers on from scratch, the *copied* machine will always
resume at the point it was saved. This behavior, however, can be disabled by passing a *parms* object as the
4th parameter to the *embedPC()* call, overriding the 'state' property:

<script type="text/javascript">embedPC("ibm5150","machine.xml","components.xsl","{state:null}");</script>

While the [PCjs Documentation](/docs/pcjs/) explains how to create a *new* machine, by writing your own machine
XML file and manually copying all the other pieces, the new **Save Machine** feature is the best way to save
any *existing* IBM PC and embed it on any other website.

**WARNING**: While this feature is still "hot of the press," there will probably be some kinks to work out. Every
browser seems to have its own idiosyncrasies in terms of what can be downloaded and/or how large it can be. It's
also quite possible that certain machine features or modifications may not be properly preserved.

If you're having trouble with a particular browser or a particular machine, be sure to
[let me know](mailto:[email protected]), and then try another browser and/or machine.

*[@jeffpar](http://twitter.com/jeffpar)*
*February 17, 2016*
2 changes: 1 addition & 1 deletion apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ have saved that JSON-encoded image as static file on the server, and then added
&lt;disk&gt; entry:

<manifest>
<disk id="disk01" dir="/apps/pc/1981/visicalc/static/" href="/apps/pc/1981/visicalc/disk.json">
<disk id="disk01" dir="/apps/pc/1981/visicalc/archive/" href="/apps/pc/1981/visicalc/disk.json">
...
</disk>
</manifest>
Expand Down
4 changes: 2 additions & 2 deletions apps/pc/1981/visicalc/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.20.8/manifest.xsl"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.20.9/manifest.xsl"?>
<manifest type="software">
<title>VisiCalc</title>
<!-- Since version numbers are incorporated into the disk image names, and this version number is a bit ugly, we're not exposing it with the normal "version" tag -->
Expand All @@ -12,7 +12,7 @@
<releaseDate>December 16, 1981</releaseDate>
<license href="http://www.bricklin.com/history/vclicense.htm">Lotus Development</license>
<machine href="/devices/pc/machine/5150/mda/64kb/machine.xml" state="/apps/pc/1981/visicalc/state.json"/>
<disk id="disk01" size="163840" chs="40:1:8" dir="static/" href="/apps/pc/1981/visicalc/disk.json" md5="61494f998d5fb0e31e7b8bd99f1cc588" md5json="3ad82ed815725e6bd786f92a4714e84f">
<disk id="disk01" size="163840" chs="40:1:8" dir="archive/" href="/apps/pc/1981/visicalc/disk.json" md5="61494f998d5fb0e31e7b8bd99f1cc588" md5json="3ad82ed815725e6bd786f92a4714e84f">
<file size="27520" time="1981-12-16 23:00:00" attr="0x20" md5="28997dfedb2440c6054d8be835be8634">VC.COM</file>
<file dir="../">README.md</file>
<link href="http://www.bricklin.com/history/vclicense.htm">VisiCalc License</link>
Expand Down
4 changes: 2 additions & 2 deletions apps/pc/1982/esuite/manifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.20.8/manifest.xsl"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.20.9/manifest.xsl"?>
<manifest type="software">
<title>Executive Suite</title>
<version/>
Expand All @@ -8,7 +8,7 @@
<author>Armonk Corporation</author>
<releaseDate>1982</releaseDate>
<machine href="/devices/pc/machine/5160/mda/256kb/fake188/machine.xml" state="/apps/pc/1982/esuite/state.json"/>
<disk id="disk01" size="368640" chs="40:2:9" dir="static/" href="/apps/pc/1982/esuite/disk.json" md5="7721a7bc9fcbd0005e7c1d87ecc055c5" md5json="dbf0a2c0176b8128d87e2465794764f4">
<disk id="disk01" size="368640" chs="40:2:9" dir="archive/" href="/apps/pc/1982/esuite/disk.json" md5="7721a7bc9fcbd0005e7c1d87ecc055c5" md5json="dbf0a2c0176b8128d87e2465794764f4">
<name>Executive Suite (1982)</name>
<file size="384" time="2000-02-29 08:04:48" attr="0x20" md5="3e638560a5f483cdbd1be486b07c767e">ESUITE.COM</file>
<file size="163840" time="2000-02-29 06:57:40" attr="0x20" md5="dcc72026cdc906109cf0e3b2d07ffd5d">GAME.DAT</file>
Expand Down
Loading

0 comments on commit 13270fd

Please sign in to comment.