Initial commit (a clone of the jsmachines project as of v1.15.3)

This commit is contained in:
jeffpar 2014-09-27 14:52:57 -07:00
commit a5e3e6a59d
714 changed files with 130602 additions and 0 deletions

36
.editorconfig Normal file
View file

@ -0,0 +1,36 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
end_of_line = lf
insert_final_newline = true
[*.js]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.json]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
[lib/**.js]
indent_style = space
indent_size = 4
[*.md]
indent_style = tab
indent_size = 4
trim_trailing_whitespace = false
[*.xml]
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

21
.gitignore vendored Normal file
View file

@ -0,0 +1,21 @@
*.IMG
*.img
*.dsk
*.heapsnapshot
.DS_Store
.buildpath
.idea
.project
.settings
index.html
node_modules
npm-debug.log
private
static
tmp
/books
/notes
/states
/videos
/web
.elasticbeanstalk/

17
.jshintrc Normal file
View file

@ -0,0 +1,17 @@
{
"eqnull": true,
"loopfunc": true,
"sub": true,
"globalstrict": true,
"globals": {
"console": true,
"global": true,
"module": true,
"process": true,
"require": true,
"Buffer": true,
"setTimeout": true,
"__dirname": false,
"__filename": false
}
}

455
Gruntfile.js Normal file
View file

@ -0,0 +1,455 @@
/**
* @fileoverview Gruntfile for pcjs.org
* @author <a href="mailto:Jeff@pcjs.org">Jeff Parsons</a> (@jeffpar)
* @version 1.0
* Created 2014-03-11
*
* Copyright © 2012-2014 Jeff Parsons <Jeff@pcjs.org>
*
* This file is part of the JavaScript Machines Project (aka JSMachines) at <http://jsmachines.net/>
* and <http://pcjs.org/>.
*
* JSMachines is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* JSMachines is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with JSMachines.
* If not, see <http://www.gnu.org/licenses/gpl.html>.
*
* You are required to include the above copyright notice in every source code file of every
* copy or modified version of this work, and to display that copyright notice on every screen
* that loads or runs any version of this software (see Computer.sCopyright).
*
* Some JSMachines files also attempt to load external resource files, such as character-image files,
* ROM files, and disk image files. Those external resource files are not considered part of the
* JSMachines Project for purposes of the GNU General Public License, and the author does not claim
* any copyright as to their contents.
*/
"use strict";
/*
* Overview
* ---
* Based on the specified version in package.json, we build a matching version
* folder in /versions for each of the machine simulations; each of those folders
* in turn receives compiled versions of the corresponding machine simulation scripts
* (c1p*.js and pc*.js), along with copies of both the shared and machine-specific
* CSS and XSL stylesheets that the scripts rely on.
*
* Usage
* ---
* grunt [task[:target] ...] [--rebuild]
*
* If no tasks are specified, the "default" task alias will be run. If --rebuild is present,
* grunt will run the "closureCompiler" task (with closureCompiler.options.checkModified set
* to false) followed by the "copy" task; otherwise, it will run the "closureCompiler" task
* (with closureCompiler.options.checkModified set to true) followed by the "newer:copy" task.
*
* The former insures that all files are recompiled and recopied, while the latter only recompiles
* and/or recopies those files whose "src" file(s) are newer than the corresponding "dest" file(s).
*
* The combination of "grunt-contrib-copy" and "grunt-newer" could have possibly been replaced
* by "grunt-rsync", except that the latter didn't seem to support "process" functions; however,
* it's also possible I didn't have it configured properly at the time.
*
* Utility Tasks
* ---
* grunt compile: runs "closureCompiler" to produce compiled c1p*.js and pc*.js scripts
* grunt nocompile: runs "concat" to produce uncompiled c1p*.js and pc*.js scripts
* grunt promote: runs "replace" to promote all machine XML files to the current version
*
* The "grunt nocompile" task is intended for debugging only; if you use it, be sure to run
* a final "grunt compile" (or "grunt --rebuild") and retest before pushing out a new release.
*
* The "manifester" Task
* ---
* I added the "manifester" task to process manifest.xml files, which I use to record the existence
* application archives. "manifester" walks all the manifests and verifies that they're still valid,
* and optionally fetches local copies of everything described.
*
* The "prepjs" Task
* ---
* I added the "prepjs" task to perform the same constant inlining that my old PHP script "inline.php"
* used to do as part of the old "jsmachines.net" build process. Unfortunately, Grunt appears to be
* a real memory hog, and so "prepjs" had to be disabled until I could resolve that issue (see my notes
* in "my_modules/grunts/prepjs/tasks/prepjs.js" for details).
*
* With the current version of the Closure Compiler, I don't see any measurable performance benefit
* to doing my own inlining, but I still wanted to port the code, partly in case I discover some benefit
* down the road (or if I think of some other pre-processing I'd like to incorporate), and partly for
* the experience of writing my own Grunt task -- an experience I didn't find all that pleasant, due to
* the weak documentation and unfortunate memory constraints.
*
* To integrate "prepjs" back into the build process, add it to the "default" task, and change the
* "closureCompiler" task to compile the inlined code in "/tmp/(c1pjs|pcjs)/...". The "/tmp" folder
* structure mirrors the "/versions" folder structure.
*/
var path = require("path");
module.exports = function(grunt) {
/*
* I could have added this to the top of the file instead:
*
* require("./package.json");
*
* but the following seems more "grunt-like". It's also more traditional to pass
* the package.json properties to grunt.initConfig() via a "pkg" property, like so:
*
* pkg: grunt.file.readJSON("package.json");
*
* and then use grunt template strings such as:
*
* "<%= pkg.name %>"
*
* which would be fine for most of my needs, but some of the information I need
* from the package.json is not in string form (eg, pcJSFiles, which is an array of
* file names). So I create a "pkg" variable first, which allows me to do both.
*/
/**
* @class
* @property {string} name
* @property {string} version
* @property {Array.<string>} c1pJSFiles
* @property {Array.<string>} pcJSFiles
* @property {Array.<string>} closureCompilerExterns
*/
var pkg = grunt.file.readJSON("package.json");
var tmpC1Pjs = "./tmp/c1pjs/" + pkg.version + "/c1p.js";
var tmpPCjs = "./tmp/pcjs/" + pkg.version + "/pc.js";
grunt.initConfig({
pkg: pkg, // pass the "package.json" object to initConfig() as a property, too
manifester: {
options: {
},
"apps": {
src: "./apps/**/manifest.xml"
}
},
concat: {
options: {
// separator: ';'
},
"c1p.js": {
src: pkg.c1pJSFiles,
dest: "./versions/c1pjs/" + pkg.version + "/c1p.js",
options: {
process: function(src, filepath) {
return (path.basename(filepath) == "debugger.js"? "" : src);
}
}
},
"c1p-dbg.js": {
src: pkg.c1pJSFiles,
dest: "./versions/c1pjs/" + pkg.version + "/c1p-dbg.js"
},
"pc.js": {
src: pkg.pcJSFiles,
dest: "./versions/pcjs/" + pkg.version + "/pc.js",
options: {
process: function(src, filepath) {
return (path.basename(filepath) == "debugger.js"? "" : src);
}
}
},
"pc-dbg.js": {
src: pkg.pcJSFiles,
dest: "./versions/pcjs/" + pkg.version + "/pc-dbg.js"
},
"tmp-c1pjs": {
src: pkg.c1pJSFiles,
dest: tmpC1Pjs,
options: {
banner: '"use strict";\n\n',
process: function(src, filepath) {
return "// " + filepath + "\n" +
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^\}]*\}|[^\n]*)(\n|$)/g, '');
}
}
},
"tmp-pcjs": {
src: pkg.pcJSFiles,
dest: tmpPCjs,
options: {
banner: '"use strict";\n\n',
process: function(src, filepath) {
return "// " + filepath + "\n" +
src.replace(/(^|\n)[ \t]*(['"])use strict\2;?\s*/g, '$1').replace(/if\s*\(typeof\s+(module|APP_PCJS)\s*!==\s*(['"])undefined\2\)\s*(\{[^\}]*\}|[^\n]*)(\n|$)/g, '');
}
}
}
},
prepjs: {
options: {
includeObjectConstants: false,
listConstants: true,
replaceConstants: true
},
"c1p.js": {
includeObjectConstants: true,
src: pkg.c1pJSFiles,
dest: tmpC1Pjs
},
"pc.js": {
src: pkg.pcJSFiles,
dest: tmpPCjs
}
},
closureCompiler: {
options: {
// [REQUIRED] Path to closure compiler
compilerFile: "./bin/compiler.jar",
// [OPTIONAL] set to true if you want to check if files were modified before starting compilation
checkModified: grunt.option("rebuild")? false : true,
// [OPTIONAL] Set Closure Compiler Directives here
compilerOpts: {
/*
* Keys will be used as directives for the compiler; values can be strings or arrays.
* If no value is required, use null.
*
* The directive 'externs' is treated as a special case, allowing a grunt file syntax (<config:...>, *)
*/
compilation_level: "ADVANCED_OPTIMIZATIONS",
externs: pkg.closureCompilerExterns,
define: ["'SITEHOST=\"www.pcjs.org\"'", "'COMPILED=true'", "'DEBUG=false'", "'MAXDEBUG=false'"],
warning_level: "verbose",
// jscomp_off: ["checkTypes", "fileoverviewTags"],
// summary_detail_level: 3,
// formatting: "PRETTY_PRINT --debug",
output_wrapper: "'(function(){%output%})();'"
},
// [OPTIONAL] Set exec method options
execOpts: {
/*
* Set maxBuffer if you got message "Error: maxBuffer exceeded."
* Node default: 200*1024
*/
// maxBuffer: 999999 * 1024
},
// [OPTIONAL] Java VM optimization options
//
// See: https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options?
//
// Setting one of these to 'true' is strongly recommended, and can reduce compile times by 50-80%
// depending on compilation size and hardware. On server-class hardware, such as with GitHub's Travis
// hook, TieredCompilation should be used; on standard developer hardware, d32 may be better.
//
// Set as appropriate for your environment. Default for both is 'false'; do not set both to 'true'.
d32: false, // will use 'java -client -d32 -jar compiler.jar'
TieredCompilation: false // will use 'java -server -XX:+TieredCompilation -jar compiler.jar'
},
"c1p.js": {
/*
* [OPTIONAL] Here you can add new or override previous option of the Closure Compiler Directives.
*
* IMPORTANT! The feature is provided as a temporary solution to [Grunt Issue #738](https://github.com/gruntjs/grunt/issues/738).
* If/when that issue is fixed, this feature may be removed.
*/
TEMPcompilerOpts: {
create_source_map: "./tmp/c1pjs/" + pkg.version + "/c1p.map",
define: ["'APPNAME=\"C1Pjs\"'", "'APPVERSION=\"" + pkg.version + "\"'", "'DEBUGGER=false'",
"'SITEHOST=\"www.pcjs.org\"'", "'COMPILED=true'", "'DEBUG=false'", "'MAXDEBUG=false'"],
output_wrapper: "'(function(){%output%})();//@ sourceMappingURL=/tmp/c1pjs/" + pkg.version + "/c1p.map'"
},
// src: pkg.c1pJSFiles,
src: tmpC1Pjs,
dest: "./versions/c1pjs/" + pkg.version + "/c1p.js"
},
"c1p-dbg.js": {
TEMPcompilerOpts: {
create_source_map: "./tmp/c1pjs/" + pkg.version + "/c1p-dbg.map",
define: ["'APPNAME=\"C1Pjs\"'", "'APPVERSION=\"" + pkg.version + "\"'",
"'SITEHOST=\"www.pcjs.org\"'", "'COMPILED=true'", "'DEBUG=false'", "'MAXDEBUG=false'"],
output_wrapper: "'(function(){%output%})();//@ sourceMappingURL=/tmp/c1pjs/" + pkg.version + "/c1p-dbg.map'"
},
// src: pkg.c1pJSFiles,
src: tmpC1Pjs,
dest: "./versions/c1pjs/" + pkg.version + "/c1p-dbg.js"
},
"pc.js": {
TEMPcompilerOpts: {
create_source_map: "./tmp/pcjs/" + pkg.version + "/pc.map",
define: ["'APPNAME=\"PCjs\"'", "'APPVERSION=\"" + pkg.version + "\"'", "'DEBUGGER=false'",
"'SITEHOST=\"www.pcjs.org\"'", "'COMPILED=true'", "'DEBUG=false'", "'MAXDEBUG=false'"],
output_wrapper: "'(function(){%output%})();//@ sourceMappingURL=/tmp/pcjs/" + pkg.version + "/pc.map'"
},
// src: pkg.pcJSFiles,
src: tmpPCjs,
dest: "./versions/" + pkg.name + "/" + pkg.version + "/pc.js"
},
"pc-dbg.js": {
/*
* Technically, this is the one case we don't need to override the default 'define' settings, but maybe it's best to be explicit.
*/
TEMPcompilerOpts: {
create_source_map: "./tmp/pcjs/" + pkg.version + "/pc-dbg.map",
define: ["'APPNAME=\"PCjs\"'", "'APPVERSION=\"" + pkg.version + "\"'",
"'SITEHOST=\"www.pcjs.org\"'", "'COMPILED=true'", "'DEBUG=false'", "'MAXDEBUG=false'"],
output_wrapper: "'(function(){%output%})();//@ sourceMappingURL=/tmp/pcjs/" + pkg.version + "/pc-dbg.map'"
},
// src: pkg.pcJSFiles,
src: tmpPCjs,
dest: "./versions/" + pkg.name + "/" + pkg.version + "/pc-dbg.js"
}
},
copy: {
"c1pxsl": {
files: [
{
cwd: "./my_modules/shared/templates/",
src: ["common.css", "common.xsl", "document.css", "document.xsl", "machine.xsl", "manifest.xsl", "outline.xsl"],
dest: "versions/c1pjs/<%= pkg.version %>/",
expand: true
}
],
options: {
process: function(content, srcPath) {
var s = content.replace(/(<xsl:variable name="APPVERSION">)[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2");
s = s.replace(/"[^"]*\/?(common.css|common.xsl|components.css|components.xsl|document.css|document.xsl)"/g, '"/versions/c1pjs/' + pkg.version + '/$1"');
s = s.replace(/[ \t]*\/\*[^\*][\s\S]*?\*\//g, "").replace(/[ \t]*<!--[^@]*?-->[ \t]*\n?/g, "");
return s;
}
}
},
"pcxsl": {
files: [
{
cwd: "./my_modules/shared/templates/",
src: ["common.css", "common.xsl", "document.css", "document.xsl", "machine.xsl", "manifest.xsl", "outline.xsl"],
dest: "versions/pcjs/<%= pkg.version %>/",
expand: true
}
],
options: {
process: function(content, srcPath) {
var s = content.replace(/(<xsl:variable name="APPVERSION">)[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2");
s = s.replace(/"[^"]*\/?(common.css|common.xsl|components.css|components.xsl|document.css|document.xsl)"/g, '"/versions/pcjs/' + pkg.version + '/$1"');
s = s.replace(/[ \t]*\/\*[^\*][\s\S]*?\*\//g, "").replace(/[ \t]*<!--[^@]*?-->[ \t]*\n?/g, "");
return s;
}
}
},
"c1pjs": {
files: [
{
cwd: "./my_modules/c1pjs-client/templates/",
src: ["components.*"],
dest: "versions/c1pjs/<%= pkg.version %>/",
expand: true
}
],
options: {
process: function(content, srcPath) {
var s = content.replace(/(<xsl:variable name="APPVERSION">)[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2");
s = s.replace(/[ \t]*\/\*[^\*][\s\S]*?\*\//g, "").replace(/[ \t]*<!--[^@]*?-->[ \t]*\n?/g, "");
return s;
}
}
},
"pcjs": {
files: [
{
cwd: "./my_modules/pcjs-client/templates/",
src: ["components.*"],
dest: "versions/pcjs/<%= pkg.version %>/",
expand: true
}
],
options: {
process: function(content, srcPath) {
var s = content.replace(/(<xsl:variable name="APPVERSION">)[^<]*(<\/xsl:variable>)/g, "$1" + pkg.version + "$2");
s = s.replace(/[ \t]*\/\*[^\*][\s\S]*?\*\//g, "").replace(/[ \t]*<!--[^@]*?-->[ \t]*\n?/g, "");
return s;
}
}
},
"demos": {
files: [
{
cwd: "versions/pcjs/<%= pkg.version %>/",
src: ["pc.js", "pc-dbg.js", "components.css", "components.xsl"],
dest: "docs/pcjs/demos/",
expand: true
}
],
options: {
process: function(content, srcPath) {
return content.replace(/\/versions\/\{\$APPCLASS\}\/\{\$APPVERSION\}\//g, "");
}
}
}
},
run: {
"delete_indexes": {
options: {cwd: "."},
cmd: "./my_modules/htmlout/bin/delete_indexes.sh",
args: []
},
"zipify_demos": {
options: {cwd: "docs/pcjs/demos"},
cmd: "./zip.sh",
args: ["v" + pkg.version + ".zip"]
}
},
replace: {
"fix_source_maps": {
src: ["./tmp/c1pjs/" + pkg.version + "/c1p*.map", "./tmp/pcjs/" + pkg.version + "/pc*.map"],
overwrite: true,
replacements: [
{
from: /"sources":\s*\["\.\/tmp\//g,
to: '"sources":["/tmp/'
}
]
},
"promote_to_version": {
src: ["apps/**/*.xml", "configs/**/*.xml", "disks/**/*.xml", "pubs/**/*.xml"],
overwrite: true,
replacements: [
{
from: /href="\/versions\/([^\/]*)\/[0-9\.]*\/(machine|manifest|outline)\.xsl"/g,
to: 'href="/versions/$1/<%= pkg.version %>/$2.xsl"'
}
]
}
}
});
grunt.loadNpmTasks("grunt-closure-tools");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-newer");
grunt.loadNpmTasks("grunt-run");
grunt.loadNpmTasks("grunt-text-replace");
grunt.loadTasks("my_modules/grunts/manifester/tasks");
grunt.loadTasks("my_modules/grunts/prepjs/tasks");
grunt.registerTask("preCompiler", grunt.option("rebuild")? ["concat:tmp-c1pjs", "concat:tmp-pcjs"] : ["newer:concat:tmp-c1pjs", "newer:concat:tmp-pcjs"]);
grunt.registerTask("compile", ["preCompiler", "closureCompiler", "replace:fix_source_maps"]);
grunt.registerTask('nocompile', function(target) {
if (!target) {
grunt.task.run(["concat:c1p.js", "concat:c1p-dbg.js", "concat:pc.js", "concat:pc-dbg.js"]);
} else {
grunt.task.run("concat:" + target);
}
});
grunt.registerTask("promote", ["replace:promote_to_version"]);
grunt.registerTask("clean", ["run:delete_indexes"]);
grunt.registerTask("copyFiles", grunt.option("rebuild")? ["copy"] : ["newer:copy"]);
grunt.registerTask("default", ["compile", "copyFiles", "run:zipify_demos"]);
};

674
LICENSE Normal file
View file

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

210
README.md Normal file
View file

@ -0,0 +1,210 @@
The Original IBM PC in Your Browser
---
Welcome to [pcjs.org](http://www.pcjs.org/) and [PCjs](/docs/about/pcjs/), the first IBM PC simulation to run in your
web browser without any plugins. It was added to the [JavaScript Machines](/docs/about/) project in Fall 2012.
The project now includes:
* [PCjs](/docs/about/pcjs/), a simulation of the original IBM PC (circa 1981)
* [C1Pjs](/docs/c1pjs/), a simulation of the OSI Challenger 1P (circa 1978)
All our simulations are written entirely in JavaScript. No Flash, Java or other plugins are required.
Supported browsers include recent versions of Internet Explorer (v9.0 or later), Safari, Chrome, Firefox and various
mobile browsers.
[[Embedded IBM PC]](/configs/pc/machines/5150/mda/64kb/ "PCjs:ibm5150")
The [simulation](/configs/pc/machines/5150/mda/64kb/) above features an Intel 8088 running at 4.77Mhz,
with 64Kb of RAM and an IBM Monochrome Display Adapter. For more control, there are also
[Control Panel](/configs/pc/machines/5150/mda/64kb/debugger/) and [Soft Keyboard](/configs/pc/machines/5150/mda/64kb/softkbd/)
configurations, featuring the built-in PCjs Debugger. For even greater control, build your own PC. The
[PCjs Documentation](/docs/pcjs/) will help you get started.
The goals of the [JavaScript Machines](/docs/about/) project are to create fast, full-featured simulations of classic
computer hardware, help people understand how these early machines worked, make it easy to experiment with different
machine configurations, and provide a platform for running and analyzing old computer software.
Demos
---
Some pre-configured machines are shown below, ready to run BASIC, DOS, Windows 1.01, and assorted non-DOS software.
![IBM PC running DONKEY.BAS](/configs/pc/machines/5150/cga/64kb/donkey/thumbnail.jpg "link:/configs/pc/machines/5150/cga/64kb/donkey/:200:100")
![IBM PC XT w/CGA, 10Mb Hard Drive](/configs/pc/machines/5160/cga/256kb/demo/thumbnail.jpg "link:/configs/pc/machines/5160/cga/256kb/demo/:200:100")
![IBM PC XT w/CGA, Windows 1.01](/configs/pc/machines/5160/cga/256kb/win101/thumbnail.jpg "link:/configs/pc/machines/5160/cga/256kb/win101/:200:100")
![IBM PC XT w/EGA, Windows 1.01](/configs/pc/machines/5160/ega/640kb/win101/thumbnail.jpg "link:/configs/pc/machines/5160/ega/640kb/win101/:200:100")
![IBM PC w/MDA, CP/M-86](/disks/pc/cpm/thumbnail.jpg "link:/disks/pc/cpm/:200:100")
![IBM PC w/MDA, Microsoft Adventure](/disks/pc/games/microsoft/adventure/thumbnail.jpg "link:/disks/pc/games/microsoft/adventure/:200:100")
![IBM PC w/CGA, Zork I](/disks/pc/games/infocom/zork1/thumbnail.jpg "link:/disks/pc/games/infocom/zork1/:200:100")
Check out the rest of the PCjs [Application](/apps/pc/), [Boot Disk](/disks/pc/) and [Machine](/configs/pc/machines/)
demos, including the [IBM PC XT "Server Array"](/configs/pc/machines/5160/cga/256kb/array/) and
[Windows 1.01 "Server Array"](/configs/pc/machines/5160/ega/640kb/array/) demos of multiple PCs running side-by-side.
C1Pjs
---
Below is the [OSI Challenger C1P](/docs/c1pjs/), another simulation in the JavaScript Machines project.
It simulates Ohio Scientific's 6502-based microcomputer, released in 1978. More details about this simulation
and the original machine are available in the [C1Pjs Documentation](/docs/c1pjs/).
[[Embedded OSI Challenger C1P]](/configs/c1p/machines/8kb/large/ "C1Pjs:demoC1P")
<!--BEGIN:EXCLUDE-->
Updating PCjs
===
Developing
---
Let's say you just finished developing, testing and deploying version 1.12.1, and you want to start developing some
new features for version 1.13.0. Here are the recommended steps:
1. Create and switch to a new Git development branch (eg, "node_dev")
2. Change the version number in [package.json](/package.json) (eg, to "1.13.0")
3. Run "grunt" (the default task will build fresh "1.13.0" copies of everything under "/versions")
4. Run "grunt promote" to bump the version in all the site's machine XML files to match (ie, to "1.13.0")
You may not want to do the last step until you're ready to start testing the new version. In fact, you may want to
manually edit the version in only a few machine configuration files for testing, leaving the rest set to the previous
version to make comparison runs easier, and then run "grunt promote" when the new version is much closer to being
released.
Commit the development branch to GitHub as often as desired. I probably tend to "over-commit", checking in lots of
intermediate changes before I finally decide that the new version is "good enough". But having too much delta history is
probably better than too little. Note that the initial "node_dev" commit may not get pushed to GituHub without first
running:
git push --set-upstream origin node_dev
One downside to intermediate commits to GitHub is that compiled versions of the sources (such as those in
[/docs/pcjs/demos/](/docs/pcjs/demos/)) may keep changing, and those particular commits are pretty useless.
To temporarily ignore changes to those files:
cd docs/pcjs/demos
git update-index --assume-unchanged components.xsl pc.js pc-dbg.js samples.zip
To see a list of all files that are marked as "assume-unchanged", use this command:
git ls-files -v | grep '^[[:lower:]]'
The same issue would exist for all new files created under "/versions", but fortunately, those files are ignored until
you explicitly add them to Git, which you'll want to do just prior to deployment:
git add versions/pcjs/1.13.0/*
git add versions/c1pjs/1.13.0/*
which is when you'll also want to do undo the "assume-unchanged" operation above:
cd docs/pcjs/demos
git update-index --no-assume-unchanged components.xsl pc.js pc-dbg.js samples.zip
Testing
---
PCjs can now be run from the command-line mode using Node, making it possible to script the application,
run a series of automated tests, etc:
cd ./my_modules/pcjs-client/bin
node pcjs
The [pcjs](/my_modules/pcjs-client/bin/pcjs) script in the *bin* directory loads all the PCjs browser scripts listed
in [package.json](/package.json), and then it starts a Node REPL ("read-eval-print loop"). The REPL handles a few
special commands (eg, "load", "quit") and passes anything else to the PCjs Debugger component. If no Debugger component
has been created yet, or if the Debugger didn't recognize the command, then it's passed on to *eval()*, like a good
little REPL.
Use the "load" command to load a JSON machine configuration file. A sample [machine.json](/my_modules/pcjs-client/bin/machine.json)
is provided in the *bin* directory, which is a "JSON-ified" version of the [machine.xml](/configs/pc/machines/5150/mda/64kb/machine.xml)
displayed on the [pcjs.org](http://www.pcjs.org/) home page.
The command-line loader creates all the JSON-defined machine components in the same order that the browser creates
XML-defined components. You can also issue the "load" command directly from the command-line:
node pcjs --cmd="load machine.json"
In fact, any number of "--cmd" arguments can be included on the command-line. A batch file syntax will eventually be
added, too.
When PCjs runs in a browser, an XML machine configuration file is transformed into HTML with a set of DIVs for each
component: an "object" DIV whose *data-value* attribute provides the initialization parameters for the corresponding
component, along with a set of optional "control" DIVs that the component can bind to (eg, a "Run" button, or a visual
representation of DIP switches, or whatever).
When PCjs is run from the command-line, there is no XML, HTML, or DIVs involved; this is basically a "headless" version
of PCjs, so there is no simple way to view a machine's video display or interact with its keyboard, mouse, etc.
You have to use Debugger commands to dump the machine's video buffer.
Since I was not inclined to add XML support to my Node environment, this has created some divergence between client
and server operation: PCjs on the client supports *only* XML machine configuration files, whereas PCjs on the server
supports *only* JSON machine configuration files.
I haven't decided whether I'll add support for JSON configuration files to the client, or add some XML-to-JSON conversion
to the server, or both.
Deploying
---
I like to use the AWS Elastic Beanstalk web interface to create a new "development" environment ("pcjs-dev") for testing:
1. Save the current production environment ("pcjs-env") as configuration "pcjs-config"
2. Create a new environment ("pcjs-dev") using the "pcjs-config" configuration
3. Wait for the new environment ("pcjs-dev") to start (ie, for its health to become "Green")
4. From Terminal, go to the `~/Sites/pcjs` folder and run `eb branch` followed by `git aws.push`
The `eb branch` command will display:
The current branch is "node_dev".
Enter an AWS Elastic Beanstalk environment name (auto-generated value is "pcjs-nodedev-env"): pcjs-dev
Do you want to copy the settings from environment "pcjs-env" for the new branch? [y/n]: y
after which we're ready for `git aws.push` to the new "pcjs-dev" environment.
See the "[Develop, Test, and Deploy](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs.sdlc.html)"
AWS documentation for more details.
On a local machine, the process is similar. If this is a "virgin" machine, you must first install Node and NPM;
see my notes on "[Installing Node (and NPM)](/my_modules/#installing-node-and-npm)" for more details.
Then install and run the PCjs web server files:
[iMac:~/Sites] git clone git@github.com:jeffpar/jsmachines.git pcjs
[iMac:~/Sites] cd pcjs
[iMac:~/Sites/pcjs] git checkout node_dev
[iMac:~/Sites/pcjs] npm install --production
[iMac:~/Sites/pcjs] export PORT=8086 (this is optional)
[iMac:~/Sites/pcjs] node server.js
For a machine that is simply out-of-date, you can do something like this:
[iMac:~/Sites/pcjs] git pull
[iMac:~/Sites/pcjs] npm update --production
[iMac:~/Sites/pcjs] export PORT=8086 (this is optional)
[iMac:~/Sites/pcjs] node server.js
In the second scenario, there may be stale "index.html" files that prevent you from seeing the latest versions
of everything, so before running Node, you may want to do this first:
[iMac:~/Sites/pcjs] touch my_modules/shared/templates/common.html
The [HTMLOut](/my_modules/htmlout/) module compares the timestamp of that template file to the timestamp of any
"index.html" and will regenerate the latter if it's out-of-date. There's a TODO to expand that check to include
the timestamp of any local README.md file, but there are many other factors that contribute to stale "index.html"
files, so the safest thing to do is touch the [common.html](/my_modules/shared/templates/common.html) template,
or delete all existing "index.html" files -- either by hand, or by using:
[iMac:~/Sites/pcjs] grunt clean
However, if you included "--production" in your NPM install/update commands, you won't have the necessary grunt
task files. You may not even have grunt itself installed, unless you've previously run:
[iMac:~/Sites/pcjs] sudo npm install grunt-cli -g
Stale "index.html" files may be a non-issue on AWS, because it appears to create a completely new directory
structure when it rebuilds the environment following a `git aws.push` -- but I'm not sure that's always true.
<!--END:EXCLUDE-->
More Information
---
Learn more about the [JavaScript Machines](/docs/about/) project and [PCjs](/docs/about/pcjs/). To
create your own PCjs machines, see the [Documentation](/docs/pcjs/) for details.
If you have questions or run into any problems, you're welcome to [tweet](http://twitter.com/jeffpar) or
[email](mailto:Jeff@pcjs.org).

124
apps/README.md Normal file
View file

@ -0,0 +1,124 @@
Application Archives
---
Browse classic [IBM PC](pc/) and [Challenger 1P](c1p/) software that you can run with [PCjs](/docs/about/pcjs/)
and [C1Pjs](/docs/c1pjs/).
### Software Application Manifests
Every complete software package is stored in its own folder, either as a set of individual files
(under [/apps](/apps/)) or as a set of disk images (under [/disks](/disks/)), along with a **manifest.xml**
file that describes the software. The manifest format is still being developed, but at a minimum, it
should contain the following information about the software:
- Title
- Version
- Type (eg, Application, Game, OS, Diagnostic, Utility, etc)
- Category (eg, Productivity, Text Adventure, BASIC Compiler, etc)
- Company (eg, IBM, Microsoft, etc)
- Creation Date (of first version)
- Release Date (of this version, if different from creation date)
- Creator(s) (of first version)
- Author(s) (of this version, if different from creator(s))
- Contributors(s) (names of additional contributor(s) to this version)
- Publisher (name of publisher, if different from company)
- License (with link to current software license, if any)
- Machine (reference to PCjs machine.xml file capable of loading/running the software)
- Disk(s) (one or more entries describing sets of files and/or disk images)
The distinctions made by Type and Category are a bit aribitrary and likely to change. For now,
Type is merely a reflection of how we initially filed the software (eg, under [/diags](/disks/pc/diags/),
[/games](/disks/pc/games/), [/tools](/disks/pc/tools/), etc), while Category provides more detail.
### Example: VisiCalc
VisiCalc is stored in an [/apps folder](/apps/pc/1981/visicalc/), and two relevant files are
described by &lt;file&gt; entries in its [manifest](/apps/pc/1981/visicalc/manifest.xml):
<manifest>
<title>VisiCalc</title>
<version>VC-176Y2-IBM-TEST</version>
<type>Application</type>
<category>Productivity</category>
<company>Software Arts</company>
<releaseDate>December 16, 1981</releaseDate>
<machine href="/configs/pc/machines/5150/mda/64kb/machine.xml" state="/apps/pc/1981/visicalc/state.json"/>
<disk id="disk" dir="/apps/pc/1981/visicalc/bin/">
<file>VC.COM</file>
<file dir="../">README.md</file>
<link href="http://www.bricklin.com/history/vclicense.htm">VisiCalc License</link>
</disk>
</manifest>
Since this [manifest](/apps/pc/1981/visicalc/manifest.xml) also contains a &lt;machine&gt; entry,
the default manifest stylesheet will automatically load and launch the associated
[PCjs machine](/configs/pc/machines/5150/mda/64kb/machine.xml). The machine will boot or resume according
to its own &lt;[computer](/docs/pcjs/computer/)&gt; settings, unless the manifest overrides the machine's
default state with its own *state* setting; eg:
<machine href="/configs/pc/machines/5150/mda/64kb/machine.xml" state="/apps/pc/1981/visicalc/state.json"/>
The machine.xml file, in turn, refers to a [sample set](/configs/pc/disks/samples.xml) of disk images, one of which is:
<manifest ref="/apps/pc/1981/visicalc/manifest.xml" disk="*"/>
which refers to the &lt;disk&gt; entry in the VisiCalc manifest -- which brings us full circle.
Since that &lt;disk&gt; entry is just a reference to a folder, PCjs must first convert it to a disk image,
using the following API request:
http://www.pcjs.org/api/v1/dump?path=/apps/pc/1981/visicalc/bin/VC.COM;../README.md&format=json
The PCjs `diskdump` module processes the dump request and generates a JSON-encoded DOS 2.x-compatible disk image
containing all the specified files.
However, to avoid the PCjs web server re-generating the same disk image for every user-initiated disk load, we
have saved that JSON-encoded image as static file on the server, and then added an *href* attribute to the manifest's
&lt;disk&gt; entry:
<manifest>
<disk id="disk01" dir="/apps/pc/1981/visicalc/private/" href="/apps/pc/1981/visicalc/disk.json">
...
</disk>
</manifest>
PCjs always prefers a resource specified by *href*. While the &lt;file&gt; entries are now superfluous, they
still serve to document the contents of the disk image, and are still necessary if the disk image ever needs to
be re-generated.
### Example: CP/M-86
CPM-86 is stored as two disk images in a [/disks folder](/disks/pc/cpm/). The disk images are described in that
folder's [manifest](/disks/pc/cpm/manifest.xml):
<manifest>
<title>CP/M-86</title>
<version>1.1B</version>
<type>OS</type>
<category>Operating System</category>
<company href="http://en.wikipedia.org/wiki/Digital_Research">Digital Research</company>
<publisher href="http://en.wikipedia.org/wiki/Eagle_Computer">Eagle Computer</publisher>
<releaseDate>May 20, 1983</releaseDate>
<machine href="/disks/pc/cpm/machine.xml"/>
<disk id="disk01" href="/disks/pc/cpm/cpm86-disk1.json">
<name>CP/M-86 (Disk 1)</name>
</disk>
<disk id="disk02" href="/disks/pc/cpm/cpm86-disk2.json">
<name>CP/M-86 (Disk 2)</name>
</disk>
</manifest>
In this case, the software was "born" as disk images (non-DOS disk images at that), so we don't
bother listing the contents of those images with &lt;file&gt; entries inside the &lt;disk&gt; entries.
We do, however, include optional &lt;name&gt; entries that help describe (or at least differentiate)
the disk images.
If a machine file wanted to use only the first disk, then it would specify:
<manifest ref="/disks/pc/cpm/manifest.xml" disk="disk01"/>
and if it wanted to use all the disks listed in the manifest, it would specify:
<manifest ref="/disks/pc/cpm/manifest.xml" disk="*"/>
which is what our [CP/M Machine Configuration](/disks/pc/cpm/machine.xml) does.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
.0000/A9 07 85 FF A9 00 85 FE A8 A2 19 91 FE C8 D0 FB E6 FF CA D0 F6 A9 20 A2 00 9D 00 D0 9D 00 D1 9D 00 D2 9D 00 D3 E8 D0 F1 A9 85 85 FE A9 D0 85 FF A9 25 85 FC A9 D3 85 FD A0 14 A9 80 91 FE A9 87 91 FC 88 D0 F5 A2 14 A0 00 A5 FE 18 69 20 85 FE 90 02 E6 FF A9 8F 91 FE A0 15 A9 88 91 FE CA D0 E6 A9 07 85 FF 4C 71 05 EA 85 FD 85 FC 85 F9 85 F8 85 F7 85 F6 85 F0 A9 A6 85 A5 A9 D0 85 A6 A5 FF 85 9A A5 FE 85 99 A5 FD 10 03 18 69 50 85 FB A9 14 85 FA A2 00 A4 FB B9 40 0D 4A 90 04 A9 F0 B0 02 A9 2E 9D 26 D3 C8 C0 50 D0 02 A0 00 E8 A5 F0 4A 90 11 E0 14 F0 11 84 F5 8A A8 A9 AB 91 A5 A4 F5 20 69 03 E0 14 D0 CF A5 99 18 69 50 85 99 90 02 E6 9A A9 20 C5 9A D0 04 A9 07 85 9A A5 A5 18 69 20 85 A5 90 02 E6 A6 C6 FA D0 A7 4C 5F 02 82 .0222/00 01 00 0A 00 64 03 E8 27 10 00 00 00 00 A4 FA 91 F1 E6 FA 60 A0 00 38 A5 F3 FD 21 02 85 F5 CA A5 F4 FD 21 02 90 0A E8 C8 85 F4 A5 F5 85 F3 B0 E7 E8 98 09 30 20 30 02 CA CA D0 D9 60 A9 46 85 F1 A9 D3 85 F2 A2 08 A5 F8 85 F3 A5 F9 85 F4 A9 00 85 FA 20 37 02 A9 20 20 30 02 A9 28 20 30 02 4C A1 02 48 30 04 A9 2B 10 02 A9 2D 20 30 02 68 10 05 18 49 FF 69 01 85 F3 A2 04 20 37 02 60 A9 00 85 F4 A5 FD 20 85 02 A9 2C 20 30 02 A5 FC 20 85 02 EA A9 29 20 30 02 A9 20 20 30 02 A5 F6 85 F3 A5 F7 85 F4 A2 0A 20 37 02 4C EC 02 C9 50 D0 05 EA A9 00 F0 04 C9 B0 F0 F8 A0 10 CA D0 FD 88 D0 FA 60 8D 00 DF AD 00 DF 60 A9 7F 4C 57 05 C9 7F D0 0C E6 FD A5 FD 20 CF 02 85 FD 4C 60 03 A9 7F 20 E5 02 C9 BF D0 05 C6 FD 4C F7 02 A9 7F 20 E5 02 C9 DF D0 21 E6 FC A5 FC 20 CF 02 85 FC 38 A5 FE E9 50 85 FE B0 02 C6 FF A9 06 C5 FF D0 04 A9 1F 85 FF 4C 60 03 A9 7F 20 E5 02 C9 EF D0 33 C6 FC A5 FC 20 CF 02 85 FC 18 A5 FE 69 50 85 FE 90 02 E6 FF A9 20 C5 FF D0 04 A9 07 85 FF A9 7E 25 F0 85 F0 4C 77 00 A9 15 C6 F1 D0 FC 18 69 FF D0 F7 60 A5 F0 0A 90 03 4C 8F 03 E0 C0 F0 04 A2 C0 86 F2 20 69 03 E6 F2 F0 EE 4C EC 02 A5 F0 4A 4A B0 09 A5 F0 09 02 85 F0 4C AF 03 A9 FE 20 E5 02 C9 DE F0 08 4C 9B 04 A5 FB 91 F1 60 A9 00 85 FA A9 A6 85 F1 A9 D0 85 F2 A0 00 B1 F1 85 FB A9 AB 91 F1 20 00 FD C9 0A D0 0C A5 F0 49 01 85 F0 20 AA 03 4C A7 03 C9 32 D0 0A C0 13 F0 E5 20 AA 03 C8 D0 D7 C9 31 D0 0A C0 00 F0 F0 20 AA 03 88 10 C9 C9 33 D0 18 A9 13 C5 FA F0 EE E6 FA 20 AA 03 18 A9 20 65 F1 85 F1 90 02 E6 F2 D0 D4 C9 34 D0 19 A9 00 C5 FA F0 E2 C6 FA 20 AA 03 38 A5 F1 E9 20 85 F1 B0 02 C6 F2 4C BD 03 C9 0D D0 03 4C D2 03 C9 50 D0 5C A5 FE 85 F3 A5 FF 85 F4 A5 FA 85 F5 A9 00 C5 F5 F0 19 18 A5 F3 69 50 85 F3 90 02 E6 F4 A9 20 C5 F4 D0 04 A9 07 85 F4 C6 F5 D0 E7 A5 FD 10 03 18 69 50 84 FB 18 65 FB C9 50 90 02 E9 50 8C 11 02 A8 AD 13 02 C9 50 D0 06 A9 03 A2 F0 D0 04 A9 00 A2 2E 91 F3 86 FB AC 11 02 4C C5 03 C9 4F F0 A0 4C C5 03 A9 07 85 F2 A9 00 85 F1 85 FA A9 4E 85 F3 A9 4E 85 F4 A9 00 85 F5 A2 08 BC 68 05 B1 F1 4A 90 02 E6 F5 CA D0 F3 A9 03 A0 51 D1 F1 D0 2C A2 02 E4 F5 F0 0B E8 E4 F5 F0 06 A9 01 91 F1 85 FA E6 F1 D0 02 E6 F2 C6 F4 D0 CA 18 A5 F1 69 02 85 F1 90 02 E6 F2 C6 F3 D0 B7 F0 0A A2 03 E4 F5 D0 DF A9 02 D0 D7 A9 00 85 F9 85 F8 A9 06 85 F2 A9 FF 85 F1 A2 50 A0 50 B1 F1 C9 02 D0 06 A9 03 91 F1 D0 08 C9 01 D0 04 A9 00 91 F1 C9 03 D0 06 E6 F8 D0 02 E6 F9 88 D0 DF 18 A5 F1 69 50 85 F1 90 02 E6 F2 CA D0 CF A5 FA C9 00 D0 03 4C AF 03 E6 F6 D0 02 E6 F7 A5 F0 09 80 85 F0 4C 77 00 A0 FD 8C 00 DF AC 00 DF C0 EF F0 F4 20 E5 02 4C F1 02 00 01 02 50 52 A0 A1 A2 A9 4C 85 FE A9 00 4C 69 00 EA 00 00 00 00 00 00 00 .0000G

18
apps/c1p/6502/sim.inc Normal file
View file

@ -0,0 +1,18 @@
.code
.org $200
;
; These must be kept in sync with the "opSim operation codes" in c1p.js
;
.define OP_SIM $02
.define SIMOP_HLT $00
.define SIMOP_MSG $01
.macro SIM_MSG msg
.local addr
.byte OP_SIM,SIMOP_MSG
addr: .ASCIIZ msg
.endmacro
.macro SIM_HLT
.byte OP_SIM,SIMOP_HLT
.endmacro

View file

@ -0,0 +1,476 @@
.0200/A0
01
8C
CE
03
A9
00
8D
D1
03
8D
D4
03
AD
D4
03
02
01
54
65
73
74
69
6E
67
20
25
41
00
29
0F
8D
D5
03
AD
D4
03
29
F0
8D
D9
03
09
0F
8D
DA
03
AD
D1
03
29
0F
8D
D3
03
AD
D1
03
29
F0
8D
D2
03
20
79
02
20
62
03
20
33
03
D0
26
20
CC
02
20
6F
03
20
33
03
D0
1B
EE
D1
03
D0
D5
EE
D4
03
D0
AE
88
10
AB
A9
00
8D
CE
03
02
01
50
41
53
53
00
F0
07
02
01
46
41
49
4C
00
02
00
F8
C0
01
AD
D1
03
6D
D4
03
8D
CC
03
08
68
8D
CD
03
D8
C0
01
AD
D1
03
6D
D4
03
8D
CF
03
08
68
8D
D0
03
C0
01
AD
D3
03
6D
D5
03
C9
0A
A2
00
90
06
E8
69
05
29
0F
38
0D
D2
03
7D
D9
03
08
B0
04
C9
A0
90
03
69
5F
38
8D
CA
03
08
68
8D
CB
03
68
8D
D7
03
60
F8
C0
01
AD
D1
03
ED
D4
03
8D
CC
03
08
68
8D
CD
03
D8
C0
01
AD
D1
03
ED
D4
03
8D
CF
03
08
68
8D
D0
03
60
C0
01
AD
D3
03
ED
D5
03
A2
00
B0
06
E8
E9
05
29
0F
18
0D
D2
03
FD
D9
03
B0
02
E9
5F
8D
CA
03
60
C0
01
AD
D3
03
ED
D5
03
A2
00
B0
04
E8
29
0F
18
0D
D2
03
FD
D9
03
B0
02
E9
5F
E0
00
F0
02
E9
06
8D
CA
03
60
AD
CC
03
CD
CA
03
D0
26
AD
CD
03
4D
D6
03
29
80
D0
1C
AD
CD
03
4D
D7
03
29
40
D0
12
AD
CD
03
4D
D8
03
29
02
D0
08
AD
CD
03
4D
CB
03
29
01
60
AD
D7
03
8D
D6
03
AD
D0
03
8D
D8
03
60
20
EF
02
AD
D0
03
8D
D6
03
8D
D7
03
8D
D8
03
8D
CB
03
60
AD
CA
03
08
68
8D
D6
03
8D
D8
03
60
20
0F
03
AD
CA
03
08
68
8D
D6
03
8D
D8
03
AD
D0
03
8D
D7
03
8D
CB
03
60
AD
CA
03
08
68
8D
D6
03
8D
D8
03
60
20
EF
02
AD
CA
03
08
68
8D
D6
03
8D
D8
03
AD
D0
03
8D
D7
03
8D
CB
03
60
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
.0200G

View file

@ -0,0 +1,332 @@
;
; The following code comes from:
;
; http://www.6502.org/tutorials/decimal_mode.html
;
; and is built with:
;
; ca65 bcd.asm -I ../.. -l -o bcd.obj
; ld65 bcd.obj -o bcd.bin --target none
;
; An ASCII hex file which the OSI machine-language monitor can load
; is produced with the following commands:
;
; echo -n ".0200/" > bcd.txt
; hexdump -e '1/1 "%02X\n"' -v bcd.bin >> bcd.txt
; echo -n ".0200" >> bcd.txt
;
.include "sim.inc"
VALID_BCD_ONLY = 0
VALID_FLAGS_ONLY = 0
;
; Verify decimal mode behavior
;
; Returns:
; ERROR = 0 if the test passed
; ERROR = 1 if the test failed
;
; This routine requires 17 bytes of RAM -- 1 byte each for:
; AR, CF, DA, DNVZC, ERROR, HA, HNVZC, N1, N1H, N1L, N2, N2L, NF, VF, and ZF
; and 2 bytes for N2H
;
; Variables:
; N1 and N2 are the two numbers to be added or subtracted
; N1H, N1L, N2H, and N2L are the upper 4 bits and lower 4 bits of N1 and N2
; DA and DNVZC are the actual accumulator and flag results in decimal mode
; HA and HNVZC are the accumulator and flag results when N1 and N2 are
; added or subtracted using binary arithmetic
; AR, NF, VF, ZF, and CF are the predicted decimal mode accumulator and
; flag results, calculated using binary arithmetic
;
; This program takes approximately 1 minute at 1 MHz (a few seconds more on
; a 65C02 than a 6502 or 65816)
;
TEST: LDY #1 ; initialize Y (used to loop through carry flag values)
STY ERROR ; store 1 in ERROR until the test passes
LDA #0 ; initialize N1 and N2
STA N1
STA N2
LOOP1: LDA N2 ; N2L = N2 & $0F
SIM_MSG "Testing %A"
AND #$0F ; [1] see text
.if VALID_BCD_ONLY <> 0
CMP #$0A
BCS NEXT2
.endif
STA N2L
LDA N2 ; N2H = N2 & $F0
AND #$F0 ; [2] see text
.if VALID_BCD_ONLY <> 0
CMP #$A0
BCS NEXT2
.endif
STA N2H
ORA #$0F ; N2H+1 = (N2 & $F0) + $0F
STA N2H+1
LOOP2: LDA N1 ; N1L = N1 & $0F
;; SIM_MSG " with %A"
AND #$0F ; [3] see text
.if VALID_BCD_ONLY <> 0
CMP #$0A
BCS NEXT1
.endif
STA N1L
LDA N1 ; N1H = N1 & $F0
AND #$F0 ; [4] see text
.if VALID_BCD_ONLY <> 0
CMP #$A0
BCS NEXT1
.endif
STA N1H
JSR ADD
JSR A6502
JSR COMPARE
BNE ERR
JSR SUB
JSR S6502
JSR COMPARE
BNE ERR
NEXT1: INC N1 ; [5] see text
BNE LOOP2 ; loop through all 256 values of N1
NEXT2: INC N2 ; [6] see text
BNE LOOP1 ; loop through all 256 values of N2
DEY
BPL LOOP1 ; loop through both values of the carry flag
LDA #0 ; test passed, so store 0 in ERROR
STA ERROR
SIM_MSG "PASS"
BEQ DONE
ERR: SIM_MSG "FAIL"
DONE: SIM_HLT
; Calculate the actual decimal mode accumulator and flags, the accumulator
; and flag results when N1 is added to N2 using binary arithmetic, the
; predicted accumulator result, the predicted carry flag, and the predicted
; V flag
;
ADD: SED ; decimal mode
CPY #1 ; set carry if Y = 1, clear carry if Y = 0
LDA N1
ADC N2
STA DA ; actual accumulator result in decimal mode
PHP
PLA
STA DNVZC ; actual flags result in decimal mode
CLD ; binary mode
CPY #1 ; set carry if Y = 1, clear carry if Y = 0
LDA N1
ADC N2
STA HA ; accumulator result of N1+N2 using binary arithmetic
PHP
PLA
STA HNVZC ; flags result of N1+N2 using binary arithmetic
CPY #1
LDA N1L
ADC N2L
CMP #$0A
LDX #0
BCC A1
INX
ADC #5 ; add 6 (carry is set)
AND #$0F
SEC
A1: ORA N1H
;
; if N1L + N2L < $0A, then add N2 & $F0
; if N1L + N2L >= $0A, then add (N2 & $F0) + $0F + 1 (carry is set)
;
ADC N2H,X
PHP
BCS A2
CMP #$A0
BCC A3
A2: ADC #$5F ; add $60 (carry is set)
SEC
A3: STA AR ; predicted accumulator result
PHP
PLA
STA CF ; predicted carry result
PLA
;
; note that all 8 bits of the P register are stored in VF
;
STA VF ; predicted V flags
RTS
; Calculate the actual decimal mode accumulator and flags, and the
; accumulator and flag results when N2 is subtracted from N1 using binary
; arithmetic
;
SUB: SED ; decimal mode
CPY #1 ; set carry if Y = 1, clear carry if Y = 0
LDA N1
SBC N2
STA DA ; actual accumulator result in decimal mode
PHP
PLA
STA DNVZC ; actual flags result in decimal mode
CLD ; binary mode
CPY #1 ; set carry if Y = 1, clear carry if Y = 0
LDA N1
SBC N2
STA HA ; accumulator result of N1-N2 using binary arithmetic
PHP
PLA
STA HNVZC ; flags result of N1-N2 using binary arithmetic
RTS
; Calculate the predicted SBC accumulator result for the 6502 and 65816
;
SUB1: CPY #1 ; set carry if Y = 1, clear carry if Y = 0
LDA N1L
SBC N2L
LDX #0
BCS S11
INX
SBC #5 ; subtract 6 (carry is clear)
AND #$0F
CLC
S11: ORA N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
SBC N2H,X
BCS S12
SBC #$5F ; subtract $60 (carry is clear)
S12: STA AR
RTS
; Calculate the predicted SBC accumulator result for the 6502 and 65C02
;
SUB2: CPY #1 ; set carry if Y = 1, clear carry if Y = 0
LDA N1L
SBC N2L
LDX #0
BCS S21
INX
AND #$0F
CLC
S21: ORA N1H
;
; if N1L - N2L >= 0, then subtract N2 & $F0
; if N1L - N2L < 0, then subtract (N2 & $F0) + $0F + 1 (carry is clear)
;
SBC N2H,X
BCS S22
SBC #$5F ; subtract $60 (carry is clear)
S22: CPX #0
BEQ S23
SBC #6
S23: STA AR ; predicted accumulator result
RTS
; Compare accumulator actual results to predicted results
;
; Return:
; Z flag = 1 (BEQ branch) if same
; Z flag = 0 (BNE branch) if different
;
COMPARE:LDA DA
CMP AR
BNE C1
.if VALID_FLAGS_ONLY = 0
LDA DNVZC ; [7] see text
EOR NF
AND #$80 ; mask off N flag
BNE C1
LDA DNVZC ; [8] see text
EOR VF
AND #$40 ; mask off V flag
BNE C1 ; [9] see text
LDA DNVZC
EOR ZF ; mask off Z flag
AND #2
BNE C1 ; [10] see text
.endif
LDA DNVZC
EOR CF
AND #1 ; mask off C flag
C1: RTS
; These routines store the predicted values for ADC and SBC for the 6502,
; 65C02, and 65816 in AR, CF, NF, VF, and ZF
A6502: LDA VF
;
; since all 8 bits of the P register were stored in VF, bit 7 of VF contains
; the N flag for NF
;
STA NF
LDA HNVZC
STA ZF
RTS
S6502: JSR SUB1
LDA HNVZC
STA NF
STA VF
STA ZF
STA CF
RTS
A65C02: LDA AR
PHP
PLA
STA NF
STA ZF
RTS
S65C02: JSR SUB2
LDA AR
PHP
PLA
STA NF
STA ZF
LDA HNVZC
STA VF
STA CF
RTS
A65816: LDA AR
PHP
PLA
STA NF
STA ZF
RTS
S65816: JSR SUB1
LDA AR
PHP
PLA
STA NF
STA ZF
LDA HNVZC
STA VF
STA CF
RTS
.data
AR: .byte 0
CF: .byte 0 ; predicted carry result
DA: .byte 0
DNVZC: .byte 0
ERROR: .byte 0
HA: .byte 0
HNVZC: .byte 0
N1: .byte 0
N1H: .byte 0
N1L: .byte 0
N2: .byte 0
N2L: .byte 0
NF: .byte 0
VF: .byte 0
ZF: .byte 0
N2H: .word 0

View file

@ -0,0 +1,19 @@
CA65 = ca65
LD65 = ld65
ECHO = @/bin/echo
CA65_OPTS =
LD65_OPTS = --target none
all: bcd.65v
bcd.obj: bcd.asm
$(CA65) bcd.asm -I ../.. -l -o bcd.obj
bcd.bin: bcd.obj
$(LD65) $(LD65_OPTS) $+ -o $@
bcd.65v: bcd.bin
$(ECHO) -n ".0200/" > bcd.65v
hexdump -e '1/1 "%02X\n"' -v bcd.bin >> bcd.65v
$(ECHO) -n ".0200G" >> bcd.65v

View file

@ -0,0 +1,19 @@
CA65 = ca65
LD65 = ld65
ECHO = @/bin/echo
CA65_OPTS =
LD65_OPTS = --target none
all: vflag.65v
vflag.obj: vflag.asm
$(CA65) vflag.asm -I ../.. -l -o vflag.obj
vflag.bin: vflag.obj
$(LD65) $(LD65_OPTS) $+ -o $@
vflag.65v: vflag.bin
$(ECHO) -n ".0200/" > vflag.65v
hexdump -e '1/1 "%02X\n"' -v vflag.bin >> vflag.65v
$(ECHO) -n ".0200G" >> vflag.65v

View file

@ -0,0 +1,159 @@
.0200/D8
A9
01
8D
99
02
A9
80
8D
9A
02
8D
9B
02
A9
00
8D
9C
02
8D
9D
02
A0
01
20
50
02
E0
01
F0
28
20
6F
02
E0
01
F0
21
EE
9A
02
EE
9C
02
D0
EA
EE
9B
02
EE
9D
02
D0
E2
88
10
DF
A9
00
8D
99
02
02
01
50
41
53
53
00
F0
07
02
01
46
41
49
4C
00
02
00
C0
01
AD
9A
02
6D
9B
02
A2
00
50
01
E8
C0
01
AD
9C
02
6D
9D
02
B0
04
30
01
E8
60
10
01
E8
60
C0
01
AD
9A
02
ED
9B
02
A2
00
50
01
E8
C0
01
AD
9C
02
ED
9D
02
48
A9
FF
E9
00
C9
FE
D0
05
68
30
01
E8
60
68
90
FB
10
01
E8
60
00
00
00
00
00
.0200G

View file

@ -0,0 +1,124 @@
;
; The following code comes from:
;
; http://www.6502.org/tutorials/vflag.html
;
; and is built with:
;
; ca65 vflag.asm -I ../.. -l -o vflag.obj
; ld65 vflag.obj -o vflag.bin --target none
;
; An ASCII hex file which the OSI machine-language monitor can load
; is produced with the following commands:
;
; echo -n ".0200/" > vflag.txt
; hexdump -e '1/1 "%02X\n"' -v vflag.bin >> vflag.txt
; echo -n ".0200" >> vflag.txt
;
.include "sim.inc"
; Demonstrate that the V flag works as described
;
; Returns with ERROR = 0 if the test passes, ERROR = 1 if the test fails
;
; Five (additional) memory locations are used: ERROR, S1, S2, U1, and U2
; which can be located anywhere convenient in RAM
;
; The program below takes about 16 seconds to complete at 1 MHz.
;
TEST: CLD ; Clear decimal mode (just in case) for test
LDA #1
STA ERROR ; Store 1 in ERROR until test passes
LDA #$80
STA S1 ; Initalize S1 and S2 to -128 ($80)
STA S2
LDA #0
STA U1 ; Initialize U1 and U2 to 0
STA U2
LDY #1 ; Initialize Y (used to set and clear the carry flag) to 1
LOOP: JSR ADD ; Test ADC
CPX #1
BEQ ERR ; End if V and unsigned result do not agree (X = 1)
JSR SUB ; Test SBC
CPX #1
BEQ ERR ; End if V and unsigned result do not agree (X = 1)
INC S1
INC U1
BNE LOOP ; Loop until all 256 possibilities of S1 and U1 are tested
INC S2
INC U2
BNE LOOP ; Loop until all 256 possibilities of S2 and U2 are tested
DEY
BPL LOOP ; Loop until both possiblities of the carry flag are tested
LDA #0
STA ERROR ; All tests pass, so store 0 in ERROR
SIM_MSG "PASS"
BEQ DONE
ERR: SIM_MSG "FAIL"
DONE: SIM_HLT
;
; Test ADC
;
; X is initialized to 0
; X is incremented when V = 1
; X is incremented when the unsigned result predicts an overflow
; Therefore, if the V flag and the unsigned result agree, X will be
; incremented zero or two times (returning X = 0 or X = 2), and if they do
; not agree X will be incremented once (returning X = 1)
;
ADD: CPY #1 ; Set carry when Y = 1, clear carry when Y = 0
LDA S1 ; Test twos complement addition
ADC S2
LDX #0 ; Initialize X to 0
BVC ADD1
INX ; Increment X if V = 1
ADD1: CPY #1 ; Set carry when Y = 1, clear carry when Y = 0
LDA U1 ; Test unsigned addition
ADC U2
BCS ADD3 ; Carry is set if U1 + U2 >= 256
BMI ADD2 ; U1 + U2 < 256, A >= 128 if U1 + U2 >= 128
INX ; Increment X if U1 + U2 < 128
ADD2: RTS
ADD3: BPL ADD4 ; U1 + U2 >= 256, A <= 127 if U1 + U2 <= 383 ($17F)
INX ; Increment X if U1 + U2 > 383
ADD4: RTS
;
; Test SBC
;
; X is initialized to 0
; X is incremented when V = 1
; X is incremented when the unsigned result predicts an overflow
; Therefore, if the V flag and the unsigned result agree, X will be
; incremented zero or two times (returning X = 0 or X = 2), and if they do
; not agree X will be incremented once (returning X = 1)
;
SUB: CPY #1 ; Set carry when Y = 1, clear carry when Y = 0
LDA S1 ; Test twos complement subtraction
SBC S2
LDX #0 ; Initialize X to 0
BVC SUB1
INX ; Increment X if V = 1
SUB1: CPY #1 ; Set carry when Y = 1, clear carry when Y = 0
LDA U1 ; Test unsigned subtraction
SBC U2
PHA ; Save the low byte of result on the stack
LDA #$FF
SBC #$00 ; result = (65280 + U1) - U2, 65280 = $FF00
CMP #$FE
BNE SUB4 ; Branch if result >= 65280 ($FF00) or result < 65024 ($FE00)
PLA ; Get the low byte of result
BMI SUB3 ; result < 65280 ($FF00), A >= 128 if result >= 65152 ($FE80)
SUB2: INX ; Increment X if result < 65152 ($FE80)
SUB3: RTS
SUB4: PLA ; Get the low byte of result (does not affect the carry flag)
BCC SUB2 ; The carry flag is clear if result < 65024 ($FE00)
BPL SUB5 ; result >= 65280 ($FF00), A <= 127 if result <= 65407 ($FF7F)
INX ; Increment X if result > 65407 ($FF7F)
SUB5: RTS
.data
ERROR: .byte 0
S1: .byte 0
S2: .byte 0
U1: .byte 0
U2: .byte 0

View file

@ -0,0 +1,132 @@
1 REM--CHECKERS?--
2 REM-MEM.SIZE:8183-
3 T1=300:A=53448
5 FORC=1TO24:PRINT:NEXT:GOSUB10000:GOSUB20000
7 FORC=8184TO8191:READD:POKEC,D:NEXT:POKE11,248:POKE12,31
8 DATA32,0,253,141,255,31,96,0
10 FORC=A+640TOA+665:POKEC,32:NEXT:POKEA+640,63
11 M=USR(M):M=PEEK(8191)-48:IFM=9ANDG8=0THENG8=1:GOTO34
12 G8=1:IFM<1ORM>8THEN10
13 IFM=9ANDG9=1THENG9=0:GOTO34
14 IFM=9OR(M<>X1ANDG9=1)THEN10
15 POKEA+642,M+48:POKEA+643,44:X=M:M=USR(M):M=PEEK(8191)-48
16 IF(M<>Y1ANDG9=1)ORM<1ORM>8THEN10
17 POKEA+644,M+48
18 Y=M:M=USR(M):M=PEEK(8191)-48
19 IF(G9=1ANDABS(X-M)<>2)ORM<1ORM>8THEN10
20 POKEA+646,M+48:POKEA+647,44:X1=M:M=USR(M):M=PEEK(8191)-48
23 IFM<1ORM>8THEN10
25 POKEA+648,M+48:Y1=M:IFABS(X-X1)<>ABS(Y-Y1)THEN10
26 IFABS(X-X1)>2ORX>8ORY>8ORX1>8ORY1>8THEN10
27 IFP(X,Y)<1ORP(X1,Y1)<>0THEN10
28 IFP(X,Y)=1ANDY1<YTHEN10
29 IFABS(X-X1)=2ANDP((X+X1)/2,(Y+Y1)/2)>-1THEN10
30 P(X1,Y1)=P(X,Y):P(X,Y)=0:IFABS(X-X1)=2THENP((X+X1)/2,(Y+Y1)/2)=0
31 IFY1=8THENP(X1,Y1)=2
32 IFABS(X-X1)=2THENGOSUB20000:G9=1:GOTO10
33 GOSUB20000
34 FORC=A+640TOA+665:POKEC,32:NEXT
35 REM-MAIN PROGRAM-
230 G=-1:R=-99:FORY=1TO8:FORX=1TO8
231 IFP(X,Y)>-1THEN350
300 W=8:M=P(X,Y)
310 IFM=-1THENFORA1=-1TO1STEP2:B1=G:GOSUB650:NEXTA1
330 IFM=-2THENFORA1=-1TO1STEP2:FORB1=1TO-1STEP-2:GOSUB650:NEXTB1,A1
350 L6=0:L7=0:L8=0:L9=0:NEXTX,Y:GOTO1140
650 U=X+A1:V=Y+B1:IFU<1ORU>8ORV<1ORV>8THEN870
660 FORC1=-1TO1STEP2:FORD1=-1TO1STEP2
670 IFX+C1<1ORX+C1>8ORY+D1<1ORY+D1>8THEN700
673 IFX+C1*2<1ORX+C1*2>8ORY+D1*2<1ORY+D1*2>8THEN700
675 IFP(X+C1,Y+D1)>-1THEN700
680 IFP(X+C1*2,Y+D1*2)<>2ANDY+D1>YTHEN700
682 IFX-C1<1ORX-C1>8ORY-D1<1ORY-D1>8THEN685
683 IFP(X+C1,Y+D1)>0ANDP(X-C1,Y-D1)=0THENL9=1
685 IFP(X+C1*2,Y+D1*2)<1THEN700
690 Q=Q-4:GOTO740
700 NEXTD1,C1
740 IFP(U,V)=0THENGOSUB910:GOTO870
770 IFP(U,V)<0THEN870
790 U=U+A1:V=V+B1:IFU<1ORV<1ORU>8ORV>8THEN870
850 IFP(U,V)=0THENGOSUB910
870 RETURN
910 REM
920 IFABS(Y-V)=2THENQ=Q+4
930 IFL8=0ANDP(X,Y)=-1THENQ=Q+(2-Y/2)
1000 IFP(X,Y)=-2THENQ=Q-1
1030 IFP(X,Y)=-1THENFORC1=-1TO1STEP2:FORD1=-1TO-1:GOTO1033
1031 IFP(X,Y)=-2THENFORC1=-1TO1STEP2:FORD1=-1TO1STEP2:GOTO1033
1032 GOTO1081
1033 IFU+C1<1ORU+C1>8ORV+D1<1ORV+D1>8THEN1080
1034 IFU+C1*2<1ORU+C1*2>8ORV+D1*2<1ORV+D1*2>8THEN1040
1035 IFP(U+C1,V+D1)<0ANDP(U+C1*2,V+D1*2)>0THENQ=Q+4
1036 IFU-C1<1ORU-C1>8ORV-D1<1ORV-D1>8THEN1080
1037 IFP(U+C1,V+D1)>0ANDP(U-C1,V-D1)<>0ANDP(U+C1*2,V+D1*2)=0THENQ=Q+2
1040 IFU-C1<1ORU-C1>8ORV-D1<1ORV-D1>8THEN1080
1042 IFV+D1>VANDP(U+C1,V+D1)<2THEN1050
1045 IFP(U+C1,V+D1)>0AND(P(U-C1,V-D1)=0OR(X=U-C1ANDY=V-D1))THEN5000
1047 IFL9=1THENQ=Q+1:L7=1
1050 IFP(U+C1,V+D1)<>0ANDP(U-C1,V-D1)<>0ANDY<>8ANDP(X,Y)=-1THENQ=Q+1
1080 NEXTD1,C1
1081 IFL6=0THENQ=Q+4
1082 IFQ>RTHENR=Q:R1=X:R2=Y:R3=U:R4=V
1090 IFQ=RANDINT(RND(X)*10)+1<4THENR1=X:R2=Y:R3=U:R4=V
1100 Q=0:RETURN
1140 IFR=-99THEN1880
1230 R=-99:GOSUB2000
1240 IFR4=1THENP(R3,R4)=-2:GOTO1310
1250 P(R3,R4)=P(R1,R2)
1310 P(R1,R2)=0:IFABS(R1-R3)<>2THEN1420
1330 P((R1+R3)/2,(R2+R4)/2)=0
1340 X=R3:Y=R4:IFP(X,Y)=-1THENB1=-2:FORA1=-2TO2STEP4:GOSUB1370
1350 IFP(X,Y)=-2THENFORA1=-2TO2STEP4:FORB1=-2TO2STEP4:GOSUB1370:NEXTB1
1360 NEXTA1:IFR<>-99THENR=-99:GOTO1240
1365 GOTO1420
1370 U=X+A1:V=Y+B1:IFU<1ORU>8ORV<1ORV>8THEN1400
1380 IFP(U,V)=0ANDP(X+A1/2,Y+B1/2)>0THENGOSUB910
1400 RETURN
1420 FORT=1TO1400:NEXT:GOSUB20000:GOTO10
1880 PRINT:PRINT" I CONCEDE...":END
2000 REM-COMMENTS-
2010 POKEA+640,73:POKEA+642,65:POKEA+643,77
2015 IFABS(R1-R3)=2THEN2050
2017 POKEA+645,77:POKEA+646,79
2020 POKEA+647,86:POKEA+648,73:POKEA+649,78:POKEA+650,71:POKEA+651,46
2030 POKEA+652,46:POKEA+653,46:RETURN
2050 POKEA+645,74:POKEA+646,85:POKEA+647,77:POKEA+648,80:POKEA+649,73
2060 POKEA+650,78:POKEA+651,71:POKEA+652,46:POKEA+653,46:POKEA+654,46
2070 RETURN
4000 POKEB1,187:POKEB1+1,187:POKEB1+32,187:POKEB1+33,187:RETURN
5000 Q=Q-4:IFP(X,Y)=-2THENQ=Q-2
5002 L6=1
5003 IF(ABS(Y-V)=2ORABS(X-U)=2)ANDRND(X)*100<40THENQ=Q-1
5004 IFL9=1ANDL7=1THENQ=Q-1:L7=0
5005 GOTO1080
9999 END
10000 REM-CHESSBOARD-
10005 FORB=ATOA+15:POKEB,154:POKEB+544,155:NEXT
10010 FORB=B+32TOA+544STEP32:POKEB,156:POKEB-17,157:NEXT
10015 POKEA-1,165:POKEA+16,167:POKEA+560,168:POKEA+543,166
10017 GOTO10047:REM-THIS FOR ALTERNATE BOARD-
10020 FORB=A+33TOA+45STEP2:POKEB,143:POKEB+481,136:NEXT
10025 FORB=B+64TOA+512STEP64:POKEB,135:POKEB-47,128:NEXT
10040 FORB=A+66TOA+452STEP64:FORB1=BTOB+12STEP2:POKEB1,209:NEXTB1,B
10045 FORB=A+97TOA+481STEP64:FORB1=BTOB+12STEP2:POKEB1,207:NEXTB1,B
10047 REM-CHEC. INIT.--
10050 DIMP(8,8):FORX=1TO8:FORY=1TO3:IF(X+Y)/2=INT((X+Y)/2)THENP(X,Y)=1
10055 IF(X+Y+5)/2=INT((X+Y+5)/2)THENP(X,Y+5)=-1
10060 NEXTY,X:P(1,7)=-1
10065 X=57:FORB=A+62TOA+510STEP64:X=X-1:POKEB,X:NEXT
10070 FORB=A+576TOA+590STEP2:POKEB,X:X=X+1:NEXT
10075 RETURN
20000 REM--PIECES--
20005 Y=9:FORB=A+32TOA+480STEP64:X=0:Y=Y-1:FORB1=BTOB+14STEP2:X=X+1
20010 E3=168:M=P(X,Y):T=(X+Y)/2:IFM<0THENPOKEB1,88
20011 REM INSTRUCTIONS INVOLVING "T" ACCOUNT FOR FILLED BLOCKS
20012 IFT<>INT(T)THENGOSUB4000
20015 IFM>0THENPOKEB1,79
20017 IFT=INT(T)THENPOKEB1+1,32:POKEB1+32,32
20020 IFABS(M)=2THENE3=107
20040 IFM=0ANDT=INT(T)THENPOKEB1,32:POKEB1+33,32:GOTO20100
20050 IFT<>INT(T)THEN20100
20099 POKEB1+33,E3
20100 NEXTB1,B:RETURN

View file

@ -0,0 +1,177 @@
1 DEFFNQ(X)=INT(RND(RS)*X)+1
2 REM
3 REM * HANGWOMAN *
4 REM
10 DEFFNQ(X)=INT(RND(RS)*X)+1
11 C=53446:Y=0:RS=PEEK(8191)
12 POKE11,0:POKE12,253
18 PRINT:PRINTTAB(6);"HANGWOMAN":FORM=1TO22:PRINT:NEXT
20 GOSUB800:C=C-32
25 A$="USED LETTERS:":P=C+103:GOSUB850
28 A$="AND THE WORD:":P=C+551:GOSUB850
30 GOSUB900:A$="":FORM=1TOLEN(B$):A$=A$+CHR$(95):NEXTM:L=1:R=C+167
31 K=1:S=1
35 REM*BEGIN QUEST*
39 P=C+616:GOSUB850
40 IFY=0THENX=4:GOTO42
41 X=FNQ(10):IFX<4THENC$="GIVE ME A LETTER: "
42 IFX=4ORX=5ORX=6THENC$="WHAT DO YOU THINK? "
43 IFX>6ANDY=1THENC$="TRY ANOTHER LETTER: "
45 GOSUB890:Y=1
46 X=USR(X):A=PEEK(531):IFA<65ORA>90THEN46
50 PRINTCHR$(A);
51 RS=RS+A/K
52 FORT=1TO1500:NEXTT
55 FORN=1TOLEN(B$):IFCHR$(A)=MID$(B$,N,1)THEN75
58 NEXTN
61 X=FNQ(10):IFX<4THENC$="I DON'T THINK SO..."
62 IFX=4ORX=5ORX=6THENC$="WELL, ALMOST..."
63 IFX>6THENC$="NOBODY'S PERFECT..."
64 GOSUB875
65 ONKGOSUB200,280,210,220,230,260,240,250,320,340
70 K=K+1:GOTO85
75 REM*MATCH*
76 FORM=1TOLEN(A$):IFCHR$(A)<>MID$(A$,M,1)THEN78
77 C$="YOU DID THAT, DUMMY!":GOTO64
78 NEXTM
79 GOSUB190
80 FORM=NTOLEN(B$)
81 IFMID$(B$,M,1)=CHR$(A)THENA$=MID$(A$,1,M-1)+CHR$(A)+MID$(A$,M+1)
82 NEXTM
85 REM*SHOW LETTER*
90 POKER+1,A:R=R+2:S=S+1:IFS>5THENS=1:R=R+54
92 L=L+1:IFL>26ORK>10THEN150
94 FORM=1TOLEN(A$):IFMID$(A$,M,1)=CHR$(95)THEN35
96 NEXTM
100 REM*WON GAME*
105 P=C+616:GOSUB850
108 IFW=0THENC$="YOU ACTUALLY WON!"
110 IFW=1THENC$="YOU'RE IMPROVING..."
112 IFW=2THENC$="WHAT CAN I SAY?"
114 IFW=3THENC$="IT WAS EASY ANYWAY..."
116 IFW>3THENC$="YOU'RE TOO GOOD"
118 W=W+1:GOSUB875
119 GOSUB600
120 IFFNQ(10)>5THENC$="WANT TO TRY AGAIN? ":GOTO125
122 C$="HOW ABOUT ANOTHER? "
125 GOSUB875:X=USR(X):A=PEEK(531):IFCHR$(A)="Y"THENPRINT:GOTO10
130 GOTO189
150 REM*LOST GAME*
155 P=C+616:A$=B$:GOSUB850
160 IFV=0THENC$="I KNEW YOU'D SLIP!"
162 IFV=1THENC$="THAT WAS PRETTY SAD"
163 IFV=2THENC$="BOY, YOU NEED HELP..."
165 IFV>2THENC$="GO SIT ON A BOOGERPOT"
170 V=V+1:GOSUB875:GOSUB625:GOTO120
189 END
190 IFFNQ(10)<7THEN196
191 IFFNQ(10)>5 THEN194
192 C$="WELL, ALMOST...":GOSUB875:C$=" IS GOOD ENOUGH!!":GOSUB875
193 GOTO199
194 C$="I DON'T THINK SO...":GOSUB875:C$="I CHANGED MY MIND!!!"
195 GOSUB875:GOTO199
196 C$="WOW! YOU FOUND ONE!":GOSUB875
199 RETURN
200 REM*HEAD*
202 POKEC+67,150:POKEC+68,150:POKEC+98,201:POKEC+101,200
204 POKEC+130,140:POKEC+133,139:POKEC+162,199:POKEC+165,202
206 POKEC+195,135:POKEC+196,135
207 IFFNQ(10)>5THENC$="THERE'S THE HEAD.":GOSUB875:GOTO209
208 C$="OOPS, SHE'S GOT HEAD!":GOSUB875
209 RETURN
210 REM*NECK*
212 POKEC+195,210:POKEC+196,207:POKEC+227,190:POKEC+228,189
215 C$="OH MY...A NECK.":GOSUB875
219 RETURN
220 REM*R.ARM*
222 POKEC+226,189:FORM=C+257TOC+353STEP32:POKEM,143:NEXTM
224 POKEC+354,208:POKEC+322,143:POKEC+290,143
225 C$="LOOKS LIKE A BONY ARM":GOSUB875
229 RETURN
230 REM*L.ARM*
232 POKEC+229,190:FORM=C+262TOC+358STEP32:POKEM,136:NEXTM
234 POKEC+357,209:POKEC+325,136:POKEC+293,136
235 C$="ANOTHER BONY ARM!":GOSUB875
239 RETURN
240 REM*R.LEG*
242 POKEC+387,136:FORM=C+418TOC+514STEP32:POKEM,143:NEXTM
244 POKEC+515,208:POKEC+483,143:POKEC+451,143:POKEC+419,143
245 C$="OH, A LOVELY LEG!":GOSUB875
249 RETURN
250 REM*L.LEG*
252 POKEC+388,143:FORM=C+421TOC+517STEP32:POKEM,136:NEXTM
254 POKEC+516,128
255 C$="ANOTHER PEACHY LEG...":GOSUB875
259 RETURN
260 REM*R.HAND*
265 POKEC+386,89
270 REM*L.HAND*
275 POKEC+389,89
276 C$="DISHPAN HANDS....":GOSUB875
279 RETURN
280 REM*FACE*
285 POKEC+99,111:POKEC+100,111
305 POKEC+131,220:POKEC+132,223:POKEC+163,135:POKEC+164,135
308 C$="A LEWD EXPRESSION.":GOSUB875
309 RETURN
320 REM*R.FOOT*
325 POKEC+547,140:POKEC+579,172
330 REM*L.FOOT*
335 POKEC+548,139:POKEC+580,172
336 C$="WHAT GOES TIPTOE?":GOSUB875
339 RETURN
340 REM*CLOTHES*
342 FORM=C+260TOC+356STEP32:POKEM,136:NEXTM
344 POKEC+387,210:POKEC+388,207:POKEC+259,95
346 C$="NOW SHE'S DRESSED!":GOSUB875
349 RETURN
600 REM*LAUGH*
601 IFK>11THEN625
605 FORM=1TO50
606 POKEC+163,197:POKEC+164,195
607 FORT=1TO50:NEXTT
609 POKEC+163,135:POKEC+164,135
611 FORT=1TO50:NEXTT
615 NEXTM
620 RETURN
625 REM*KICK*
627 FORM=1TO50
630 POKEC+547,202:POKEC+548,199:POKEC+578,166:POKEC+581,168
633 POKEC+579,32:POKEC+580,32
635 FORT=1TO75:NEXTT
638 POKEC+547,140:POKEC+548,139:POKEC+578,32:POKEC+581,32
640 POKEC+579,172:POKEC+580,172
645 FORT=1TO75:NEXTT
650 NEXTM:RETURN
800 REM*MAKE GALLOW*
803 FORM=C+1TOC+4:POKEM,135:NEXTM:POKEC,210:POKEC+5,136:POKEC+37,136
806 FORM=C+32TOC+17*32STEP32:POKEM,136:NEXTM:POKEM,209:POKEM-1,128
809 FORN=M+1TOM+5:POKEN,128:NEXTN
820 RETURN
850 REM*POKE WORD*
855 FORM=1TOLEN(A$):POKEP,ASC(MID$(A$,M,1)):P=P+1:NEXTM
859 RETURN
875 REM*DISP.MESG*
885 PRINTCHR$(13);" ";CHR$(13);C$;
886 FORT=1TO1500:NEXTT
889 RETURN
890 PRINTCHR$(13);" ";CHR$(13);C$;
899 RETURN
900 REM*GET WORD*
905 T=FNQ(100)
910 FORT1=1TOT:READB$:IFB$="*"THENRESTORE:READB$
915 NEXTT1
930 A$="":FORT=1TOLEN(B$):T1=ASC(MID$(B$,T,1))
935 IFT1=65THENT1=91
940 A$=A$+CHR$(T1-1):NEXTT
950 B$=A$:RETURN
960 REM*TEST*
965 T=1:GOSUB910:PRINTB$:GOTO965
1000 DATAIFMMP,RVJFU,EPPSLOPC,IVSSZ,BDJE,VOEFSXFBS,LJUDIFO,XBZ
1010 DATAMJTUFO,SBDJOH,ZPVST,HPBU,CPPHFS,GJSTU,PQFSBUJPO,VUFOTJM
1020 DATAIBQQZ,TLJQQFS,TXJUDI,VQQFS,BSNPS,KPZ,AJQQFS,XFSF,HFUUJOH
1030 DATAQBOEB,BGSBJE,UPVDIZ,SJTL,DFOUT,QMFBTF,CVZ
1040 DATAFOWFMPQF,SIZUIN,MJQTUJDL,PWFS,PCTBDMF,CVMC,CVSOFE,UIJT
1045 DATAGSPN,OJCCMF,TUJOH,SPMMFS,RVJDLTBOE,TIFQIFSE,GSPNKFGG
1050 DATADBOEMF,TQJEFS,DFSFBM,HPJOH,XIJTLFS,QPUUZ,XIFUIFS,VODMF,IPQF
1060 DATA*

143
apps/c1p/BASIC/JP/LIFE.BAS Normal file
View file

@ -0,0 +1,143 @@
1 REM-GRAPHICS WITH-
2 REM-GEOMETRY/LIFE-
3 REM--USER ROUTINE-
4 REM--MEM.SIZE:8167
5 RESTORE:B=8192:POKE11,232:POKE12,31:FORC=1TO24:PRINT:NEXT
6 FORA=B-24TOB-1:READD:POKEA,D:NEXT
7 DATA169,32,160,8,162,0,157,0,208,232,208
8 DATA250,238,240,31,136,208,244,169,208,141,240,31,96
10 REM-MAIN PROGRAM-
12 DIMY(21,21),U(20)
13 GOSUB800
15 POKE8169,32:X=USR(X):AA=54023:G=1:Z=-1
20 FORA=0TO18:POKEAA+A,128:POKEAA+19-A*32,136
25 POKEAA-590-A,128:POKEAA-576+A*32,136
30 NEXTA:POKEAA,209
35 FORB=0TO9:FORA=0TO18:POKEAA-558-A+B*32,209
40 IFB<9ANDA>0THENPOKEAA+A-(B+1)*32,128
43 IFA=0THENPOKEAA-(B+1)*32,209
45 IFA<18THENPOKEAA+A+1-B*32,209
50 NEXTA,B
55 B=64:A=AA+31:FORC=1TO19:POKEA+C,B+C:POKEA-C*32,B+C:NEXT
60 MA=1:NA=1:MI=21:NI=21:REM--GRAPHING--
65 POKEAA+102,123:POKEAA+104,44:POKEAA+106,124
70 POKEAA+103,95:POKEAA+105,95:GOSUB1000:A=C:IFC<0THEN85
73 POKEAA+103,96+C
75 GOSUB1000:B=C:IFC<0THEN85
77 POKEAA+105,96+C:FORT=1TO75:NEXT:POKEAA+A-1-(B-1)*32,161
80 A=A+1:B=B+1:Y(A,B)=1:FORT=1TO250:NEXT:GOSUB400:GOTO70
85 FORC=1TO24:PRINT:NEXT:FORT=1TO1000:NEXT:POKE8169,46:X=USR(X)
87 AA=AA+31:GOSUB300:GOSUB200
90 FORB=1TO21:FORA=1TO21:IFY(A,B)=0THEN100
95 POKEAA+A-1-(B-1)*32,240:P=P+1
100 NEXTA,B:IFP=0THEN15
110 POKEAA+65,91:POKEAA+66,71:POKEAA+67,69:POKEAA+68,78:POKEAA+69,61
112 POKEAA+73,32:POKEAA+74,32
115 POKEAA+75,80:POKEAA+76,79:POKEAA+77,80:POKEAA+78,61:POKEAA+82,93
117 C=3:G$=STR$(G)
120 POKEAA+69+C,ASC(RIGHT$(G$,4-C)):C=C-1:IFC>0THEN120
125 GOSUB605
135 REM-LIFE/DEATH-
140 K=0:FORB=MITOMA:FORA=NITONA
143 R=PEEK(AA+A-1-(B-1)*32):P1=P:POKEAA+A-1-(B-1)*32,171
145 IFY(A,B)<>0THEN155
150 GOSUB500:IFX=B1THENY(A,B)=-1:POKEAA+A-1-(B-1)*32,240:P=P+1:K=1
153 GOTO160
155 GOSUB500:IFX<L1ORX>L2THENY(A,B)=2:POKEAA+A-1-(B-1)*32,46:P=P-1:K=1
157 IFX1>0THENPOKEAA+82,43:POKEAA+83,93
160 IFP<>P1THEN180
170 POKEAA+A-1-(B-1)*32,R
180 GOSUB605:NEXTA,B
181 IFK=0THENGOSUB1000:GOTO15
182 MA=1:NA=1:MI=21:NI=21
183 FORA=1TO21:FORB=1TO21:IFY(A,B)=2THENY(A,B)=0
185 IFY(A,B)=0THEN192
187 IFY(A,B)=-1THENY(A,B)=1
190 GOSUB400
192 NEXTB,A
193 IFP=0THENGOSUB1000:GOTO15
194 K=0:GOSUB300:IFK=0THEN199
195 GOSUB200:FORD=21TO1STEP-1:FORC=1TO21
196 IFY(C,D)=0THENPOKEAA+C-1-(D-1)*32,46:GOTO198
197 POKEAA+C-1-(D-1)*32,240
198 NEXTC,D:GOSUB250
199 G=G+1:GOTO117
200 FORC=1TO19:U(C)=PEEK(AA+64+C):NEXT
205 RESTORE:FORC=1TO100:READD:IFD>=0THENNEXT
210 FORC=1TO19:READD:POKEAA+64+C,D:NEXT
220 RETURN
230 DATA-1,32,32,32,82,69,45,67,69,78,84,69,82,73,78,71,32,32,32,32
250 FORC=1TO19:POKEAA+64+C,U(C):NEXT:RETURN
300 L=INT(((21-MA)-(MI-1))/2+.5)
301 IFL=0THEN350
305 K=1:IFL>0THEN330
310 FORD=1-LTO21:FORC=1TO21:Y(C,D+L)=Y(C,D)
315 Y(C,D)=0
320 NEXTC,D:MA=MA+L:MI=MI+L:GOTO350
330 FORD=21-LTO1STEP-1:FORC=1TO21
340 Y(C,D+L)=Y(C,D):Y(C,D)=0:NEXTC,D
345 MA=MA+L:MI=MI+L
350 L=INT(((21-NA)-(NI-1))/2)
351 IFL=0THENRETURN
355 K=1:IFL>0THEN375
360 FORC=1-LTO21:FORD=1TO21
365 Y(C+L,D)=Y(C,D):Y(C,D)=0:NEXTD,C
370 NA=NA+L:NI=NI+L:RETURN
375 FORC=21-LTO1STEP-1:FORD=1TO21
380 Y(C+L,D)=Y(C,D):Y(C,D)=0:NEXTD,C
385 NA=NA+L:NI=NI+L:RETURN
400 IFB<=MITHENMI=B-1
410 IFB>=MATHENMA=B+1
420 IFA<=NITHENNI=A-1
430 IFA>=NATHENNA=A+1
445 IFMA>21THENMA=21
450 IFMI<1THENMI=1
465 IFNA>21THENNA=21
470 IFNI<1THENNI=1
480 RETURN
500 X=0:X1=0
505 FORC=C1*-1TOC1STEPC1:FORD=C1*-1TOC1STEPC1
507 IFA+C<1ORA+C>21ORB+D<1ORB+D>21THENX1=1:GOTO525
510 IFY(A+C,B+D)<1OR(C=0ANDD=0)THEN525
515 X=X+1
525 NEXTD,C
530 RETURN
600 Z=Z*-1
605 G$=STR$(P):C=3
606 IFZ>0THEN615
610 POKEAA+78+C,ASC(RIGHT$(G$,4-C)):C=C-1:IFC>0THEN610
612 GOTO620
615 POKEAA+79,32:POKEAA+80,32:POKEAA+81,32
620 RETURN
800 PRINT" WHAT ARE THE LOWER/":PRINT:PRINT" UPPER SURVIVAL LIMITS.."
805 INPUTL1,L2:PRINT
810 PRINT" INPUT BIRTH FACTOR";:INPUTB1
820 PRINT:PRINT" INPUT CELL DISTANCE";:INPUTC1
825 FORC=1TO24:PRINT:NEXT:RETURN
1000 REM--SCAN--
1005 C=0:K=57088:POKE530,1
1007 FORT=1TO150:NEXT
1010 POKEK,223:IFPEEK(K)=191THENC=12
1015 IFPEEK(K)=223THENC=15
1017 IFPEEK(K)=247THENC=-1
1020 POKEK,239:IFPEEK(K)=191THENC=5
1025 IFPEEK(K)=223THENC=18
1030 IFPEEK(K)=253THENC=9
1035 POKEK,247:IFPEEK(K)=191THENC=4
1037 IFPEEK(K)=127THENC=19
1040 IFPEEK(K)=223THENC=6
1045 IFPEEK(K)=239THENC=7
1050 IFPEEK(K)=247THENC=8
1055 IFPEEK(K)=251THENC=10
1060 IFPEEK(K)=253THENC=11
1065 POKEK,251:IFPEEK(K)=191THENC=3
1070 IFPEEK(K)=239THENC=2
1075 IFPEEK(K)=247THENC=14
1080 IFPEEK(K)=251THENC=13
1085 POKEK,253:IFPEEK(K)=127THENC=17
1090 IFPEEK(K)=191THENC=1
1093 IFPEEK(K)=223THENC=20
1095 IFPEEK(K)=253THENC=16
1100 IFC=0THEN1010
1105 IFC=20THENY(A,B)=0:POKEAA+A-2-(B-2)*32,209:C=0:GOTO1010
1110 POKE530,0:RETURN

View file

@ -0,0 +1,212 @@
10 REM - OTHELLO -
15 REM
20 A=53184:CO=79:CX=88
21 POKE11,0:POKE12,253
25 PL=1
30 GOSUB9000
40 DIMB(8,8)
50 B(4,5)=1:B(5,5)=2:B(4,4)=2:B(5,4)=1
60 GOSUB8000
70 GOSUB7000
80 GOSUB6000
90 GOSUB5000
100 GOSUB4000
110 GOTO60
999 END
4000 REM - MAKE MOVE IN TABLE -
4010 IFUP=0ANDDN=0ANDLF=0ANDRT=0ANDUL=0ANDUR=0ANDLL=0ANDLR=0THEN4990
4020 B(C,R)=PL
4030 IFUP=0THEN4100
4040 FORZ=1TOUP
4050 B(C,R+Z)=PL
4060 NEXT
4100 IFDN=0THEN4200
4110 FORZ=1TODN
4120 B(C,R-Z)=PL
4130 NEXT
4200 IFLF=0THEN4300
4210 FORZ=1TOLF
4220 B(C-Z,R)=PL
4230 NEXT
4300 IFRT=0THEN4400
4310 FORZ=1TORT
4320 B(C+Z,R)=PL
4330 NEXT
4400 IFUL=0THEN4500
4410 FORZ=1TOUL
4420 B(C-Z,R+Z)=PL
4430 NEXT
4500 IFUR=0THEN4600
4510 FORZ=1TOUR
4520 B(C+Z,R+Z)=PL
4530 NEXT
4600 IFLL=0THEN4700
4610 FORZ=1TOLL
4620 B(C-Z,R-Z)=PL
4630 NEXT
4700 IFLR=0THEN4900
4710 FORZ=1TOLR
4720 B(C+Z,R-Z)=PL
4730 NEXT
4900 PL=3-PL
4990 RETURN
5000 REM - LEGAL MOVE? -
5010 UP=0:DN=0:LF=0:RT=0:UL=0:UR=0:LL=0:LR=0
5020 IFB(C,R)<>0THENGOTO5990
5030 FORTR=R-1TO1STEP-1
5040 IFTR<1THENDN=0:GOTO5100
5045 IFB(C,TR)=0THENDN=0:GOTO5100
5050 IFB(C,TR)=3-PLANDTR>1THENDN=DN+1
5060 IFB(C,TR)=PLTHENGOTO5100
5070 NEXT
5080 DN=0
5100 FORTR=R+1TO8
5110 IFTR>8THENUP=0:GOTO5200
5115 IFB(C,TR)=0THENUP=0:GOTO5200
5120 IFB(C,TR)=(3-PL)ANDTR<8THENUP=UP+1
5130 IFB(C,TR)=PLTHENGOTO5200
5140 NEXT
5150 UP=0
5200 FORTC=C-1TO1STEP-1
5210 IFTC<1THENLF=0:GOTO5300
5215 IFB(TC,R)=0THENLF=0:GOTO5300
5220 IFB(TC,R)=(3-PL)ANDTC>1THENLF=LF+1
5230 IFB(TC,R)=PLTHENGOTO5300
5240 NEXT
5250 LF=0
5300 FORTC=C+1TO8
5310 IFTC>8THENRT=0:GOTO5400
5315 IFB(TC,R)=0THENRT=0:GOTO5400
5320 IFB(TC,R)=(3-PL)ANDTC<8THENRT=RT+1
5330 IFB(TC,R)=PLTHENGOTO5400
5340 NEXT
5350 RT=0
5400 TC=C-1
5410 FORTR=R+1TO8
5420 IFTR>8ORTC<1THENUL=0:GOTO5500
5425 IFB(TC,TR)=0THENUL=0:GOTO5500
5430 IFB(TC,TR)=(3-PL)ANDTR<8ANDTC>1THENUL=UL+1
5440 IFB(TC,TR)=PLTHENGOTO5500
5450 TC=TC-1
5460 NEXT
5470 UL=0
5500 TC=C+1
5510 FORTR=R+1TO8
5520 IFTR>8ORTC>8THENUR=0:GOTO5600
5525 IFB(TC,TR)=0THENUR=0:GOTO5600
5530 IFB(TC,TR)=(3-PL)ANDTR<8ANDTC<8THENUR=UR+1
5540 IFB(TC,TR)=PLTHENGOTO5600
5550 TC=TC+1
5560 NEXT
5570 UR=0
5600 TC=C-1
5610 FORTR=R-1TO1STEP-1
5620 IFTR<1ORTC<1THENLL=0:GOTO5700
5625 IFB(TC,TR)=0THENLL=0:GOTO5700
5630 IFB(TC,TR)=(3-PL)ANDTR>1ANDTC>1THENLL=LL+1
5640 IFB(TC,TR)=PLTHENGOTO5700
5650 TC=TC-1
5660 NEXT
5670 LL=0
5700 TC=C+1
5710 FORTR=R-1TO1STEP-1
5720 IFTR<1ORTC>8THENLR=0:GOTO5990
5725 IFB(TC,TR)=0THENLR=0:GOTO5990
5730 IFB(TC,TR)=(3-PL)ANDTR>1ANDTC<8THENLR=LR+1
5740 IFB(TC,TR)=PLTHENGOTO5990
5750 TC=TC+1
5760 NEXT
5770 LR=0
5990 RETURN
6000 REM - CHECK INPUT -
6010 REM - AND SET UP -
6020 REM - R (ROW) AND -
6030 REM - C (COLUMN) -
6040 IFLEN(I$)<>2THENGOSUB7000:GOTO6040
6050 C1=ASC(LEFT$(I$,1)):C2=ASC(RIGHT$(I$,1))
6060 IF(C1>=65)AND(C1<=72)THENR=C1:GOTO6080
6070 IF(C2>=65)AND(C2<=72)THENR=C2:GOTO6090
6075 GOSUB7000:GOTO6040
6080 IF(C2<49)OR(C2>56)THENGOSUB7000:GOTO6040
6085 C=C2:GOTO6100
6090 IF(C1<49)OR(C1>56)THENGOSUB7000:GOTO6040
6095 C=C1
6100 C=C-48:R=R-64
6990 RETURN
7000 REM - INPUT MOVE -
7001 POKE(A+256+20*32+18),(PL+48)
7005 I$="":T2=A+256+21*32+7
7006 FORX=1TO20:POKE(T2+X),32:NEXT
7009 POKET2,63:T2=T2+1:POKET2,161
7010 T1=USR(T1):T1=PEEK(531)
7011 IFT1=13THEN7030
7012 IFT1<>127THEN7019
7013 IFI$=""THEN7010
7015 POKET2,32:T2=T2-1:POKET2,161
7017 IFLEN(I$)=1THENI$="":GOTO7010
7018 I$=LEFT$(I$,LEN(I$)-1):GOTO7010
7019 I$=I$+CHR$(T1)
7020 POKET2,T1:T2=T2+1:POKET2,161
7023 IFLEN(I$)>10THENGOTO7000
7025 GOTO7010
7030 FORY=1TO8
7990 RETURN
8000 REM - MAKE MOVE -
8010 S=A+8*32+7
8020 FORX=1TO8
8030 FORY=1TO8
8040 P=S+2*X+2*32*(8-Y)
8050 IFB(X,Y)=1THENPOKEP,CX
8060 IFB(X,Y)=2THENPOKEP,CO
8080 NEXTY,X
8990 RETURN
9000 REM - FRAME -
9010 T1=A+256
9020 FORY=1TO24
9030 PRINT
9040 NEXT
9050 FORX=1TO16
9060 POKE(A+224+X+7),128
9070 NEXT
9080 FORY=1TO16STEP2
9090 FORX=1TO8
9100 T2=2*(X-1)
9110 POKE(T1+(Y-1)*32+8+T2),136
9120 POKE(T1+Y*32+8+T2),209
9130 POKE(T1+Y*32+9+T2),128
9140 NEXTX
9150 POKE(T1+(Y-1)*32+8+2*(X-1)),136
9160 POKE(T1+Y*32+8+2*(X-1)),136
9170 NEXTY
9180 T3=T1+6
9190 T4=T3+577
9200 FORZ=1TO8
9210 POKE(T3+2*(8-Z)*32),((Z-1)+65)
9220 POKE(T4+2*Z),((Z-1)+49)
9230 NEXT
9240 T2=A+903
9250 POKET2,ASC("P"):T2=T2+1
9260 POKET2,ASC("L"):T2=T2+1
9270 POKET2,ASC("A"):T2=T2+1
9280 POKET2,ASC("Y"):T2=T2+1
9290 POKET2,ASC("E"):T2=T2+1
9300 POKET2,ASC("R"):T2=T2+1
9310 T2=T2+1
9320 POKET2,ASC("N"):T2=T2+1
9330 POKET2,ASC("O"):T2=T2+1
9340 POKET2,ASC("."):T2=T2+3
9350 POKET2,ASC(":"):T2=T2+1
9990 RETURN
10000 REM - FUN -
10005 A=53248
10010 FORX=1TO24:PRINT:NEXT:T1=A+263
10020 FORX=1TO16
10025 FORY=1TO8
10026 POKET1+(X-2)*32,32
10035 NEXTY,X
10040 FORX=16TO1STEP-1
10045 FORY=8TO1STEP-1
10046 POKET1+X*32,32
10050 POKET1+(X-1)*32,(9-Y)+127
10055 NEXTY,X
10060 GOTO10020

View file

@ -0,0 +1,60 @@
5 FORC=1TO24:PRINT:NEXT
10 PRINT" ENTER NO. OF TYPES":PRINT:PRINT" OF DATA PER YEAR";:INPUTN
20 PRINT:PRINT" INPUT NAME FOR:":PRINT
25 FORC=1TON:PRINT" TYPE";C;:INPUTB$(C):NEXTC
30 PRINT
99 X=1:DIMA(4,4,12),P(4,12),S(4)
100 PRINT" WHAT IS THE YEAR OF":PRINT:PRINT" DATA-BASE";X;
105 INPUTY(X):IFY(X)=0THEN150
110 FORT=1TON:PRINT
111 PRINT" ";B$(T);"'S";:INPUTA$:FORM=1TO11:FORC=1TO255
120 IFC=LEN(A$)THENPRINT:PRINT" DATA ERROR":PRINT:GOTO111
125 IFMID$(A$,C,1)=";"ORMID$(A$,C,1)="/"THEN131
130 NEXTC
131 REM-SIFTING DATA-
135 A(X,T,M)=VAL(A$):A$=MID$(A$,C+1):NEXTM
140 A(X,T,M)=VAL(A$)
145 NEXTT:X=X+1:PRINT:GOTO100
150 FORT=1TON:S(T)=0:FORM=1TO12:P(T,M)=0:FORX1=1TOX-1
155 P(T,M)=P(T,M)+A(X1,T,M):NEXTX1:P(T,M)=P(T,M)/(X-1)
156 S(T)=S(T)+P(T,M)
160 NEXTM,T:FORT=1TON:FORM=1TO12:P(T,M)=P(T,M)/S(T):NEXTM,T
170 FORC=1TO24:PRINT:NEXTC
180 INPUT" ENTER BASE YEAR";B
182 PRINT:PRINT" ENTER GROWTH RATE FOR:"
183 PRINT
184 FORY=1TON:PRINT" ";B$(Y);"'S";:INPUTG(Y):NEXTY
190 FORT=1TON
215 Z=0:GOSUB500:IFZ=1THENT1=S:GOTO227
220 PRINT" WHAT WAS THE TOTAL":PRINT:PRINT" FOR BASE YEAR";B
225 PRINT:PRINT" (";B$(T);"'S)";:INPUTT1
227 T(T)=T1:IFT>1THENFORV=1TO3000:NEXTV:GOTO230
228 INPUT" FORECAST YEAR";F
230 GOSUB235:NEXTT:GOTO264
235 TT=T1*(1+G(T)/100)^(F-B)
239 PRINT:PRINT:RESTORE
240 PRINT" FORECAST YEAR";F:PRINT
241 PRINT" (";B$(T);"'S)":PRINT
243 FORM=1TO12STEP3:FORC=1TO3
245 READB$,E(C):PRINTTAB(E(C));B$;:NEXTC:PRINT
250 FORC=1TO3:PRINTTAB(E(C));INT(TT*P(T,M+C-1));
260 NEXTC:PRINT:PRINT:NEXTM:RETURN
264 PRINT
267 PRINT" ENTER OTHER YEARS FOR":PRINT:PRINT" FORECASTING, BASED ON"
270 PRINT:PRINTB;"FIGURES...."
273 X1=1:PRINT
275 INPUT" ";F(X1):IFF(X1)=0THEN280
277 X1=X1+1:GOTO275
280 IFX1=1THENPRINT:PRINT" TO BEGIN AGAIN,":PRINT:GOTO180
282 FORX2=1TOX1-1:F=F(X2)
283 FORT=1TON:T1=T(T):GOSUB235
285 FORV=1TO4000:NEXTV,T
286 NEXTX2
288 PRINT:GOTO267
300 END
400 DATAJAN,1,FEB,9,MAR,17,APR,1,MAY,9,JUN,17,JUL,1,AUG,9,SEP,17,OCT,1
410 DATANOV,9,DEC,17
500 FORX1=1TOX-1:IFY(X1)<>BTHENNEXTX1
505 IFY(X1)<>BTHENRETURN
510 S=0:FORM1=1TO12:S=S+A(X1,T,M1):NEXTM1
530 Z=1:PRINT:RETURN

View file

@ -0,0 +1,70 @@
10 FORC=1TO24:PRINT:IFC=17THENGOSUB110
20 NEXTC
30 GOSUB100:RESTORE:PRINT" What tube are you":PRINT
40 INPUT" looking for";A$
50 READB$,C$
60 IFC$="0"THENGOSUB100:PRINT"SORRY, OUT OF STOCK.":GOTO30
65 IFB$=A$THEN73
70 IFVAL(C$)=0THENREADE$:GOTO50
72 GOTO50
73 IFVAL(C$)=0THENREADE$:D$=C$:C$=E$:GOTO80
76 D$=""
80 GOSUB100:PRINT" GOOD NEWS. WE HAVE":PRINT:PRINT" ";C$;" ";B$;D$;
85 IFVAL(C$)>1THENPRINT"'S";
90 PRINT" IN STOCK"
91 FORT=1TO3000:NEXTT
92 READB$,C$
94 IFB$=A$THEN73
95 IFB$="A"THEN30
96 IFVAL(C$)=0THENREADE$
98 GOTO92
100 PRINT:PRINTTAB(6);"******":PRINT:RETURN
110 PRINT" ROBERT G. PARSONS'":PRINT:PRINT" COMPUTER TUBE LIST":RETURN
210 DATA0A3,2,0A4,1,0B2,2,0C3,1,0D3,1,1A7,GT,1,1AX2,4,1C6,1,1G3,GT,5
220 DATA1H5,2,1J3,1,1N5,GT,2,1P5,GT,1,1R5,4,1S5,4,1U4,6,1U5,2,1X2,B,4
230 DATA2A5,1,2A7,2,2BN4,A,3,2CY5,2,2GK5,1,2HK5,1,2X2,2,3A3,B,1,3AL5,1
240 DATA3BC5,2,3BN6,6,3BU8,1,3BY6,1,3BZ6,4,3CB6,6,3CS6,1,3CY5,4,3DG4,1
250 DATA3DK6,4,3ER5,1,3FS5,1,3GK5,1,3HA5,1,3S4,1,3V4,2,4BN6,1,4BQ7,A,5
260 DATA4BU8,1,4BZ6,7,4CB6,4,4DT6,1,4GK5,1,5AM8,1,5AN8,1,5AQ5,2,5AR4,1
270 DATA5AT8,3,5AU4,2,5AX8,3,5CG8,3,5CL8,A,2,5CZ5,1,5GH8,A,1,5GS7,2
280 DATA5J6,3,5T8,1,5U4,GB,5,5U8,5,5V4,G,3,5V6,GT,1,5W4,1,5Y3,G,1
290 DATA5Y3,GT,3,5Y3,GT/G,1,5Y4,G,2,6A7,2,6AC7,6,6AF4,2,6AG5,7,6AG7,3
300 DATA6AH4,5,6AH4,GT,1,6AH6,4,6AH8,1,6AJ6,1,6AK5,2,6AK6,2,6AK8,1
310 DATA6AL3,1,6AL5,4,6AM8,A,3,6AN8,A,3,6AQ5,19,6AQ6,4,6AQ7,GT,1,6AS5,
320 DATA3,6AS8,2,6AT8,A,2,6AU4,GT,2,6AU5,GT,1,6AU6,10,6AU8,3,6AV5,GA,2
330 DATA6AV6,5,6AW8,2,6AW8,A,1,6AX4,10,6AX4,GTB,3,6B8,2,6BA6,3,6BA8,A
340 DATA1,6BC5,7,6BC8,1,6BE6,1,6BG6,G,1,6BH8,3,6BJ6,3,6BK5,2,6BK7,1
350 DATA6BL7,G,1,6BL8,14,6BN4,A,3,6BN6,1,6BN8,3,6BQ5,7,6BQ6,GA,3
360 DATA6BQ6,GTA,1,6BQ6,GTB,4,6BQ7,9,6BR8,A,1,6BS8,4,6BU8,3,6BX7,G,1
370 DATA6BY5,GT,1,6BY8,2,6BZ6,3,6BZ7,2,6BZ8,2,6C4,9,6C5,1,6CB6,15
380 DATA6CD6,2,6CD6,GA,1,6CF6,6,6CF7,1,6CG7,17,6CG8,A,3,6CJ3,1,6CL6,1
390 DATA6CM6,3,6CM7,6,6CN7,2,6CQ8,6,6CR6,1,6CS6,1,6CU8,1,6CX8,4,6CY5,5
400 DATA6D6,5,6DA5,1,6DE4,1,6DE6,3,6DK6,2,6DN7,1,6DQ6,1,6DQ6,B,3,6DS4,
410 DATA1,6DT6,A,2,6DW4,B,1,6DX8,1,6DY4,1,6E5,1,6EA7,1,6EA8,6,6EB8,1
420 DATA6EJ7,1,6ER5,1,6ES5,2,6EW6,1,6F5,1,6F7,1,6F8,G,3,6FD7,1,6FG7,3
430 DATA6FQ7,8,6GE5,1,6GF7,A,2,6GH8,A,5,6GK5,3,6GK6,2,6GN8,2,6GU7,2
440 DATA6GY6,2,6H6,2,6HA5,2,6HF8,1,6HG8,1,6HJ8,1,6HS8,9,6J4,2,6J5,1
450 DATA6J5,GT,1,6J6,A,4,6J7,2,6JC5,1,6JC6,A,2,6JH6,1,6JM6,1,6JN6,1
460 DATA6JN8,1,6JU8,A,1,6K6,GT,4,6K7,15,6K7,GT,1,6K8,1,6KA8,1,6KE8,4
470 DATA6KT8,1,6LJ8,1,6LT8,2,6N7,3,6P5,3,6P5,GT,1,6S4,A,6,6SA7,6,6SC7
480 DATA2,6SF5,2,6SG7,2,6SJ7,4,6SK7,2,6SL7,2,6SN7,3,6SN7,GT,8,6SQ7,10
490 DATA6T4,1,6T8,3,6T8,A,4,6U5,1,6U7,1,6U8,1,6U8,A,2,6V3,A,2,6V6,2
500 DATA6V6,GT,6,6W6,GT,2,6X4,5,6X5,5,6X8,10,6Z10,1,7A4,1,7A5,1,7A6,1
510 DATA7A7,2,7A8,1,7B7,1,7C5,1,7C7,1,7F8,2,7N7,4,7N7,GT,1,7V7,1
520 DATA7AU7,1,7AF7,1,7HG8,1,8AU8,1,8B10,1,8BA11,1,8CG7,3,8CM7,2,8CN7,
530 DATA2,8LT8,2,9A8,1,9AU7,1,10DE7,2,10GK6,1,10GN8,2,11AR11,11,117L7,
540 DATA117Z6,1,12A6,10,12A8,1,12AB5,2,12AT7,A,1,12AU6,1,12AU7,A,8
550 DATA12AV6,8,12AX4,GTB,4,12AX7,A,4,12AZ7,1,12B4,3,12B4,A,2,12BA6,6
560 DATA12BA7,4,12BE6,7,12BH7,A,6,12BR7,1,12BY7,2,12BZ7,1,12CA5,1
570 DATA12DT8,3,12DQ6,2,12DQ6,B,2,12FX5,1,12GN7,A,4,12K8,1,12L6,1
580 DATA12Q7,1,12SA7,3,12SF7,1,12SG7,1,12SH7,2,12SJ7,1,12SK7,7
590 DATA12SN7,GT,1,12SQ7,11,13DR7,1,13EN7,1,14A7,1,14B6,2,15BD11,1
600 DATA15CW5,1,17AX4,1,17BE3,1,17BF11,1,17CT3,1,17D4,1,17DQ6,2
610 DATA17DQ6,B,2,17EW8,1,17J28,1,19CL8,A,1,19T8,5,2050,3,25AX4,GT,2
620 DATA25BQ6,5,25BQ6,GA,1,25BQ6,GT,1,25C5,3,25L6,1,25L6,GT,4,25W4,2
630 DATA25Z5,2,25Z6,GT,1,26,4,27,2,33G47,A,1,33CYL,A,1,35A5,2,35C5,4
640 DATA35L6,GT,2,35W4,5,35Y4,2,35Z3,1,35Z5,1,35Z5,GT,5,41,4,45,6
650 DATA50A5,1,50B5,1,50C5,7,50EH5,1,50L6,GT,6,53,1,55,2,56,2,57,3,58
660 DATA2,59,2,6010,1,6146,A,1,71,A,3,75,2,76,3,78,1,CRC78,1,80,4,82,1
670 DATA884,6,VR90,1,9001,1,9002,1,9003,1
10000 DATAA,0

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,241 @@
1 REM*** PAUL A. JOVIAK ***
2 REM***** POKER ********
3 REM * 8K IP PROGRAM *
4 TT=200
5 POKE530,1
10 A1=2:A2=0:A3=0
12 PRINT:PRINT
13 PRINT"INSTRUCTIONS:":GOSUB9000
20 POKE54068,A1+48:POKE54069,A2+48:POKE54070,A3+48
22 G=54053:L$="YOU NOW HAVE $":GOSUB8000
23 PRINT"READY ?":F=0:F1=0
24 POKE57088,239:F=PEEK(57088):POKE57088,251
25 F1=PEEK(57088):IFF=0ANDF1=0THEN24
26 IFF1=247ANDTT=200ANDA1=2ANDA2=0ANDA3=0THEN12
27 IFF1=247THEN950
28 IFF=247THEN30
29 GOTO24
30 CLEAR
35 A1=PEEK(54036)-48:A2=PEEK(54037)-48:A3=PEEK(54038)-48
36 TT=A1*100+A2*10+A3
37 RS=RND(RND(TT))
38 FORI=1TO32:PRINT:NEXT
40 P$=" "
42 SP=1:SD=1
45 DIMM(13)
50 DIMC(4,13):DIMS(4):DIMN(13)
55 DIMV(2,5):DIMP(2,5):DIMD(2,5)
60 FORI=1TO4:FORJ=1TO13:C(I,J)=0:NEXTJ,I
70 FORI=2TO9:N(I)=48+I:NEXT:N(10)=84:N(1)=65:N(11)=74:N(12)=81
75 N(13)=75
80 FORI=1TO4:S(I)=228+I:NEXT
90 FORI=1TO5:V(1,I)=64:V(2,I)=32:NEXTI
140 FORK=1TO2:FORX=1TO5
150 GOSUB1000
160 IFK=2THEN180
170 P(1,X)=N(N):P(2,X)=S(S):R(X)=N:GOTO190
180 D(1,X)=N(N):D(2,X)=S(S)
185 W(X)=N:B(X)=N
190 NEXTX,K
200 FORI=0TO20STEP5:FORJ=0TO2
210 POKE53573+I+J,144:POKE53765+I+J,145
220 POKE54021+I+J,145:POKE53829+I+J,144
230 NEXTJ,I
240 FORI=0TO256STEP256:FORJ=0TO128STEP32
250 FORX=4TO24STEP5:POKE53604+I+J+X,146:NEXTX
260 FORX=0TO20STEP5:POKE53604+I+J+X,147:NEXT
270 NEXTJ,I
280 GOSUB2000
290 L$="HOW MANY CARDS DO":G=53477:GOSUB8000
292 L$="YOU WISH ?":G=53541:GOSUB8000:G=53477
300 POKE57088,127:F=PEEK(57088):R=0
310 IFF=127THENR=1
320 IFF=191THENR=2
330 IFF=223THENR=3
340 IFF=255THEN300
350 IFR=0THEN410
355 L$=P$:GOSUB8000
357 G=53541:GOSUB8000:G=53477
360 FORH=1TOR:L$="CARD":POKE53483,H+48
363 QC=127
365 GOSUB8000:Q=128:FORJ=1TO5:F=0
370 POKE57088,127:F=PEEK(57088):IFF=255THEN370
390 IFF=QCTHENGOSUB1000:P(1,J)=N(N):P(2,J)=S(S):R(J)=N
400 Q=Q-Q/2:QC=QC+Q:NEXTJ:L$=P$:GOSUB8000:NEXTH
410 L$=P$:GOSUB8000:G=53541:GOSUB8000:G=53477
413 GOSUB2000:GOSUB5000
415 GOSUB6900:GOSUB5000
420 HD=HC:DW=W:DY=Y:DR=PR:DT=TR:DF=FR:T1=E1:T2=E2
425 L$=P$:GOSUB8000
430 GOSUB3000
440 L$=P$:G=53541:GOSUB8000:G=53477
450 GOSUB8000
600 FORI=1TO5:W(I)=R(I):FORJ=1TO2:D(J,I)=P(J,I):NEXTJ,I
610 GOSUB5010
620 L$=P$:GOSUB8000
890 GOSUB4000
895 IFL$="I FOLD"THEN920
900 GOSUB2000
920 IFL$="I WIN"ORL$=P$THENTW=SP:Z$="YOU LOST $"
930 IFL$="YOU WIN"ORL$="I FOLD"THENTW=SD:Z$="YOU WON $"
940 PRINTZ$;TW
941 IFL$="I WIN"ORL$=P$THENTW=-TW
943 TT=TT+TW
945 A1=INT(TT/100):A2=INT((TT-A1*100)/10):A3=INT(TT-A1*100-A2*10)
948 IFTT>=500ORTT=<0THEN950
949 GOTO20
950 PRINT:IFTT>200THENPW=TT-200:PRINT"CONGRATULATIONS ,YOU WON $";PW
953 PRINT:IFTT<200THENPW=200-TT:PRINT"SORRY ,YOU LOST $";PW
955 PRINT:IFTT=200THENPRINT"YOU BROKE EVEN"
957 PRINT"THE CASHIER IS UP FRONT":PRINT:TT=200
959 INPUT"PLAY AGAIN";A$
960 IFLEFT$(A$,1)="Y"THEN5
995 GOTO49999
1000 S=INT(4*RND(RS)+1):N=INT(13*RND(RS)+1)
1010 IFC(S,N)=1THEN1000
1020 IFC(S,N)=0THENC(S,N)=1
1030 RETURN
2000 K=0:FORX=0TO20STEP5:K=K+1
2010 POKE53670+X,P(1,K):POKE53605+X,P(2,K):POKE53735+X,P(2,K)
2020 POKE53926+X,V(1,K):POKE53861+X,V(2,K):POKE53991+X,V(2,K)
2030 NEXTX:RETURN
3000 L$="WHAT IS YOUR BET":GOSUB8000
3020 L$="IN DOLLARS ($7 MAX.)?":G=53541:GOSUB8000
3030 G=53477
3031 GOTO3035
3033 L$="RAISE ME BY HOW MUCH ? ":GOSUB8000
3034 SP=SD
3035 F=0:F1=0
3040 POKE57088,127:F=PEEK(57088):POKE57088,191:F1=PEEK(57088)
3045 IFF=255ANDF1=255THEN3040
3046 IFF1<>255THEN3990
3050 Q=127:QC=128:FORI=1TO7:IFF=QTHENQ1=I
3055 QC=QC-QC/2:Q=Q+QC
3060 NEXT:L$=P$:GOSUB8000:SP=SP+Q1
3062 G=53541:GOSUB8000:G=53477
3065 IFW=0THEN3990
3070 L$="I CALL YOUR $":GOSUB8000:G=53492:L$=CHR$(Q1+48):GOSUB8000
3072 G=53477
3075 FORI=1TO2000:NEXT:L$=P$:GOSUB8000
3080 G=53477:U=INT(7*RND(F))
3082 IFSD>10ANDW<3THENU=0
3083 IFSD>20ANDW<6THENU=0
3084 SD=SD+Q1+U
3085 IFU=0THEN3990
3090 L$="I RAISE YOU $":GOSUB8000:G=53492:L$=CHR$(U+48):GOSUB8000
3095 FORI=1TO1500:NEXT
3097 L$=P$:G=53477:GOSUB8000
3100 G=53477:L$="CALL ,FOLD":GOSUB8000
3103 L$="OR INCREASE BET":G=53541:GOSUB8000:G=53477
3105 F=0:F1=0:F2=0
3110 POKE57088,251:F1=PEEK(57088):POKE57088,247:F=PEEK(57088)
3115 POKE57088,239:F2=PEEK(57088)
3120 IFF=255ANDF1=255ANDF2=255THEN3110
3125 L$=P$:GOSUB8000
3126 G=53541:GOSUB8000:G=53477
3130 IFF=223THENL$="I WIN":GOSUB8000:GOTO920
3140 IFF2=253THEN3033
3150 SP=SD
3990 RETURN
4000 IFW=1THENKO=1
4010 IFW=2THENKO=2
4020 IFW=3THENKO=3
4030 IFW=4THENKO=6.5
4040 IFY=5THENKO=5
4050 IFW=7THENKO=6
4060 IFW=6THENKO=7
4070 IFY=5ANDW=7THENKO=8
4080 IFDW=1THENKD=1
4090 IFDW=2THENKD=2
4100 IFDW=3THENKD=3
4110 IFDW=4THENKD=6.5
4120 IFDY=5THENKD=5
4130 IFDW=7THENKD=6
4240 IFDW=6THENKD=7
4250 IFDY=5ANDDW=7THENKD=8
4300 IFKO>KDTHENL$="YOU WIN"
4310 IFKD>KOTHENL$="I WIN"
4320 IFKD=0THENL$="I FOLD"
4330 IFKD=0THEN4890
4400 IFKD<>KOTHEN4890
4410 IFKO=2ORKD=2THEN4460
4420 IFE1>T1ORDT<TRORFR>DFTHENZ=1
4425 IFT1>E1ORDT>TRORDF>FRTHENZ=0
4430 IFE1=1ORTR=1ORFR=1ANDT1<>1ANDDT<>1ANDDF<>1THENZ=1
4435 IFT1=1ORDT=1ORDF=1ANDE1<>1ANDTR<>1ANDFR<>1THENZ=0
4440 IFT1<>E1ORDT<>TRORDF<>FRTHEN4460
4450 IFHC>HDTHENZ=1
4455 IFHD>HCTHENZ=0
4456 IFHC=1THENZ=1
4457 IFHD=1THENZ=0
4460 IFE2=0THEN4530
4465 IFE2>T1ANDE2>T2THENZ=1
4470 IFE1>T1ANDE1>T2THENZ=1
4475 IFE1=T1ANDE2>T2THENZ=1
4480 IFE2=T1ANDE1>T2THENZ=1
4485 IFE1=T2ANDE2>T1THENZ=1
4490 IFE2=T2ANDE1>T1THENZ=1
4500 IFE1=1ORE2=1ANDT1<>1ANDT2<>1THENZ=1
4510 IFT1=1ORT2=1ANDE1<>1ANDE2<>1THENZ=0
4515 IFT2<>E1ANDT1<>E1THEN4530
4516 IFT2<>E2ANDT1<>E2THEN4530
4520 IFHC>HDTHENZ=1
4525 IFHD>HCTHENZ=0
4530 IFKO<>5ORKO<>6ORKO<>7ORKO<>8THEN4880
4540 IFHC>HDTHENZ=1
4550 IFHD>HCTHENZ=0
4880 IFZ=1THENL$="YOU WIN"
4885 IFZ=0THENL$="I WIN"
4890 GOSUB8000
4900 RETURN
5000 FORI=1TO2:FORJ=1TO5:V(I,J)=D(I,J):NEXTJ,I
5005 L$="THE ANTE IS $1.00":GOSUB8000
5010 W=0:FORI=1TO4:FORJ=I+1TO5
5020 IFD(1,I)=D(1,J)THENW=W+1
5030 NEXTJ,I
5040 A=0:FORI=1TO4
5050 IFD(2,I)=D(2,I+1)THENA=A+1
5060 NEXTI:IFA=4THENW=7
5080 FORK=1TO5:FORI=1TO4:FORJ=I+1TO5:IFW(I)<W(I+1)THEN5110
5100 W(6)=W(I):W(I)=W(I+1):W(I+1)=W(6)
5110 NEXTJ,I,K:Y=0
5120 A=0:FORI=1TO4:IFW(I)+1=W(I+1)THENA=A+1
5130 NEXTI:IFA=4THENY=5
5140 IFW(1)=1ANDW(2)=10ANDW(3)=11ANDW(4)=12ANDW(5)=13THENY=5
5150 HC=W(5):IFW(1)=1THENHC=1
5155 FORI=1TO13:M(I)=0:NEXT:PR=0:TR=0:FR=0
5156 E1=0:E2=0
5160 FORI=1TO5:FORJ=1TO13:IFW(I)=JTHENM(J)=M(J)+1
5170 NEXTJ,I:FORI=1TO13:IFM(I)=2THENPR=PR+1
5175 IFM(I)=2ANDPR=1THENE1=I
5176 IFM(I)=2ANDPR=2THENE2=I
5180 IFM(I)=3THENTR=I
5190 IFM(I)=4THENFR=I
5200 NEXTI
5500 IFW=1ANDW(5)=E1THENHC=W(4)
5510 IFW=1ANDW(4)=E1THENHC=W(3)
6000 RETURN
6900 IFY=5ORW=7THENRETURN
6950 G1=5:IFW=0THENG1=3
7000 FORI=1TOG1
7010 IFE1=B(I)ORE2=B(I)ORTR=B(I)ORFR=B(I)THEN7100
7020 GOSUB1000:D(1,I)=N(N):D(2,I)=S(S):B(I)=N
7100 NEXTI
7120 FORI=1TO5:W(I)=B(I):NEXT
7200 RETURN
8000 FORI=1TOLEN(L$):POKEG+I,ASC(MID$(L$,I,1)):NEXT:RETURN
9000 PRINT"WHEN THE CARDS APPEAR":PRINT"ON THE SCREEN,YOU"
9005 PRINT"WILL BE ASKED 'HOW":PRINT"MANY CARDS DO YOU"
9010 PRINT"WISH ?'. THE GAME IS":PRINT"3 CARD DRAW POKER AND"
9020 PRINT"IF '4' IS PRESSED NO":PRINT"CARDS ARE DRAWN. IF"
9025 PRINT"YOU DRAW 'CARD 1' WILL":PRINT"APPEAR. YOU WILL THEN"
9030 PRINT"ANSWER A NUMBER BETWEEN":PRINT"1 AND 5 INDICATING"
9035 PRINT"THE CARD YOU WISH TO":PRINT"REPLACE. ANTE IS"
9040 PRINT"ALWAYS $1.00. BETS AND":PRINT"RAISES CAN BE NO MORE"
9050 PRINT"THAN $7.00 AT A TIME."
9060 PRINT"YOU ARE PLAYING TO":PRINT"$500 OR NOTHING."
9070 PRINT"GOOD LUCK !!"
9080 PRINT
9090 PRINT
9900 RETURN
49999 END

View file

@ -0,0 +1,119 @@
1 REM ***ROBERT L.
2 REM ***COPPEDGE
5 FOR SC=1TO32:PRINT:NEXT
10 PRINT"MATH TUTOR":PRINT:PRINT
15 PRINT"THIS TUTOR IS DESIGNED"
18 PRINT"TO BE AN AID IN BASIC"
20 PRINT"MATHEMATICS."
21 PRINT
25 PRINT"YOU HAVE THE FOLLOWINT":PRINT"SUBJECTS TO CHOOSE FROM"
28 PRINT
30 PRINT"1) AFDITION":PRINT:PRINT"2) SUBTRACTION":PRINT
35 PRINT"3)MULTIPLICATION":PRINT:PRINT"4) DIVISION"
38 PRINT
40 INPUT "WHICH WOULD YOU LIKE TO DO";X
44 PRINT
45 IF X>4 OR X<1 THEN 40
50 INPUT "ENTER RANDOM SEED(ANY NUMBER)";Z1
55 FOR SC=1TO32:PRINT:NEXT
60 ON X GOTO 100,200,300,400
100 PRINT"THIS IS ADDITION":FOR Z=1 TO 100
105 W=INT(1000*RND(Z1)+1):V=INT(1000*RND(Z1)+1)
110 Y=W+V
111 S=0
115 PRINT:PRINT"WHAT IS:"
120 PRINTW;"+";V:INPUT U
125 IF U=Y THEN 140
126 S=1
130 PRINT:PRINT"NO, I'M SORRY"
135 INPUT "AGAIN";A$:IF A$="YES" OR A$="Y" THEN 115
137 PRINT:PRINT"THE ANSWER IS";Y
138 GOTO 160
140 PRINT:PRINT"VERY GOOD!! PERFECT!!"
145 IF S=0 THEN R(X)=R(X)+1
160 PRINT:INPUT"DO YOU WANT ANOTHER ONE";A$
165 IF A$="YES" OR A$="Y" THEN 180
170 PRINT"YOU GOT ";R(X);" OUT OF ";Z
175 GOTO 500
180 PRINT:PRINT:PRINT:NEXT Z
185 GOTO 170
200 PRINT"THIS IS SUBTRACTION":FOR Z=1 TO 100
205 W=INT(1000*RND(Z1)+1):V=INT(1000*RND(Z1)+1)
210 Y=W-V
211 S=0
215 PRINT:PRINT"WHAT IS:":PRINT
220 PRINTW;"-";V:INPUT U
225 IF U=Y THEN 240
226 S=1
230 PRINT:PRINT"NO, I'M AFRAID THAT'S":PRINT"NOT IT.":PRINT
233 PRINT"DO YOU WANT TO"
235 INPUT"TRY AGAIN";A$:IFA$="Y" OR A$="YES" THEN 215
236 PRINT
237 PRINT"THE ANSWER IS ";Y
238 PRINT:GOTO260
240 PRINT:PRINT"BRAVO!! GOOD JOB!!"
245 IF S=0 THEN R(X)=R(X)+1
250 PRINT
260 INPUT "DO YOU WANT ANOTHER ONE";A$
265 IF A$="YES" OR A$="Y" THEN 280
270 PRINT"YOU GOT ";R(X);" OUT OF ";Z
275 GOTO 500
280 PRINT:PRINT:PRINT:NEXT Z
285 GOTO 270
300 PRINT"THIS IS MULTIPLICATION":FOR Z=1 TO 100
305 W=INT(20*RND(Z1)+1):V=INT(20*RND(Z1)+1)
310 Y=W*V
311 S=0
315 PRINT"WHAT IS:"
318 PRINT
320 PRINTW;"*";V:INPUT U
325 IF Y=U THEN 340
326 S=1
328 PRINT
330 PRINT:PRINT"SORRY, BUT THAT'S NOT":PRINT"CORRECT. ":PRINT
333 PRINT"DO YOU WANT TO TRY"
335 INPUT "AGAIN";A$:IF A$="Y" OR A$="YES" THEN 315
337 PRINT:PRINT"THE ANSWER IS";Y
338 GOTO 360
340 PRINT:PRINT"YOU GOT IT!!"
344 PRINT
345 IF S=0 THEN R(X)=R(X)+1
360 PRINT:INPUT"DO YOU WANT ANOTHER ONE";A$
365 IF A$="Y" OR A$="YES" THEN 380
366 PRINT
370 PRINT"YOU GOT ";R(X);" OUT OF ";Z
375 GOTO 500
380 PRINT:PRINT:PRINT:NEXT Z
385 GOTO 370
400 PRINT"THIS IS DIVISION":FOR Z=1 TO 100
405 W=INT(150*RND(Z1)+1):V=INT(75*RND(Z1)+1)
410 Y=W/V:IF Y=INT(Y) THEN 414
411 GOTO 405
414 S=0
415 PRINT:PRINT"WHAT IS:"
420 PRINTW;"/";V:INPUT U
425 IF Y=U THEN 440
426 S=1
428 PRINT
430 PRINT"NOT QUITE RIGHT. DO YOU":PRINT"WANT ANOTHER CRACK "
435 INPUT "AT IT";A$:IF A$="Y" OR A$="YES" THEN 415
436 PRINT
437 PRINT"THE ANSWER IS: ";Y
438 PRINT:GOTO460
439 PRINT
440 PRINT:PRINT"PERFECT!!"
444 PRINT
445 IF S=0 THEN R(X)=R(X)+1
450 PRINT
460 INPUT "DO YOU WANT ANOTHER ONE";A$
462 PRINT
465 IF A$="Y" OR A$="YES" THEN 480
470 PRINT"YOU GOT ";R(X);" OUT OF ";Z
475 GOTO 500
480 PRINT:PRINT:PRINT:NEXT Z
482 PRINT
485 GOTO 470
500 PRINT:PRINT"WOULD YOU LIKE ANOTHER"
505 INPUT"CATEGORY";A$
510 IF A$="Y" OR A$="YES" THEN 30
600 END

View file

@ -0,0 +1,124 @@
1 REM ***ROBERT L.
2 REM ***COPPEDGE
3 FOR SC=1TO32:PRINT:NEXT
4 DIM A$(20),Y(20),Q(20)
5 PRINT"THIS PROGRAM FIGURES"
6 PRINT"OUT YOUR CHECKING"
7 PRINT"ACCOUNT. TO DO"
8 PRINT"THIS, A NUMBER OF"
9 PRINT"THINGS ARE NEEDED, SUCH"
10 PRINT"AS THE NUMBER OF CHECKS"
11 PRINT"TO BE USED, THE TOTAL"
12 PRINT"AMOUNT TO START WITH,"
13 PRINT"AND THE NAME OF THE "
14 PRINT"RECIPIENT OF THE CHECK,":PRINT"AS WELL AS THE AMOUNT."
15 PRINT:INPUT"TYPE 'C' TO CONTINUE";A$
16 FOR SC=1TO32:PRINT:NEXT
34 PRINT"IF YOU HAVE MADE A"
35 PRINT"MISTAKE, AND YOU WOULD"
36 PRINT"LIKE TO CORRECT IT,"
37 PRINT"MERELY TYPE IN THE WORD"
38 PRINT"'HELP' WHEN I ASK"
39 PRIP"YOU FOR A CHECK'S NAME."
45 HELP=-6
46 PRINT
50 PRINT:PRINT"PLEASE ENTER YOUR":PRINT"INITIAL BALANCE"
54 INPUT T
60 IF T=-6 THEN 160
62 PRINT
65 PRINT"HOW MANY CHECKS DO YOU"
66 PRINT"WANT TO BE TOTALLED";:INPUT X
67 IF X=0 THEN 160
70 IF X=-6 THEN GOTO 160
71 FOR SC=1TO32:PRINT:NEXT
75 PRINT"ENTER THE NAME OF THE ":PRINT"PERSON OR PERSONS TO"
76 PRINT"WHOM THE CHECKS WERE ":PRINT"WRITTEN."
77 PRINT
78 PRINT"IT'S A GOOD IDEA TO ":PRINT"LIST THEM IN ORDER."
80 PRINT
90 PRINT"IF IT IS A DEPOSIT, ":PRINT"TYPE 'XDEPOSIT' AND"
91 PRINT"THEN THE AMOUNT.":PRINT
94 IF X=0 THEN 160
95 FOR Z=1 TO X
100 PRINT:PRINT"CHECK NUMBER";Z:PRINT
101 PRINT"MADE OUT TO:"
105 INPUT A$(Z)
110 IF A$(Z)="HELP" THEN 160
114 PRINT
115 PRINT"AMOUNT";:INPUT Y(Z)
120 IF Y(Z)=-6 THEN 160
124 IF A$(Z)="XDEPOSIT" THEN Y(Z)=-Y(Z)
125 NEXT Z
128 L=T:PRINT:PRINT:PRINT
129 PRINT"ORIGINAL AMOUNT: ";:PRINTT
130 PRINT:PRINT"#--MADE TO"
131 PRINTTAB(9)"AMOUNT--BALANCE"
133 PRINT:PRINT
135 FOR Z=1 TO X
140 PRINTZ;:PRINTA$(Z)
146 LET Q(Z)=ABS(Y(Z))
150 L=L-Y(Z)
153 PRINTTAB(10)Q(Z);:PRINTTAB(20)L:PRINT
155 NEXT Z
156 FOR Z=1 TO 5000
157 NEXT Z
158 PRINT:PRINT:PRINT
160 FOR SC=1TO32:PRINT:NEXT
161 PRINT"IF THERE ARE MISTAKES":PRINT"THAT YOU WOULD LIKE"
162 PRINT"TO CORRECT THEN TYPE IN"
166 PRINT"ONE OF THE FOLLOWING":PRINT"NUMBERS:"
170 PRINT:PRINT"1) IF THE TOTAL IS WRONG"
175 PRINT:PRINT"2) IF A CHECK OR DEP-":PRINT" OSIT IS INCORRECT."
180 PRINT:PRINT"3) IF EVERYTHING'S OK.":PRINT
190 PRINT:PRINT
195 INPUT"(1,2 OR 3)";R
196 IF R<1 THEN 165
197 IF R>3 THEN 165
199 PRINT:PRINT:PRINT
200 ON R GOTO 220,230,205,215
205 PRINT"OK.":GOTO 400
215 PRINT"TRY AGAIN":GOTO 175
220 PRINT"ENTER IN NEW TOTAL";:INPUT T:GOTO 128
230 PRINT"DO YOU HAVE MORE CHECKS"
231 PRINT"OR DEPOSITS TO ADD"
232 PRINT"(YES OR NO)";:INPUT N$
234 PRINT:PRINT:PRINT
235 IF N$="NO" THEN 250
240 PRINT"HOW MANY MORE";:INPUT W
245 X=X+W :GOTO 310
250 PRINT"DO YOU WANT TO EITHER"
251 PRINT"CHANGE OR ERASE ONE OF"
252 PRINT"THE CHECKS OR DEPOSITS";
255 INPUT N$:IF N$="YES" THEN 270
256 PRINT:PRINT:PRINT
260 GOTO 160
270 PRINT:PRINT:PRINT"WHICH CHECK # DO YOU WANT"
271 PRINT"TO CHANGE";:INPUT M
274 PRINT:PRINT:PRINT
275 PRINT"DO YOU WANT TO CHANGE OR"
276 PRINT"ERASE IT (1=CHANGE, "
277 PRINT"2=ERASE)";:INPUT K
278 PRINT:PRINT:PRINT
280 ON K GOTO 300,290,275
290 A$(M)="DELETED"
291 Y(M)=0
295 GOTO 128
300 PRINT"NEW CHECK NAME"
301 INPUT A$(M)
302 PRINT"NEW AMOUNT";:INPUT Y(M)
303 PRINT:PRINT:PRINT
305 PRINT"ANY MORE CHECKS TO BE"
306 PRINT"REDONE(YES OR NO)";:INPUT B$
307 IF B$="NO" THEN 130
308 IF B$="YES" THEN 273
309 GOTO 130
310 FOR Z=X-(W-1) TO X
315 PRINT"CHECK #":PRINTZ
320 PRINT"MADE OUT TO:"
325 INPUT A$(Z)
326 IF A$(Z)="HELP" THEN 160
330 PRINT"AMOUNT";:INPUT Y(Z)
335 IF Y(Z)=-6 THEN 160
340 NEXT Z
345 GOTO 128
400 END

View file

@ -0,0 +1,100 @@
10 FORH=1TO35:PRINT:NEXT
20 PRINT"TRIGNOMETRY DEALS":PRINT"PRIMARILY WITH SIX"
22 PRINT"RATIOS CALLED":PRINT"TRIGNOMETRIC FUNCTIONS.":PRINT
25 PRINT"THE FIRST OF THESE":PRINT"FUNCTIONS IS THE SINE.":PRINT
30 PRINT"SINE IS USUALLY WRITTEN":PRINT"AS 'SIN' IN TRIGNOMETRY."
32 FORH=1TO7:PRINT:NEXT:FORH=1TO13000:NEXT
35 PRINT"THE SINE OF ANGLE 'A'":PRINT"IS THE OPPOSITE"
36 PRINT"SIDE DIVIDED BY"
37 PRINT"THE HYPOTENUSE."
40 PRINT:PRINT"THE HYPOTENUSE IS THE"
42 PRINT"THE LONGEST SIDE OF A":PRINT"RIGHT ANGLED TRIANGLE."
44 PRINT:PRINT:PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM."
46 FORH=1TO10:PRINT:NEXT:GOSUB4000:GOSUB5000
50 PRINT"THUS: SIN(A)=":PRINT"LENGHT OF SIDE 'y'"
52 PRINT"DIVIDED BY 'r'.":PRINT:PRINT"OR SIN(A)=y/r.":PRINT
54 PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE"
56 PRINT"VALUE OF SIN(A)?":PRINT:PRINT"SINCE SIN(A)=y/r OR"
58 PRINT"SIN(A)=3/5=.6":PRINT:PRINT"HIT 'SPACE BAR' TO"
60 PRINT"CONTINUE PROGRAM.":FORH=1TO9:PRINT:NEXT
62 GOSUB4000:GOSUB5000:PRINT"THE NEXT TRIG. FUNCTION"
90 PRINT"IS THE 'COS' OR COSINE.":PRINT
92 PRINT"THE COS(A) EQUALS THE":PRINT"LENGTH OF THE ADJACENT"
95 PRINT"SIDE DIVIDED BY THE":PRINT"LENGHT OF":PRINT"THE HYPOTENUSE."
97 PRINT:PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM"
99 FORH=1TO12:PRINT:NEXT:GOSUB4000:GOSUB5000
102 PRINT"THUS THE 'COS' OF ANGLE":PRINT"A EQUALS x/r"
105 PRINT"OR COS(A)=x/r.":PRINT:PRINT"IF x=4, y=3, AND r=5"
108 PRINT"THEN WHAT IS THE COS(A)?":PRINT
111 PRINT"SINCE COS(A)=x/r OR":PRINT"COS(A)=4/5=.8"
114 PRINT:PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM."
117 FORH=1TO11:PRINT:NEXT:GOSUB4000:GOSUB5000
212 PRINT"THUS 'TAN' OF ANGLE A":PRINT"EQUALS THE LENGTH OF y"
218 PRINT"DIVIDED BY THE LENGTH":PRINT"OF x. OR: TAN(A)=y/x."
220 PRINT:PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM."
222 FORH=1TO14:PRINT:NEXT:GOSUB4000:GOSUB5000
240 PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE TAN(A)?"
245 PRINT:PRINT"SINCE TAN(A)=y/x THUS":PRINT"TAN(A)=3/4=.75"
248 PRINT:PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM."
250 FORH=1TO11:PRINT:NEXT:GOSUB4000:GOSUB5000
270 PRINT"NOW LET'S HAVE A SHORT":PRINT"QUIZ TO TEST YOUR"
275 PRINT"KNOWLEDGE OF THE SIN,":PRINT"COS, AND TAN."
280 PRINT:PRINT"PLEASE GIVE":PRINT"DECIMAL ANSWERS!":PRINT:PRINT
285 PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM."
290 FORH=1TO6:PRINT:NEXT:GOSUB5000
295 PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE COS(A)?"
300 FORH=1TO15:PRINT:NEXT:GOSUB4000:INPUTA1
305 IFA1<>.8THENPRINT"WRONG":PRINT"x/r=4/5=.8"
308 IFA1=.8THENPRINT"RIGHT!"
310 GOSUB6000
315 PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE SIN(A)?"
320 FORH=1TO15:PRINT:NEXT:GOSUB4000:INPUTA1
325 IFA1<>.6THENPRINT"WRONG":PRINT"y/r=3/5=.6"
330 IFA1=.6THENPRINT"RIGHT!"
334 GOSUB6000
350 PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE TAN(A)?"
355 FORH=1TO15:PRINT:NEXT:GOSUB4000:INPUTA1
360 IFA1<>.75THENPRINT"WRONG":PRINT"y/x=3/4=.75"
365 IFA1=.75THENPRINT"RIGHT!"
370 GOSUB6000
400 PRINT"THIS NEXT SECTION IS":PRINT"A LITTLE TOUGHER.":PRINT
410 PRINT"THE QUESTIONS WILL":PRINT"ASK YOU ABOUT THE"
415 PRINT"SIN, COS, AND TAN OF":PRINT"ANGLE B: NOT ANGLE A!"
420 PRINT:PRINT"HIT 'SPACE BAR' TO":PRINT"CONTINUE PROGRAM."
425 FORH=1TO7:PRINT:NEXT:GOSUB5000
430 FORH=1TO27:PRINT:NEXT:PRINT"REMEMBER:"
435 PRINT"COS EQUALS ADJACENT SIDE":PRINT"DIVIDED BY HYPOTENUSE"
440 PRINT:PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE COS(B)?"
445 FORH=1TO15:PRINT:NEXT:GOSUB4000:INPUTA1
450 IFA1<>.6THENPRINT"WRONG":PRINT"y/r=3/5=.6"
455 IFA1=.6THENPRINT"RIGHT!"
460 GOSUB6000
490 PRINT"SIN EQUALS OPPOSITE SIDE":PRINT"DIVIDED BY HYPOTENUSE."
500 PRINT:PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE SIN(B)?"
510 FORH=1TO15:PRINT:NEXT:GOSUB4000:INPUTA1
520 IFA1<>.8THENPRINT"WRONG":PRINT"x/r=4/5=.8"
530 IFA1=.8THENPRINT"RIGHT!"
535 GOSUB6000
550 PRINT"TAN EQUALS OPPOSITE SIDE":PRINT"DIVIDED BY THE"
555 PRINT"ADJACENT SIDE.":PRINT
560 PRINT"IF x=4, y=3, AND r=5":PRINT"THEN WHAT IS THE TAN(B)?"
570 FORH=1TO15:PRINT:NEXT:GOSUB4000:INPUTA1$
575 IFLEFT$(A1$,3)="1.3"THENPRINT"RIGHT!"
580 IFLEFT$(A1$,3)<>"1.3"THENPRINT"WRONG":PRINT"x/y=4/3=1.33"
600 GOSUB6000:PRINT"THIS IS THE END":PRINT"OF THE PROGRAM."
610 PRINT:PRINT"DO YOU WANT TO":INPUT"RUN IT AGAIN";A1$
620 IF LEFT$(A1$,1)="Y"THEN10
630 END
4000 FORH=0TO16:POKE54060+H,135:NEXT
4010 FORH=0TO7:POKE54127-32*H,143:NEXT
4020 FORH=0TO9:POKE54032-H*31,189:NEXT
4030 FORH=0TO9:POKE54042-H*32,136:NEXT
4040 POKE54063,207:POKE54128,45:POKE54129,89
4050 POKE54094,65:POKE54011,43:POKE54012,88
4060 POKE54036,120:POKE53876,114:POKE53881,121
4070 POKE53936,43:POKE53937,89:POKE54028,45:POKE54029,88
4080 POKE53755,66:POKE54041,210:RETURN
5000 POKE530,1:POKE57088,1
5100 IFPEEK(57088)=239THENFORH=1TO28:PRINT:NEXT:RETURN
5200 GOTO5000
6000 FORH=1TO6000:NEXT:FORH=1TO26:PRINT:NEXT:RETURN

View file

@ -0,0 +1,116 @@
1 REM***ROBERT L.
2 REM***COPPED
3 GOSUB20000:FORX=1TO8:READJ(X):NEXTX
4 H=54000:T=32:U=32
5 FORX=1TO8:READH(X):NEXT:DIMF(16)
6 FORX=1TO6:READG(X):NEXT
7 POKE530,1:KEY=57088:V=32:W=32
8 DEFFND(X)=X-53349-32*INT((X-53349)/32)
9 FORX=1TO8:READF(X):NEXT
10 INPUT"ENTER RANDOM #";Z1
11 FORX=1TO35:PRINT:NEXT:FORX=1TO100
12 Y=INT(53349+RND(Z1)*1024)
13 POKEY,46:NEXT:POKE54117,32
14 EP=INT(53349+RND(Z1)*919)
15 IFFND(EP)=<1ORFND(EP)>=24THEN14
16 R=PEEK(EP)
17 IFEP>54268OREP<53449THEN14
50 M=INT(16*RND(Z1)+1)
52 IFM>15.8THEN2000
53 IFM>8THEN70
55 IFFND(EP+F(M))=1ORFND(EP+F(M))=>24THEN50
57 IFEP+F(M)<53449OREP+F(M)>54268THEN50
58 EP=EP+F(M)
60 S=PEEK(EP):POKEEP,4:POKEEP-F(M),R
62 R=S
63 IFR=40ORR=41THENR=32
70 POKEKEY,64:P=PEEK(KEY):FORX=1TO6
71 IFP=246THENX=5:GOTO1000
72 IFP=G(X)THENGOTO1000
73 IFX=ETHENGOTO1000
74 NEXT
80 GOTO50
1000 IFX=<4THEN1010
1005 ONX-4GOTO1050,1100
1010 IFFND(H+F(X)-1)=0ORFND(H+F(X)+1)=>24THEN1400
1015 IFH+F(X)>54268ORH+F(X)<53349THEN1400
1020 H=H+F(X):I=H+1:J=H-1
1030 T=PEEK(I):U=PEEK(J)
1035 IFT=4THENT=32
1036 IFU=4THENU=32
1040 POKEI-F(X),V:POKEJ-F(X),W
1045 POKEJ,40:POKEI,41
1046 V=T:W=U
1047 E=X:GOTO1400
1050 E=0:X=6:GOTO74
1100 FORX1=1TO150:POKEH,X1:NEXTX1:POKEH,32
1101 IFH=EPTHEN1200
1110 GOTO74
1200 KI=KI+1:IFKI>7THEN3000
1201 FORC1=1TO22:POKE54117+C1,ASC(MID$(A$,C1,1))
1202 NEXTC1:FORC2=1TO300:NEXTC2
1203 FORC1=1TO22:POKE54117+C1,32
1204 NEXTC1
1205 GOTO14
1400 GOTO74
2000 REM***ALIEN FIRE
2001 REM***PHASE
2010 D=INT(1+8*RND(Z1))
2011 K=FND(EP)
2015 FORB=1TO24:POKEEP+B*F(D),H(D)
2017 IFK+B*J(D)=1ORK+B*J(D)>=23THEN2050
2018 IFEP+B*F(D)<53349OREP+B*F(D)>54268THEN2050
2020 NEXTB
2050 FORC=1TOB:POKEEP+C*F(D),32:NEXT
2060 IFD=2THEN2500
2070 GOTO70
2500 FORC1=1TO150
2501 B6=INT(53349+RND(Z1)*919)
2502 POKEB6,42:NEXTC1
2503 PRINT"ENEMY HAS SHATTERED"
2504 PRINT"TURRET SYSTEM."
2505 PRINT"TURRET KNOCKED OUT"
2506 PRINTKI;" RAIDERS BEFORE"
2507 PRINT"IT WAS DISABLED"
2508 PRINT"WOULD YOU LIKE TO"
2509 PRINT"SWITCH TO ANOTHER"
2510 INPUT"TURRET";B$
2550 IFLEFT$(B$,1)="Y"THEN2560
2555 GOTO4000
2560 FORX4=54117TO54300:POKEX4,32:NEXTX4
2561 KI=0
2565 GOTO10
2600 END
3000 PRINT"THE TURRET DEFENSE HAS"
3001 PRINT"SHATTERED THE"
3002 PRINT"RAIDERS NOW-ABORTED"
3003 PRINT"ATTEMPT AT STELLAR"
3004 PRINT"CONQUEST. WOULD YOU"
3005 PRINT"LIKE THEM TO TRY IT"
3006 INPUT"AGAIN";B$
3007 IFLEFT$(B$,1)="Y"THEN2560
4000 PRINT"OK, THEN THEY'LL GO"
4001 PRINT"HOME FOR NOW."
4500 END
9999 DATA0,0,-1,1,1,-1,1,-1
10000 DATA140,140,131,131,189,190,190,189
10005 DATA126,190,222,238,246,250
10009 DATA-32,32,-1,1,-31,-33,33,31
20000 A$="NEW TARGET APPROACHING"
20002 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
20010 INPUT"INSTRUCTIONS NEEDED";R$
20020 IFLEFT$(R$,1)="N"THENRETURN
20025 PRINT"Destroy the enemy"
20030 PRINT"by getting it within"
20035 PRINT"the crosshairs. To"
20040 PRINT"move the crosshairs,"
20045 PRINT"type in a:"
20050 PRINT:PRINT"1> moves up"
20055 PRINT"2> moves down"
20060 PRINT"3> moves left"
20065 PRINT"4> moves right"
20070 PRINT"5> stops"
20075 PRINT"6> fires"
20080 PRINT:PRINT:PRINT"Watch it, though,"
20085 PRINT"the sucker fires back!!"
20090 RETURN

View file

@ -0,0 +1,167 @@
1 REM--ROGER VAN SCOY
2 REM--COUNTER
19 D1=53392
20 W=0:KEY=57088
21 DEF FNZ(F)=55-INT(LOG(F)/LOG(2)-.5)
22 POKE530,1
25 DIMC(25):FORX=1TO25:READC(X):NEXT
27 DIMA(23):FORX=1TO23:READA(X):NEXT
29 DIMB(19):FORX=1TO19:READB(X):NEXT
30 DIMD(24):FORX=1TO24:READD(X):NEXT
33 FORX=1TO34:PRINT:NEXT
35 PRINT"HI, WHAT'S YOU'RE NAME":INPUTN$
40 FORX=1TO34:PRINT:NEXT
50 A=53991:P=53487:C=54032:B=P+7*64:D=54181:CN=0
70 R=ASC(N$)
75 PRINT"TODAY, ";N$
80 PRINT"WE'LL PRACTICE"
85 PRINT"COUNTING TO TEN!!!"
90 FORX=1TO14:PRINT:NEXT
91 POKE54117,32
94 FORX=1TO4000:NEXT
95 FORX=53530TO53700:POKEX,32:NEXT
97 GOSUB6000:GOTO1150
100 REM---ONE
110 Z=P+1:FORX=ZTOZ+6*64STEP64:POKEX,49:NEXT
120 POKEZ+63,49:POKEZ+6*64-1,49:POKEZ+6*64+1,49
130 POKEB,79:POKEB+1,78:POKEB+2,69
135 POKEC,9:POKEC+1,10
140 RETURN
200 REM---TWO
210 POKEP+63,50:FORX=PTOP+2:POKEX,50:NEXT
220 Z=P+3:POKEZ+64,50:POKEZ+128,50
230 Z=Z+192:POKEZ-1,50:POKEZ-2,50:Z=Z+61:POKEZ,50
240 Z=Z+63:POKEZ,50:Z=Z+64:FORX=ZTOZ+4:POKEX,50:NEXT
250 POKEB,84:POKEB+1,87:POKEB+2,79
260 POKEC-2,181:POKEC-1,182:POKEC,32:POKEC+1,181:POKEC+2,182
270 RETURN
300 FORX=1TO300
320 FORX=P+1TOP+5:POKEX,51:NEXT
330 Z=P+69:POKEZ,51:POKEZ+63,51:POKEZ+127,51:POKEZ+126,51:Z=Z+192
340 POKEZ,51:POKEZ+64,51
350 Z=Z+128:FORX=Z-1TOZ-3STEP-1:POKEX,51:NEXT:POKEZ-68,51
360 POKEB+1,84:POKEB+2,72:POKEB+3,82:POKEB+4,69:POKEB+5,69
370 POKEC-2,214:POKEC-1,211:POKEC,32:POKEC+1,214:POKEC+2,211
380 POKEC+4,214:POKEC+5,211
390 RETURN
400 REM---FOUR
410 Z=P+2:FORX=ZTOZ+6*64STEP64:POKEX,52:NEXT
420 Z=Z+62:POKEZ+1,52:POKEZ+64,52:Z=Z+127:POKEZ,52:Z=Z+64
430 FORX=ZTOZ+4:POKEX,52:NEXT
440 POKEB,70:POKEB+1,79:POKEB+2,85:POKEB+3,82
450 POKEC-4,7:POKEC-3,8:POKEC-2,32:POKEC-1,7:POKEC,8:POKEC+1,32
460 POKEC+2,7:POKEC+3,8:POKEC+4,32:POKEC+5,7:POKEC+6,8
470 RETURN
500 REM---FIVE
510 FORX=PTOP+4:POKEX,53:NEXT:Z=P+128:POKEZ-64,53
520 FORX=ZTOZ+3:POKEX,53:NEXT:Z=Z+68:FORX=ZTOZ+128STEP64:POKEX,53:NEXT
530 Z=Z+191:FORX=ZTOZ-2STEP-1:POKEX,53:NEXT:POKEZ-67,53
540 POKEB,70:POKEB+1,73:POKEB+2,86:POKEB+3,69
550 FORX=C-4TOC+8:POKEX,32:NEXT:POKEC-4,0:POKEC-2,0:POKEC,0:POKEC+2,0
560 POKEC+4,0:RETURN
600 REM---SIX
610 Z=P+2:FORX=ZTOZ+2:POKEX,54:NEXT:POKEZ+63,54:Z=Z+126
620 FORX=ZTOZ+192STEP64:POKEX,54:NEXT:Z=Z+64
630 FORX=ZTOZ+3:POKEX,54:NEXT
640 Z=Z+68:POKEZ,54:POKEZ+64,54:Z=Z+127
650 FORX=ZTOZ-2STEP-1:POKEX,54:NEXT
660 POKEB+1,83:POKEB+2,73:POKEB+3,88
670 FORX=C-4TOC+4:POKEX,32:NEXT
680 POKEC-4,15:POKEC-2,15:POKEC,15:POKEC+2,15:POKEC+4,15
690 POKEC+60,15:RETURN
700 REM---SEVEN
710 FORX=PTOP+4:POKEX,55:NEXT:POKEP+68,55:POKEP+131,55:POKEP+194,55
720 FORX=P+1+4*64TOP+1+6*64STEP64:POKEX,55:NEXT
730 POKEB,83:POKEB+1,69:POKEB+2,86:POKEB+3,69:POKEB+4,78
740 POKEC-4,236:POKEC-2,236:POKEC,236:POKEC+2,236:POKEC+4,236
750 POKEC+60,236:POKEC+62,236:RETURN
800 REM---EIGHT
810 Z=P+1:FORX=ZTOZ+2:FORX1=Z+192TOZ+194:FORX2=Z+384TOZ+386
820 POKEX,56:POKEX1,56:POKEX2,56:NEXTX2:NEXTX1:NEXTX
830 Z=P+64:POKEZ,56:POKEZ+4,56:POKEZ+64,56:POKEZ+68,56
840 Z=P+256:POKEZ,56:POKEZ+4,56:POKEZ+64,56:POKEZ+68,56
850 POKEB,69:POKEB+1,73:POKEB+2,71:POKEB+3,72:POKEB+4,84
860 POKEC-4,248:POKEC-2,248:POKEC,248:POKEC+2,248:POKEC+4,248
870 POKEC+60,248:POKEC+62,248:POKEC+64,248:RETURN
900 REM---NINE
910 Z=P+1:FORX=ZTOZ+2:POKEX,57:NEXT
920 Z=Z+67:FORX=ZTOZ+196STEP64:POKEX,57:NEXT
930 POKEP+64,57:POKEP+128,57:Z=P+193:FORX=ZTOZ+2:POKEX,57:NEXT
940 Z=P+6*64:FORX=ZTOZ+2:POKEX,57:NEXT:POKEZ-61,57
950 POKEB,78:POKEB+1,73:POKEB+2,78:POKEB+3,69
960 POKEC-4,16:POKEC-2,17:POKEC,18:POKEC+2,19:POKEC+4,20
970 POKEC+60,20:POKEC+62,19:POKEC+64,18:POKEC+66,17:RETURN
1000 REM---TEN
1005 Z=P-3:FORX=ZTOZ+6*65STEP64:POKEX,49:NEXT
1010 POKEZ+63,49:POKEZ+6*64-1,49:POKEZ+6*64+1,49
1020 Z=P+1:Z1=Z+6*64:FORX=ZTOZ+2:FORX1=Z1TOZ1+2:POKEX,48:POKEX1,48
1030 NEXTX1:NEXTX
1040 Z=P+64:Z1=P+68:FORX=ZTOZ+256STEP64:FORX1=Z1TOZ1+256STEP64
1050 POKEX,48:POKEX1,48:NEXTX1:NEXTX
1060 POKEB-1,84:POKEB,69:POKEB+1,78:V=240
1080 POKEC-4,V:POKEC-2,V:POKEC,V:POKEC+2,V:POKEC+4,V
1090 FORX=60TO68STEP2:POKEX+C,V:NEXT:RETURN
1095 RETURN
1150 FORX=C-4TOC+8:POKEX,32:NEXT:FORX=C+60TOC+68:POKEX,32:NEXT
1170 FORX=1TO23:POKED+X,A(X):NEXT
1180 FORX=1TO5000:NEXT:FORX=1TO28:POKED+X,32:NEXT:FORE=1TO25
1190 FORX=1TO19:POKED+X,B(X):NEXTX:FORX=20TO24:POKED+X,32:NEXTX
1200 R1=INT(25*RND(R))+1:R2=INT(9*RND(R))+1
1300 FORX=ATOA+2*R2STEP2:POKEX,C(R1):NEXT
1325 GOSUB2000:R3=R2+1
1330 IFW=0THEN1325
1375 IFW=R3THENCN=CN+1:GOSUB7000
1400 IFW<>R3THENFORX=1TO1000:GOSUB7500
1500 IFR3=1THENGOSUB100:GOSUB5000:GOSUB8000
1510 IFR3=2THENGOSUB200:GOSUB5000:GOSUB8000
1520 IFR3=3THENGOSUB300:GOSUB5000:GOSUB8000
1530 IFR3=4THENGOSUB400:GOSUB5000:GOSUB8000
1540 IFR3=5THENGOSUB500:GOSUB5000:GOSUB8000
1550 IFR3=6THENGOSUB600:GOSUB5000:GOSUB8000
1560 IFR3=7THENGOSUB700:GOSUB5000:GOSUB8000
1570 IFR3=8THENGOSUB800:GOSUB5000:GOSUB8000
1580 IFR3=9THENGOSUB900:GOSUB5000:GOSUB8000
1590 IFR3=10THENGOSUB1000:GOSUB5000:GOSUB8000
1595 FORX=D1TOD1+7:POKEX,32:NEXT
1600 POKED+21,32:POKED+22,32:W=0:NEXTE
1800 FORX=0TO24:POKEX+D,32:NEXT
1850 PRINTN$;"YOU GOT"
1900 PRINTCN;"RIGHT OUT OF 25"
1950 PRINT"QUESTIONS!!":END
2000 POKEKE,127:F=255-PEEK(KE)
2117 IFF=0THEN2500
2150 IFF=128THENPOKED+21,49:W=1:GOSUB3000:RETURN
2200 POKED+21,FNZ(F):W=FNZ(F)-48:RETURN
2500 POKEKE,191:F=255-PEEK(KE)
2800 IFF=0THEN2000
2850 IFF<64THEN2000
2900 POKED+21,FNZ(F)+7:W=FNZ(F)-41:RETURN
3000 FORX=1TO100
3100 POKEKE,128:F=254-PEEK(KE)
3200 IFF=32THENPOKED+22,48:W=10:RETURN
3300 NEXT:RETURN
4900 DATA0,1,14,15,16,17,18,19,20,21,22,23,169,170,176,177,229
4950 DATA232,236,240,248,246,238,239,237
4960 DATA73,84,39,83,32,89,79,85,82,32,84,85,82,78,32,84,79,32
4970 DATA67,79,85,78,84
4980 DATA72,79,87,32,77,65,78,89,32,65,82,69,32,84,72,69,82,69,63
4990 DATA87,82,79,78,71,44,32,84,72,69,32,65,78,83,87,69,82,32
4991 DATA73,83,32,32,32,46
5000 FORX=1TO4000:NEXT:FORX=P-10TOP+480:POKEX,32:NEXT:RETURN
6000 GOSUB100:GOSUB5000:GOSUB200:GOSUB5000:GOSUB300:GOSUB5000
6100 GOSUB400:GOSUB5000:GOSUB500:GOSUB5000:GOSUB600:GOSUB5000
6200 GOSUB700:GOSUB5000:GOSUB800:GOSUB5000:GOSUB900:GOSUB5000
6300 GOSUB1000:GOSUB5000:RETURN
7000 FORX=-2TO24:POKEA+X,32:NEXT
7005 POKED1,82:POKED1+1,105:POKED1+2,103:POKED1+3,104:POKED1+4,116
7010 FORX=5TO7:POKED1+X,33:NEXT
7100 FORX=P-4+6*64TOP+7*64:POKEX,32:NEXT
7200 RETURN
7500 FORX=-2TO24:POKEA+X,32:NEXT
7505 FORX=1TO24:POKED+X,D(X):NEXT
7510 IFR3=10THENPOKED+22,49:POKED+23,48:GOTO7550
7520 POKED+22,R3+48
7550 FORX=P-4+6*64TOP+7*64:POKEX,32:NEXT
7700 RETURN
8000 FORX=-4TO8:POKEC+X,32:NEXT:FORX=60TO68:POKEC+X,32:NEXT
8100 RETURN

View file

@ -0,0 +1,266 @@
1 FORSC=1TO30:PRINT:NEXT:REM--SUSAN SULLIVAN**PRES TUTOR
2 PRINT"WANT INSTRUCTIONS?":INPUTD$:IF D$="Y"ORD$="YES"THEN50000
3 PRINT"INPUT RANDOM SEED":INPUTX:Z=0:DIMQ(100):Q(1)=0
4 R=INT(38*RND(X)+1):Z=Z+1:FOR SC=1TO30:PRINT:NEXT
5 IFZ=1THEN60050
6 GOTO60000
10 PRINT"WHICH PRESIDENT STARTED"
11 PRINT"THE TWO TERM TRADITION?"
12 PRINT"HE WAS ELECTED UN-"
13 PRINT"ANIMOUSLY."
14 GOTO450
20 PRINT"THIS MAN WAS THE FIRST"
21 PRINT"VICE PRESIDENT AND THE"
22 PRINT"SECOND PRESIDENT. HE"
23 PRINT"AVOIDED WAR WITH"
24 PRINT"EUROPE. WHO WAS HE?"
25 GOTO450
30 PRINT"WHO WAS THE PRESIDENT"
31 PRINT"DURING THE LOUISIANA"
32 PRINT"PURCHASE AND THE LEWIS"
33 PRINT"AND CLARK EXPEDITION?"
35 GOTO450
40 PRINT"THIS PRESIDENT WAS"
41 PRINT"CALLED 'THE FATHER OF"
42 PRINT"THE CONSTITUTION'. HE"
43 PRINT"WAS IN OFFICE DURING"
44 PRINT"THE WAR OF 1812."
45 GOTO450
50 PRINT"WHO WAS THE PRESIDENT"
51 PRINT"WHEN FLORIDA WAS"
52 PRINT"ACQUIRED? HE ALSO WROTE"
53 PRINT"AN IMPORTANT DOCTRINE."
55 GOTO450
60 PRINT"ELECTED BY THE HOUSE,"
61 PRINT"HE WAS THE SON OF A"
62 PRINT"FORMER PRESIDENT. WHO"
63 PRINT"WAS HE?"
65 GOTO450
70 PRINT"THIS PRESIDENT IS GIVEN"
71 PRINT"CREDIT FOR STARTING THE"
72 PRINT"SPOILS SYSTEM."
75 GOTO450
80 PRINT"WHICH PRESIDENT STARTED"
81 PRINT"AN INDEPENDENT TREASURY"
82 PRINT"SYSTEM AND OPPOSED THE"
83 PRINT"ANNEXING OF TEXAS?"
85 GOTO450
90 PRINT"WHICH PRESIDENT DIED"
91 PRINT"AFTER ONLY 31 DAYS IN"
92 PRINT"OFFICE? HE WAS A HERO"
93 PRINT"OF THE BATTLE OF"
94 PRINT"TIPPECANOE?"
95 GOTO450
100 PRINT"WHO WAS THE FIRST VICE"
101 PRINT"PRESIDENT TO BECOME PR-"
102 PRINT"ESIDENT BECAUSE OF THE"
103 PRINT"DEATH OF THE PRESIDENT?"
105 GOTO450
110 PRINT"WHO WAS IN OFFICE WHEN "
111 PRINT"THE STATES OF CAL.,UTAH"
112 PRINT"AND NEW MEXICO WERE"
113 PRINT"AQUIRED IN THE MEXICAN"
114 PRINT"WAR?"
115 GOTO450
120 PRINT"THIS PRESIDENT DIED IN"
121 PRINT"OFFICE AND WAS A HERO"
122 PRINT"OF THE MEXICAN WAR?"
125 GOTO450
130 PRINT"WHO WAS PRESIDENT WHEN"
131 PRINT"THE 1850 SLAVERY"
132 PRINT"COMPROMISE AND THE"
133 PRINT"FUGITIVE SLAVE ACT WERE"
134 PRINT"PASSED?"
135 GOTO450
140 PRINT"WHICH PRESIDENT REPEALED"
141 PRINT"THE MISSOURI COMPROMISE?"
145 GOTO450
150 PRINT"THIS PRESIDENT FAVORED"
151 PRINT"THE LECOMPTON CONST-"
152 PRINT"ITUTION FOR KANSAS?"
155 GOTO450
160 PRINT"WHO WAS THE FIRST PRE-"
161 PRINT"SIDENT TO BE ASSASSI-"
162 PRINT"NATED? HE WAS IN OFFICE"
163 PRINT"DURING THE CIVIL WAR?"
165 GOTO450
170 PRINT"WHO WAS THE FIRST PRE-"
171 PRINT"SIDENT TO BE IMPEACHED?"
172 PRINT"THE SENATE FAILED TO"
173 PRINT"CONVICT HIM BY ONE VOTE."
175 GOTO450
180 PRINT"THIS PRESIDENT WAS"
181 PRINT"PLAGUED BY A CORRUPT"
182 PRINT"ADMINISTRATION EVEN"
183 PRINT"THOUGH HE PERSONALLY"
184 PRINT"WAS HONEST?"
185 GOTO450
190 PRINT"WHICH PRESIDENT WAS"
191 PRINT"ELECTED BY A COMMITTEE"
192 PRINT"OF CONGRESS WHEN THE"
193 PRINT"RETURNS WERE DISPUTED?"
195 GOTO450
200 PRINT"WHICH PRESIDENT WAS"
201 PRINT"ASSASSINATED BECAUSE OF"
202 PRINT"HIS DISLIKE OF THE"
203 PRINT"POLITICAL SPOILS SYSTEM?"
205 GOTO450
210 PRINT"THIS PRESIDENT AQUIRED"
211 PRINT"PEARL HARBOR BASE AND"
212 PRINT"WAS A FORMER GOVERNOR "
213 PRINT"OF THE ALASKA TERRITORY."
215 GOTO450
220 PRINT"WHICH PRESIDENT MARRIED"
221 PRINT"WHILE IN THE WHITE"
222 PRINT"HOUSE?"
225 GOTO450
230 PRINT"WHO WAS THE TWENTY-
231 PRINT"THIRD PRESIDENT? HE HAD"
232 PRINT"FEWER POPULAR VOTES "
233 PRINT"THAN HIS OPPONENT."
235 GOTO450
240 PRINT"WHO WAS THE ONLY PRE-"
241 PRINT"SIDENT TO BE ELECTED TO"
242 PRINT"TWO NONCONSECUTIVE "
244 PRINT"TERMS?"
245 GOTO450
250 PRINT"WHO WAS PRESIDENT"
251 PRINT"DURING THE SPANISH-"
252 PRINT"AMERICAN WAR?"
255 GOTO450
260 PRINT"WHICH PRESIDENT WON A"
261 PRINT"NOBEL PEACE PRIZE FOR"
262 PRINT"MEDIATING THE PEACE"
263 PRINT"TREATY IN THE RUSSO-"
264 PRINT"JAPANESE WAR?"
265 GOTO450
270 PRINT"WHO WAS PRESIDENT WHEN"
271 PRINT"INCOME TAX WAS STARTED?"
275 GOTO450
280 PRINT"WHO WAS PRESIDENT DUR-"
281 PRINT"ING THE FIRST WORLD "
282 PRINT"WAR?"
285 GOTO450
290 PRINT"WHICH PRESIDENT WAS"
291 PRINT"INVOLVED IN THE TEAPOT"
292 PRINT"DOME SCANDAL?"
295 GOTO450
300 PRINT"WHICH PRESIDENT HAD THE MOTO 'KEEP COOL'?"
305 GOTO450
310 PRINT"WHO WAS PRESIDENT WHEN"
311 PRINT"THE STOCK MARKET"
312 PRINT"CRASHED IN THE 30'S?"
315 GOTO450
320 PRINT"WHO WAS THE ONLY PRE-"
321 PRINT"SIDENT TO BE ELECTED"
322 PRINT"MORE THAN TWICE?"
325 GOTO450
330 PRINT"WHO WAS THE PRESIDENT"
331 PRINT"DURING THE KOREAN WAR?"
335 GOTO450
340 PRINT"WHICH PRESIDENT WAS A"
341 PRINT"GENERAL IN WW II?"
345 GOTO450
350 PRINT"WHO WAS THE FIRST"
351 PRINT"CATHOLIC PRESIDENT?"
355 GOTO450
360 PRINT"WHICH PRESIDENT HAD A"
361 PRINT"'WAR ON POVERTY'?"
365 GOTO450
370 PRINT"WHO WAS PESIDENT WHEN"
371 PRINT"MAN LANDED ON THE MOON?"
375 GOTO450
380 PRINT"WHICH PRESIDENT WAS"
381 PRINT"ELECTED BY CONGRESS"
382 PRINT"UNDER THE 25TH AMENDMENT?"
385 GOTO450
390 PRINT"WHICH PRESIDENT IS KNOWN FOR HIS SMILE?"
395 GOTO450
450 FORI=1TOR:READB$:NEXTI
452 PRINT:PRINT:INPUT"ANS.";A$
455 PRINT:PRINT:PRINTB$" IS"
457 PRINT"THE CORRECT ANSWER."
458 FORV=1TO3000:NEXT
459 FORV=1TO20:PRINT:NEXT
460 RESTORE:GOTO4
1000 DATA"GEORGE WASHINGTON"
2000 DATA"JOHN ADAMS"
3000 DATA"THOMAS JEFFERSON"
4000 DATA"JAMES MADISON"
5000 DATA"JAMES MONROE"
6000 DATA"JOHN QUINCY ADAMS"
7000 DATA"ANDREW JACKSON"
8000 DATA"MARTIN VAN BUREN"
9000 DATA"WILLIAM H. HARRISON"
10000 DATA"JOHN TYLER"
11000 DATA"JAMES K. POLK"
12000 DATA"ZACHARY TAYLOR"
13000 DATA"MILLARD FILLMORE"
14000 DATA"FRANKLIN PIERCE"
15000 DATA"JAMES BUCHANAN"
16000 DATA"ABRAHAM LINCOLN"
17000 DATA"ANDREW JOHNSON"
18000 DATA"ULYSSES S. GRANT"
19000 DATA"RUTHERFORD B. HAYES"
20000 DATA"JAMES A. GARFIELD"
21000 DATA"CHESTER A. ARTHUR"
22000 DATA"GROVER CLEVELAND"
23000 DATA"BENJAMIN HARRISON"
24000 DATA"GROVER CLEVELAND"
25000 DATA"WILLIAM MC KINLEY"
26000 DATA"THEODRORE ROOSEVELT"
27000 DATA"WILLIAM TAFT"
28000 DATA"WOODROW WILSON"
29000 DATA"WARREN G. HARDING"
30000 DATA"CALVIN COOLIDGE"
31000 DATA"HERBERT C. HOOVER"
32000 DATA"FRANKLIN D. ROOSEVELT"
33000 DATA"HARRY S. TRUMAN"
34000 DATA"DWIGHT D. EISENHOWER"
35000 DATA"JOHN F. KENNEDY"
36000 DATA"LYNDON B. JOHNSON"
37000 DATA"RICHARD M. NIXON"
38000 DATA"GERALD R. FORD"
39000 DATA"JIMMY CARTER"
40000 B=INT(R/10)+1
40001 PRINT:PRINT:PRINT:PRINT
40010 ON B GOTO40300,40390,40500,40600
40300 ONRGOTO10,20,30,40,50,60,70,80,90,100
40390 S=R-9
40400 ONSGOTO100,110,120,130,140,150,160,170,180,190
40500 S=R-19
40550 ONSGOTO200,210,220,230,240,250,260,270,280,290
40600 S=R-29
40650 ONSGOTO300,310,320,330,340,350,360,370,380,390
50000 PRINT:PRINT"DIRECTIONS":PRINT:PRINT
50010 PRINT"TO START THE GAME TYPE"
50011 PRINT"IN A RANDOM NUMBER AND"
50012 PRINT"PUSH IN THE RETURN KEY."
50014 PRINT"A QUESTION WILL THEN BE"
50016 PRINT"TYPED BY THE COMPUTER."
50018 PRINT"YOU SHOULD TYPE IN THE"
50019 PRINT"ANSWER AND THEN PUSH"
50020 PRINT"THE RETURN KEY."
50040 PRINT:PRINT"IF YOU DO NOT KNOW THE"
50050 PRINT"ANSWER TYPE IN A ? AND"
50055 PRINT"THEN PUSH THE RETURN"
50058 PRINT"KEY.":PRINT:PRINT
50060 PRINT"WHEN YOU WANT TO STOP"
50065 PRINT"JUST PUSH THE RETURN"
50068 PRINT"KEY WITHOUT TYPING"
50070 PRINT"ANYTHING.":PRINT:GOTO3
60000 FOR I=1TOZ
60005 IFZ=21 THEN60999
60010 IF Q(I)=R THEN60100
60020 NEXTI
60050 Q(Z)=R
60060 GOTO40000
60100 Z=Z-1
60110 GOTO4
60999 PRINT:PRINT:PRINT
61000 PRINT"YOU HAVE ANSWERED 20"
61001 PRINT"QUESTIONS,IF YOU"
61002 PRINT"WISH TO CONTINUE JUST"
61003 PRINT"TYPE IN 'RUN' AFTER"
61004 PRINT"THE OK THAT THE COM-"
61005 PRINT"PUTER TYPES."

View file

@ -0,0 +1,78 @@
10 PRINT"SEAWOLFE
20 PRINT"COPYRYGHT 1978 BY RODGER OLSEN
30 INPUT"DO YOU WANT INSTRUCTIONS";A$:IFA$="YES"THEN700
40 IFA$<>"NO"THEN30
50 GP=53247:GI=3:LC=64:W=32:K1=5:K2=3:K3=65:K4=33:P=1
60 VB=600:IFPEEK(57088)<129THENVB=540:GOTO90
70 IFVB<>600THEN60
80 P=254:LC=32
90 G1=INT(GP+26*LC+.5*W):T=G1+1:T2=T:MP=GP+21*LC
100 FORX=1TO5:READG(X),ID(X):D(X)=ID(X):NEXT
110 S1=GP+15*LC:S3=GP+11*LC+W:S(1)=S1:S(2)=S1+1:S(3)=S3:S(4)=S3-1
120 INPUT"REGULAR(1) OR MASTER'S (2) GAME";G:POKE530,1:POKE57088,P
130 MN=MP:POKE56900,0:SD=GP+6*LC+8:S5=GP+7*LC+W+6:S(5)=S5:FM=-2
140 FORX=1TO32:PRINT:NEXT:FORX=1TO32:POKEGP+3*LX+X,233
150 POKEGP+29*LC+X,233
160 IFVB=540THENPOKEGP+X*LC,233:POKEGP+32+X*LC,233
170 POKEGP+X+13*LC,191:POKEGP+X+32*LC,233:NEXT
180 POKEGP+14*LC+20,193:POKEGP+14*LC+21,193:POKEGP+13*LC+21,13
190 P=PEEK(57088):IFVB=600THENP=255-P
200 IFP=K1ANDGI<5THENGI=GI+1
210 TURN=TURN+1:IFTURNS>300THEN660
220 IFP=K2ANDGI>1THENGI=GI-1
230 S$=STR$(300-TU)
240 FORX=2TOLEN(S$):POKESD+10+X,ASC(MID$(S$,X,1))
250 NEXT
260 POKESD+10+X,32
270 POKEG1,G(GI):POKEG1+2,G(GI)
280 IFP=K3ANDT=G1+1THENPOKET,32:MF=2*LC-3+GI:T=T-MF:POKET,16:GOTO300
290 IFP=K3ANDT2=G1+1THENPOKET2,32:M2=2*LC-3+GI:T2=T2-M2:POKET2,16
300 IFP=K4THENPOKE530,0:POKE56900,1:GOTO120
310 IFG=1THENFORX=1TO75:NEXT
320 POKES(1),32:POKES(3),32:POKES(5),32:S(1)=S(1)+1:S(5)=S(5)+FM
330 IFS(1)=S1+WTHENS(1)=S1:D(1)=ID(1):D(2)=ID(2)
340 S(2)=S(1)+1:S(3)=S(3)-1
350 IFS(3)=S3-WTHENS(3)=S3:D(3)=ID(3):D(4)=ID(4)
360 MC=MC+1:IFMC=5THENMC=1:GOSUB510
370 IFS(5)=S5ORS(5)=(S5-W-6)THENFM=-FM:D(5)=ID(5)
380 S(4)=S(3)-1:FORX=1TO5:POKES(X),D(X):NEXT
390 IFT=G1+1THENFORX=1TO50:NEXT:GOTO450
400 P=PEEK(T-LC):IFP<10THENGOSUB550 :GOTO450
410 IFG=1THENP=PEEK(T-LC-1):IFP<10THENGOSUB550
420 IFP=127THENGOSUB550 :GOTO450
430 IFT<GP+3*LCTHENPOKET,32:T=G1+1:POKET,16:GOTO450
440 POKET,32:T=T-MF:POKET,29
450 IFT2=G1+1THENFORX=1TO50:NEXT:GOTO190
460 P=PEEK(T2-LC):IFP<10THENGOSUB560 :GOTO190
470 IFG=1THENP=PEEK(T2-LC-1):IFP<10THENGOSUB560 :GOTO450
480 IFP=127THENGOSUB560 :GOTO190
490 IFT2<GP+3*LCTHENPOKET2,32:T2=G1+1:POKET2,16:GOTO190
500 POKET2,32:T2=T2-M2:POKET2,29:GOTO190
510 POKEMN,32:POKEMN+8,32:POKEMN+16,32:MN=MN+1
520 IFMN=MP+W+8THENMN=MP
530 POKEMN,127:IFSC>10THENPOKEMN+8,127:IFSC>30THENPOKEMN+16,127:RETURN
540 RETURN
550 POKET,32:Q=T-LC-3:T=G1+1:POKET,16:GOTO570
560 POKET2,32:Q=T2-LC-3:T2=G1+1:POKET2,16
570 D=42
580 FORX=1TO5:POKEQ+X,D:NEXT:IFD=42THEND=32:GOTO580
590 IFP=7ORP=8THEND(1)=32:D(2)=32
600 IFP=5ORP=6THEND(3)=32:D(4)=32
610 IFP=4THEND(5)=32:SC=SC+5
620 IFP=127THENRETURN
630 SC=SC+1:POKEG1+1,16:PS=SC:OS=0
640 IFSC>9THENOS=INT(SC/10):PS=(SC-10*OS)
650 POKESD,OS+48:POKESD+1,PS+48:POKESD+2,48:POKESD+3,48:RETURN
660 PRINT"FINAL SCORE "SC*100:A$="DROWNER'":IFSC>9THENA$="AMATEURS"
670 IFSC>15THENA$="MASTERS":IFSC>20THENA$="CAPTAIN'S"
680 IFSC>25THENA$="COMMODORE'S":IFSC>30THENA$="ADMIRALS"
690 PRINT"YOU EARNED YOUR "A$ "STRIPES":SC=0:TU=0:GOTO120
700 PRINT:PRINT:PRINT:PRINT"THE LEFT SHIFT AIMS THE TUBE TO THE LEFT
710 PRINT"THE RIGHT SHIFT AIMS THE TUBE RIGHT
720 PRINT"THE CTRL KEY FIRES A TORPEDOE-YOU CAN FIRE
730 PRINT"UP TOO 2 TORPEDOES AT A TIME
740 PRINT"THE SMALL SHIP IS 500 POINTS":PRINT"ALL OTHER SHIPS ARE 100
750 PRINT"HIT ESC TO END THE GAME EARLY
760 INPUT"READY TO START";A$
765 PRINT:PRINT:PRINT:GOTO50
770 DATA189,7,201,8,140,6,200,5,190,4

View file

@ -0,0 +1,85 @@
10 PRINT:PRINT:PRINT"TANK FOR TWO":PRINT
20 PRINT"COPYRIGHT R. OLSEN 1978
30 T1=3:T2=7:POKE530,1::S(1)=54429:S(2)=54403
40 FORX=1TO8:READTA(X):NEXT:P1=53916:P2=54019
50 FORX=0TO9:READMF(X):NEXT
60 FORX=0TO9:READBD(X):NEXT:L=64
70 C1=53279:C2=55265:P0=128:PT=4:FORX=1TO5:READUP(X):NEXT
80 FORX=1TO7:READAC(X):NEXT
90 VB=600:IFPEEK(57088)<128THENVB=540:GOTO150
100 FORX=0TO9:READMF(X):NEXT:L=32
110 P0=127:PT=251:S(1)=53765:S(2)=53785:FORX=1TO5
120 READUP(X):NEXT
130 FORX=1TO7:READAC(X):NEXT:P1=53766:P2=53592
140 C1=53284:C2=54204
150 INPUT"DO YOU WANT DIRECTION";A$:IFA$="YES"THEN610
160 FORX=C1TOC2:POKEX,32:IFRND(1)>.96THENPOKEX,161
170 NEXT
180 POKE56900,0:POKE530,1:B=161:KB=57088
190 FORX=1TO5:FORY=1TO5:POKEUP(Y)+X,B:NEXTY:NEXTX
200 FORX=1TO5:FORY=1TO7:POKEAC(Y)+L*X,B:NEXTY,X
210 FORX=1TOL:POKEC1+X,B:POKEC2-X,B:NEXT
220 FORX=1TO32:POKEC1+X*L,B:POKEC2-X*L,B:NEXT
230 POKEKB,P0:PK=PEEK(KB):IFVB=600THENPK=255-PK
240 IFPK=128THENT2=T2-1:IFT2=0THENT2=8
250 M1=MF(T1):M3=MF(T2)
260 IFPK=32THENT2=T2+1:IFT2=9THENT2=1
270 IFPK=64ANDF2=0THENB2=P2:F2=1:M4=MF(T2)
280 IFPK=160ANDPEEK(P2+MF(T2))=32THENPOKEP2,32:P2=P2+MF(T2)
290 IFPK=192ANDF2=0THENB2=P2-MF(T2-1):F2=1
300 IFPK=96ANDF2=0THENB2=P2-MF(T2+1):F2=1
310 POKEP2,TA(T2)
320 POKEKB,PT:PK=PEEK(KB):IFVB=600THENPK=255-PK
330 IFPK=8THENT1=T1-1:IFT1=0THENT1=8
340 IFPK=10ANDPEEK(P1+MF(T1))=32THENPOKEP1,32:P1=P1+MF(T1)
350 IFPK=2THENT1=T1+1:IFT1=9THENT1=1
360 IFPK=4ANDF1=0THENF1=1:B1=P1:SM=MF(T2)
370 IFPK=6ANDF1=0THENB1=P1-MF(T1+1):F1=1
380 IFPK=12ANDF1=0THENB1=P1-MF(T1-1):F1=1
390 POKEP1,TA(T1)
400 FORX=1TO3:IFF1=0THEN460
410 IFB1<>P1THENPOKEB1,32
420 P=PEEK(B1+M1):IFP=161THENF1=0:GOTO460
430 B1=B1+M1:POKEB1,BD(T1)
440 IFP=TA(T2)THENF1=0:B1=P1:S1=S1+1:GOTO460
450 IFB1<C1ORB1>C2THENF1=0
460 IFF2=0THEN520
470 IFB2<>P2THENPOKEPB2,32
480 P=PEEK(B2+M3):IFP=161THENF2=0:GOTO520
490 B2=B2+M3:POKEB2,BD(T2)
500 IFP=TA(T1)THENF2=0:B2=P2:S2=S2+1
510 IFB2<C1ORB2>C2THENF2=0
520 IFB2<>P2THENPOKEB2,32
530 IFB1<>P1THENPOKEB1,32
540 NEXTX
550 DS=S2:IFS2>10THENDS=S2-10:POKES(2)-1,49
560 POKES(2),DS+48:IFDS=10THENPOKES(2),48
570 DS=S1:IFS1>10THENDS=S1-10:POKES(1)-1,49
580 POKES(1),DS+48:IFDS=10THENPOKES(1),48
590 IFS1>19ORS2>19THEN810
600 GOTO230
610 PRINT:PRINT:PRINT:PRINT"PLAYER 1 USES KEYS 1,2, AND 3
620 PRINT"PLAYER 2 USES KEYS N,M, AND<
630 PRINT"1,2,N, AND< ARE DIRECTION KEYS
640 PRINT"PRESSING BOTH DIRECTION KEYS MOVES YOU FORWARD
650 PRINT:PRINT"KEYS 2 AND M ARE FIRE CONTROL KEYS
660 PRINT"PRESSING THEM ALONE FIRES STRAIGHT AHEAD
670 PRINT"PRESSING THEM WITH A DIRECTION KEY SHOOTS
680 PRINT"TO THE SIDE
690 PRINT"THE MISSLE IS STEERABLE AFTER IT IS SHOT
700 INPUT"INPUT A NUMBER TO START";X:GOTO160
710 DATA248,249,250,251,252,253,254,255
720 DATA -65,-64,-63,1,65,64,63,-1,-65,-64,-63
730 DATA139,189,132,190,139,189,132,190,139
740 DATA53633,53526,54618,54411,54793
750 DATA53216,53233,53848,53702,54411,54939,54406
760 DATA-33,-32,-31,1,33,32,31,-1,-33,-32
770 DATA53845,53965,53956,53609,53845,53968,54006
780 DATA53641,53359,53415,53782,54005
790 FORX=0TO9:READBD(X):NEXT:L=64
800 RETURN
810 IFS1>19THENFORX=1TO32:PRINT"TANK 1 WINS!":NEXTX
820 IFS2>19THENFORX=1TO32:PRINTTAB(15)"TANK 2 WINS!":NEXTX
830 S1=0:S2=0
840 RESTORE:GOTO30

View file

@ -0,0 +1,7 @@
VisiCalc History
---
See [http://www.bricklin.com/history/vcexecutable.htm](http://www.bricklin.com/history/vcexecutable.htm)
VisiCalc License
---
See [http://www.bricklin.com/history/vclicense.htm](http://www.bricklin.com/history/vclicense.htm)

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.15.3/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 -->
<versionInternal>VC-176Y2-IBM-TEST</versionInternal>
<type>Application</type>
<category>Productivity</category>
<company>Software Arts</company>
<author href="http://www.bricklin.com/history/sai.htm">Dan Bricklin</author>
<author href="http://www.frankston.com/public/?name=ImplementingVisiCalc">Bob Frankston</author>
<releaseDate>December 16, 1981</releaseDate>
<license href="http://www.bricklin.com/history/vclicense.htm">Lotus Development</license>
<machine href="/configs/pc/machines/5150/mda/64kb/machine.xml" state="/apps/pc/1981/visicalc/state.json"/>
<disk id="disk01" dir="/apps/pc/1981/visicalc/private/" href="/apps/pc/1981/visicalc/disk.json">
<file>VC.COM</file>
<file dir="../">README.md</file>
<link href="http://www.bricklin.com/history/vclicense.htm">VisiCalc License</link>
</disk>
</manifest>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.15.3/manifest.xsl"?>
<manifest type="software">
<title>Executive Suite</title>
<version/>
<type>Game</type>
<category>Text Simulation</category>
<author>Armonk Corporation</author>
<releaseDate>1982</releaseDate>
<machine href="/configs/pc/machines/5160/mda/256kb/fake188/machine.xml" state="/apps/pc/1982/esuite/state.json"/>
<disk id="disk01" dir="/apps/pc/1982/esuite/private/" href="/apps/pc/1982/esuite/disk.json">
<name>Executive Suite (1982)</name>
<file>esuite.com</file>
<file>game.dat</file>
<link href="http://www.mobygames.com/game/executive-suite">MobyGames</link>
</disk>
</manifest>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,33 @@
CACHE MANIFEST
/apps/pc/1985/rogue/manifest.xml
/versions/pcjs/1.13.6/manifest.xsl
/versions/pcjs/1.13.6/common.xsl
/versions/pcjs/1.13.6/components.xsl
/configs/pc/machines/5160/cga/640kb/machine.xml
/configs/pc/keyboards/minimal-f1-f10.xml
/configs/pc/disks/library.xml
/disks/pc/dos/microsoft/3.20/manifest.xml
/disks/pc/dos/microsoft/4.0M/manifest.xml
/disks/pc/tools/microsoft/BASIC/manifest.xml
/disks/pc/tools/microsoft/MSC-048014.400/manifest.xml
/disks/pc/tools/microsoft/MASM-016014.400/manifest.xml
/disks/pc/tools/microsoft/MOUSE-000199.500/manifest.xml
/disks/pc/apps/lotus/123/1.0a/manifest.xml
/disks/pc/apps/microsoft/word/2.0c/manifest.xml
/disks/pc/apps/microsoft/word/3.0/manifest.xml
/disks/pc/apps/microsoft/word/5.0/manifest.xml
/apps/pc/1981/visicalc/manifest.xml
/apps/pc/1982/esuite/manifest.xml
/apps/pc/1987/thinktank/manifest.xml
/apps/pc/1992/moria/manifest.xml
/versions/pcjs/1.13.6/common.css
/versions/pcjs/1.13.6/components.css
/versions/pcjs/1.13.6/pc.js
/devices/pc/hdc/ibm-xebec-1982.json
/devices/pc/basic/ibm-basic-1.10.json
/devices/pc/bios/5160/1982-11-08.json
/devices/pc/video/ibm-mda-cga.json
/disks/pc/dos/ibm/2.00/PCDOS200-DISK1.json
/disks/pc/dos/ibm/2.00/PCDOS200-DISK2.json
/apps/pc/1985/rogue/state.json
/apps/pc/1985/rogue/disk.json

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.15.3/manifest.xsl"?>
<manifest type="software">
<title>Rogue</title>
<version/>
<type>Game</type>
<category>ASCII Adventure</category>
<creator>Michael Toy</creator>
<creator>Glenn Wichman</creator>
<creationDate>1980</creationDate>
<releaseDate>1985</releaseDate>
<author>Ken Arnold</author>
<author>Jon Lane</author>
<author>Michael Toy</author>
<disk id="disk01" dir="/apps/pc/1985/rogue/private/" href="/apps/pc/1985/rogue/disk.json">
<name>Rogue (1985)</name>
<file>MKOPT.EXE</file>
<file>ROGUE.COM</file>
<file>ROGUE.EXE</file>
<file>ROGUE.OPT</file>
<file>ROGUE.PIC</file>
<file>ROGUE.SCR</file>
</disk>
<machine href="/configs/pc/machines/5160/cga/640kb/machine.xml" state="/apps/pc/1985/rogue/state.json"/>
</manifest>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.15.3/manifest.xsl"?>
<manifest type="software">
<title>ThinkTank</title>
<version>2.41NP</version>
<type>Application</type>
<category>Productivity</category>
<company>Living Videotext</company>
<releaseDate>September 25, 1987</releaseDate>
<disk id="disk01" dir="/apps/pc/1987/thinktank/private/" href="/apps/pc/1987/thinktank/disk.json">
<name>ThinkTank 2.41NP</name>
<file>AUTOEXEC.BAT</file>
<file>READ_ME.DB</file>
<file>READ_ME.SAV</file>
<file>TANK.EXE</file>
<file>TANKCLIP.BRD</file>
<file>TANKOPTS.DAT</file>
<file>TMPLATES</file>
<link href="http://outliners.scripting.com/thinkTank2Pc.html">Outliners.com</link>
</disk>
<machine href="/configs/pc/machines/5160/cga/640kb/machine.xml" state="/apps/pc/1987/thinktank/state.json"/>
</manifest>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.15.3/manifest.xsl"?>
<manifest type="software">
<title>The Dungeons of Moria</title>
<version>4.872</version>
<type>Game</type>
<category>ASCII Adventure</category>
<creator>
<name>Robert Alan Koeneke</name>
</creator>
<creationDate>March 25, 1983</creationDate>
<releaseDate>November 1, 1988</releaseDate>
<author>
<name>D. G. Kneller</name>
<desc>MSDOS port</desc>
</author>
<disk id="disk01" dir="/apps/pc/1988/moria/private/">
<name>Moria v4.872</name>
<file>CONFIG.DOC</file>
<file>GOD</file>
<file>MADNESS1</file>
<file>MORIA.CNF</file>
<file>MORIA.DOC</file>
<file>MORIA.EXE</file>
<file>MORIA.SCR</file>
<file>MORIACHR.DIE</file>
<file>ORC2</file>
<file>PKZIP.EXE</file>
</disk>
</manifest>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/pcjs/1.15.3/manifest.xsl"?>
<manifest type="software">
<title>The Dungeons of Moria</title>
<version>5.5</version>
<type>Game</type>
<category>ASCII Adventure</category>
<creator>
<name>Robert Alan Koeneke</name>
</creator>
<creationDate>March 25, 1983</creationDate>
<releaseDate>August 12, 1992</releaseDate>
<author>
<name>Robert A. Koeneke</name>
<position>Student</position>
<org>University of Oklahoma</org>
</author>
<author>
<name>Jimmey W. Todd Jr.</name>
<position>Student</position>
<org>University of Oklahoma</org>
</author>
<author href="mailto:grabiner@math.harvard.edu">
<name>David J. Grabiner</name>
<org>Harvard University</org>
</author>
<author href="mailto:wilson@kithrup.com">
<name>James E. Wilson</name>
<org>Cygnus Support</org>
</author>
<contributor>
<name>D. G. Kneller</name>
<desc>MSDOS Moria port, reduced map display, 16 bit integers</desc>
</contributor>
<contributor>
<name>Christopher J. Stuart</name>
<desc>recall, options, inventory, running code, etc.</desc>
</contributor>
<contributor>
<name>Curtis McCauley</name>
<desc>Macintosh Moria port for MPW C</desc>
</contributor>
<contributor>
<name>Stephen A. Jacobs</name>
<desc>Atari ST Moria port for MW C</desc>
</contributor>
<contributor>
<name>William Setzer</name>
<desc>object naming code</desc>
</contributor>
<contributor>
<name>David J. Grabiner</name>
<desc>numerous bug reports, consistency checks, etc</desc>
</contributor>
<contributor>
<name>Dan Bernstein</name>
<desc>UNIX hangup signal fix, many bug fixes</desc>
</contributor>
<contributor>
<name>Corey Gehman</name>
<desc>Amiga Moria port</desc>
</contributor>
<contributor>
<name>Ralph Waters</name>
<desc>VMS support code, IBM-PC Turbo C bug fixes</desc>
</contributor>
<contributor>
<name>Johsua Delahunty</name>
<desc>VMS support code</desc>
</contributor>
<contributor>
<name>Todd Pierzina</name>
<desc>VMS support code</desc>
</contributor>
<contributor>
<name>Joseph Hall</name>
<desc>line of sight code, monster compiler</desc>
</contributor>
<contributor>
<name>Eric Vaitl</name>
<desc>PC-Curses replacement for Turbo C</desc>
</contributor>
<contributor>
<name>Scott Kolodzieski</name>
<desc>Atari ST port for Gnu C</desc>
</contributor>
<contributor>
<name>Hildo Biersma</name>
<desc>Atari ST port for Turbo C</desc>
</contributor>
<contributor>
<name>Ben Schreiber</name>
<desc>Macintosh port for Think C</desc>
</contributor>
<disk id="disk01" dir="/apps/pc/1992/moria/bin/" href="/apps/pc/1992/moria/disk.json">
<name>Moria 5.5</name>
<file>EXP.DOC</file>
<file>MORIA.CNF</file>
<file>MORIA1.TXT</file>
<file>MORIA2.TXT</file>
<file>MORIA88.EXE</file>
<file>ORIGCMDS.HLP</file>
<file>OWIZCMDS.HLP</file>
<file>ROGLCMDS.HLP</file>
<file>RWIZCMDS.HLP</file>
<file>SPELLS.DOC</file>
<file>VERSION.HLP</file>
<file>WELCOME.HLP</file>
<file>SCORES</file>
</disk>
<machine href="/configs/pc/machines/5160/cga/640kb/machine.xml" state="/apps/pc/1992/moria/state.json"/>
</manifest>

File diff suppressed because one or more lines are too long

15
apps/pc/README.md Normal file
View file

@ -0,0 +1,15 @@
IBM PC Application Archives
---
Below are selected demos of classic IBM PC applications running on [PCjs](/docs/about/).
* [VisiCalc (1981)](1981/visicalc/)
* [Executive Suite (1982)](1982/esuite/)
* [Rogue (1985)](1985/rogue/)
* [ThinkTank (1987)](1987/thinktank/)
* The Dungeons of Moria (1988, [1992](1992/moria/))
All of these demos are driven by simple XML manifest files. Click one and use your web browser's "View Source"
command to see the raw manifest. Learn more about PCjs manifest files [here](/apps/).
You can browse the rest of our software archives by year. There is no search capability at this time.

302
bin/README Normal file
View file

@ -0,0 +1,302 @@
/*
* Copyright 2009 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// Contents
//
The Closure Compiler performs checking, instrumentation, and
optimizations on JavaScript code. The purpose of this README is to
explain how to build and run the Closure Compiler.
The Closure Compiler requires Java 7 or higher.
http://www.java.com/
//
// Building The Closure Compiler
//
There are three ways to get a Closure Compiler executable.
1) Use one we built for you.
Pre-built Closure binaries can be found at
http://code.google.com/p/closure-compiler/downloads/list
2) Check out the source and build it with Apache Ant.
First, check out the full source tree of the Closure Compiler. There
are instructions on how to do this at the project site.
http://code.google.com/p/closure-compiler/source/checkout
Apache Ant is a cross-platform build tool.
http://ant.apache.org/
At the root of the source tree, there is an Ant file named
build.xml. To use it, navigate to the same directory and type the
command
ant jar
This will produce a jar file called "build/compiler.jar".
3) Check out the source and build it with Eclipse.
Eclipse is a cross-platform IDE.
http://www.eclipse.org/
Under Eclipse's File menu, click "New > Project ..." and create a
"Java Project." You will see an options screen. Give the project a
name, select "Create project from existing source," and choose the
root of the checked-out source tree as the existing directory. Verify
that you are using JRE version 7 or higher.
Eclipse can use the build.xml file to discover rules. When you
navigate to the build.xml file, you will see all the build rules in
the "Outline" pane. Run the "jar" rule to build the compiler in
build/compiler.jar.
//
// Running The Closure Compiler
//
Once you have the jar binary, running the Closure Compiler is straightforward.
On the command line, type
java -jar compiler.jar
This starts the compiler in interactive mode. Type
var x = 17 + 25;
then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux)
and "Enter" again. The Compiler will respond:
var x=42;
The Closure Compiler has many options for reading input from a file,
writing output to a file, checking your code, and running
optimizations. To learn more, type
java -jar compiler.jar --help
You can read more detailed documentation about the many flags at
http://code.google.com/closure/compiler/docs/gettingstarted_app.html
//
// Compiling Multiple Scripts
//
If you have multiple scripts, you should compile them all together with
one compile command.
java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js
The Closure Compiler will concatenate the files in the order they're
passed at the command line.
If you need to compile many, many scripts together, you may start to
run into problems with managing dependencies between scripts. You
should check out the Closure Library. It contains functions for
enforcing dependencies between scripts, and a tool called calcdeps.py
that knows how to give scripts to the Closure Compiler in the right
order.
http://code.google.com/p/closure-library/
//
// Licensing
//
Unless otherwise stated, all source files are licensed under
the Apache License, Version 2.0.
-----
Code under:
src/com/google/javascript/rhino
test/com/google/javascript/rhino
URL: http://www.mozilla.org/rhino
Version: 1.5R3, with heavy modifications
License: Netscape Public License and MPL / GPL dual license
Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an
implementation of JavaScript for the JVM. The JavaScript parser and
the parse tree data structures were extracted and modified
significantly for use by Google's JavaScript compiler.
Local Modifications: The packages have been renamespaced. All code not
relevant to parsing has been removed. A JsDoc parser and static typing
system have been added.
-----
Code in:
lib/rhino
Rhino
URL: http://www.mozilla.org/rhino
Version: Trunk
License: Netscape Public License and MPL / GPL dual license
Description: Mozilla Rhino is an implementation of JavaScript for the JVM.
Local Modifications: Minor changes to parsing JSDoc that usually get pushed
up-stream to Rhino trunk.
-----
Code in:
lib/args4j.jar
Args4j
URL: https://args4j.dev.java.net/
Version: 2.0.16
License: MIT
Description:
args4j is a small Java class library that makes it easy to parse command line
options/arguments in your CUI application.
Local Modifications: None.
-----
Code in:
lib/guava.jar
Guava Libraries
URL: http://code.google.com/p/guava-libraries/
Version: 15.0
License: Apache License 2.0
Description: Google's core Java libraries.
Local Modifications: None.
-----
Code in:
lib/jsr305.jar
Annotations for software defect detection
URL: http://code.google.com/p/jsr-305/
Version: svn revision 47
License: BSD License
Description: Annotations for software defect detection.
Local Modifications: None.
-----
Code in:
lib/jarjar.jar
Jar Jar Links
URL: http://jarjar.googlecode.com/
Version: 1.1
License: Apache License 2.0
Description:
A utility for repackaging Java libraries.
Local Modifications: None.
----
Code in:
lib/junit.jar
JUnit
URL: http://sourceforge.net/projects/junit/
Version: 4.10
License: Common Public License 1.0
Description: A framework for writing and running automated tests in Java.
Local Modifications: None.
---
Code in:
lib/protobuf-java.jar
Protocol Buffers
URL: http://code.google.com/p/protobuf/
Version: 2.4.1
License: New BSD License
Description: Supporting libraries for protocol buffers,
an encoding of structured data.
Local Modifications: None
---
Code in:
lib/ant.jar
lib/ant-launcher.jar
URL: http://ant.apache.org/bindownload.cgi
Version: 1.8.1
License: Apache License 2.0
Description:
Ant is a Java based build tool. In theory it is kind of like "make"
without make's wrinkles and with the full portability of pure java code.
Local Modifications: None
---
Code in:
lib/json.jar
URL: http://json.org/java/index.html
Version: JSON version 20090211
License: MIT license
Description:
JSON is a set of java files for use in transmitting data in JSON format.
Local Modifications: None
---
Code in
lib/mockito-core.jar
URL: https://code.google.com/p/mockito
Version: 1.9.5
License: MIT license
Description:
Mockito is an open source testing framework for Java. The framework allows the creation of Test Double objects (called "Mock Objects") in automated unit tests for the purpose of Test-driven Development (TDD) or Behavior Driven Development (BDD).
Local Modifications: None
---
Code in
lib/objenesis.jar
URL: http://objenesis.org
Version: 1.2
License: Apache 2.0 license
Description:
Depended by lib/mockito-core.jar, not used directly.
Local Modifications: None

27
bin/README.md Normal file
View file

@ -0,0 +1,27 @@
Bin
---
This where all the server-side (PHP) code used to reside. I've since deleted all the PHP code from the project,
because I more-or-less finished porting it all to server-side JavaScript, in assorted moduless located in
[my_modules](/my_modules/). But of course, all the PHP code is still in Git's history, so you can always dig it up
again if you really want it.
All that remains here is the version of Google's Closure Compiler (and its associated [README](README)) that I use
to build the client-side JavaScript files -- not because I have any attachment to this particular version, but because
you never know if an update will break something unexpectedly.
So, just like all the Node modules that I depend on, frozen in time by the version numbers listed in
[package.json](../package.json), I don't update until I'm prepared to spend some time running a bunch of regression
tests. Which is tedious, because I don't really have a regression test suite yet. So I don't like to update my
dependencies very often.
Azure Files
---
[IISNode.yml]() was a file that needed to be in the root directory when I was running the website on Microsoft Azure
(formerly Windows Azure). I didn't really want it in the root anymore, because I've since moved the website to AWS
Elastic Beanstalk, which has no use for it. But, just in case I decide to use Azure again, I've saved that file here.
AWS Files
---
[awspush.sh]() is a script that saves various logs from the current AWS instance before pushing out a new release,
since invoking `git aws.push` will generally lose any files on the current AWS instance's volume. It relies on
[awsget.sh]() to save copies of the remote logs in [Logs](../logs/).

BIN
bin/compiler.jar Normal file

Binary file not shown.

50
blog/2013/11/README.md Normal file
View file

@ -0,0 +1,50 @@
A Blog That's Not A Blog
---
As you may have noticed (or not), the [JSMachines](http://jsmachines.net/) website had a very modest makeover
recently.
Originally, the site was a smattering of HTML files, along with some XML files that I was rendering as HTML
using some simple XSL stylesheets. However, I was tired of having one set of files for the website to explain
things and a different set of files on [GitHub](http://github.com) that explained other things -- many
of those things being the SAME things.
So this month, I decided to eliminate all the HTML files. As you browse the site, you're simply navigating
folders from the **GitHub** project and reading the project's **README.md** files.
There's a single PHP script responsible for transforming a folder's default document (either **README.md**
or **machine.xml**) to HTML, as well as displaying the current directory across the top and a directory listing
down the left-hand side.
The same script provides support for a subset of the [Markdown](http://daringfireball.net/projects/markdown/)
syntax, which is more than sufficient to handle all the site's **README.md** files. I probably should
have used a third-party Markdown library, but this was more educational, and it was easy to add extra features,
like the ability to embed JavaScript machines with a single Markdown-style link; eg:
[IBM PC](/configs/pc/machines/5150/mda/64kb/ "PCjs:ibm5150")
The script takes care of the rest, adding the appropriate stylesheets and PCjs scripts automatically.
I had more grandiose plans, including a command-line prompt written in JavaScript that would allow you to
navigate the site exactly as you would an IBM PC hard drive from a "DOS prompt", and I may try something
like that later, but don't hold your breath.
I've tried to improve the organization of all the [Machine Configuration Files](/configs/pc/machines/) as well.
The variety of configurations was getting out of hand. It's a bit tidier now, but there's still room for
improvement.
My workflow is improving, too. I'm more comfortable with [GitHub](http://github.com) now,
and I recently switched from Eclipse to JetBrains' [WebStorm](http://www.jetbrains.com/webstorm) (well,
actually [PhpStorm](http://www.jetbrains.com/phpstorm), since it's a superset of WebStorm, although I did start
with WebStorm), and the new development environment is feeling pretty good now. I've had zero problems with
[JetBrains](http://www.jetbrains.com) products and I'm seriously impressed with their quality and completeness,
so I have no qualms about moving from the "free" Eclipse platform to the $99 PhpStorm IDE.
The nice thing about the new GitHub-centric approach is that it's easy to "push" changes to both the repository
and the website. I update one or more **README.md** files, "Commit and Push" from the IDE, then "pull" from GitHub
on the web server.
This so-called blog is more of the same: **README.md** files in a series of folders. The only question now:
will this actually evolve into a series...?
*[@jeffpar](http://twitter.com/jeffpar)*
*November 20, 2013*

13
blog/2014/01/README.md Normal file
View file

@ -0,0 +1,13 @@
New Year, New Directions
---
Initial goals for 2014 include:
- Setting up a new web server running node.js, using either AWS, Google Compute Engine or Windows Azure;
- Porting this project to work with node.js, which includes rewriting all the PHP code as server-side JavaScript;
- Deciding whether to separate PCjs from C1Pjs for the new web site, or simply make PCjs.org a mirror of jsmachines.net;
- Deciding how best (or even whether) to accomodate PCjs running from both **node** and **non-node** web servers.
I guess we'll learn more as the year progresses.
*[@jeffpar](http://twitter.com/jeffpar)*
*January 20, 2014*

50
blog/2014/03/30/README.md Normal file
View file

@ -0,0 +1,50 @@
Running on Azure
---
Publishing a Node-based site to [Azure](http://azure.com) was painless, thanks to their friendly web portal and
GitHub integration. Getting a fully operational site, however, took a bit more time.
Unfortunately, because Azure's underlying server technology is Windows-based (IIS), some of the same Windows/Unix
portability problems that have plagued us for decades still plague us today: **carriage returns** and **backslashes**.
Even though all PCjs text files in my project contain only linefeeds, IIS would serve them up with CR/LF
instead. I first noticed this on the client side, when an XML file retrieved via *XMLHttpRequest()* came back
full of CR/LFs, and later on the server side, when *fs.readFile()* returned a Markdown file filled with CR/LFs.
I wondered if the CR/LF transformation had happened when Azure pulled all my files from GitHub, because
while I can understand some whitespace inconsistencies across web servers, I would never expect file system calls
on the server to modify file contents.
I finally confirmed that the files were indeed modified on the server, by using Azure's FTP browser. For example,
[minimal.xml](/configs/pc/keyboards/minimal.xml) is currently 622 bytes locally, but on the Azure server, the
reported size is 632 bytes -- one extra CR for each of the file's 10 lines. After a little more digging, I
[learned something new](http://git-scm.com/book/ch7-1.html#Formatting-and-Whitespace) about **Git**: it has a
setting called `core.autocrlf` which, for me on OS X, defaults to `input` (meaning "convert CR/LF to LF on commit
but do NOT convert LF back to CR/LF on check-out"). But Azure apparently sets this to `true`, causing all LFs to be
converted to CR/LF.
Regarding slashes, even when path components contained only slashes, *path.join()* would return paths with
backslashes. And unfortunately, this behavior varies from Node module to module. For example, I use the NPM
[glob](https://www.npmjs.org/package/glob) module, and even when the input path to *glob()* contains backslashes,
its output paths do not.
In the process of fixing those portability issues, I also had some trouble getting Azure logging to work as
documented. Setting `loggingEnabled: true` in **/IISNode.yml** would generate logs in **/site/wwwroot/iisnode/**,
but the logs were numerous and poorly organized.
And the Azure command-line tool that was *supposed* to enable real-time log-streaming to the console:
azure site log tail pcjs
would happily report:
Welcome, you are now connected to log-streaming service
but it would NEVER display anything but deployment information. Instead, I had to browse the log files using Azure's
"FTP DIAGNOSTIC LOGS" link on the web portal -- which presents the logs as one big, ugly, fragmented mess:
![Azure Logs](iisnode_logs.png)
Sigh. But at least the site is up and fully operational now.
*[@jeffpar](http://twitter.com/jeffpar)*
*March 30, 2014*

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

41
blog/2014/03/31/README.md Normal file
View file

@ -0,0 +1,41 @@
Browser Compatibility Woes
---
While JavaScript has been doing a good job of delivering on the old "write once, run everywhere" promise that its
[unrelated namesake](http://www.java.com) coined, the "hook once, deliver everywhere" promise seems less fulfilled.
Not that anyone ever made such a promise.
Specifically, I'm talking about DOM events. Take the HTML5 &lt;canvas&gt; element, for example. If I give
it a `contenteditable="true"` attribute, it will play nicely with my JavaScript app in a Mobile Safari browser,
by popping up the device's soft keyboard in response to the canvas element receiving focus (ie, when you tap on it).
The Silk browser on a Kindle Fire, however, is another story -- it acts like it has no idea what `contenteditable`
means. Even if I display an actual &lt;input&gt; text field alongside the &lt;canvas&gt;, and attach all the same
input event handlers to the text field instead of the canvas, the Kindle Fire's soft keyboard will pop up, but my
input event handlers still won't fire.
I've done what testing I can with the Android SDK and the "Android Virtual Device Manager", and in general, support
looks fine -- you click/tap on the PC's screen, the soft keyboard pops up, and typing works. So I guess Silk is just
an outlier. I'm not sure what I'll do about it yet (or even what I can do).
![PCjs in AVD](avd_tablet.png)
---
Here's another issue I've yet to resolve.
When Apple released iOS 7.0, PCjs went from being a rock-solid web application on
2nd/3rd/4th-generation iPads to a very flaky web application. It's still rock-solid on 5th-generation iPads
(the iPad Air and iPad Mini w/Retina Display), and so I suspect a bug in Apple's JavaScript engine that's specific
to their older A5 processor.
It may be possible to work around the bug, but I haven't yet isolated exactly what code
sequence(s) are failing. For now, this is the most serious unresolved PCjs bug I'm aware of.
---
If you're having a problem (or trouble with a device) that I've not already mentioned, [let me know](mailto:Jeff@pcjs.org).
Thanks.
*[@jeffpar](http://twitter.com/jeffpar)*
*March 31, 2014*

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

17
blog/2014/04/01/README.md Normal file
View file

@ -0,0 +1,17 @@
The Latest in Emulator Technology
---
Announcing **InternetJS: The Internet Emulator**, the world's smallest JavaScript application capable of emulating the entire Internet.
And like all PCjs applications, there's nothing to install. It runs safely and securely from any web browser.
Check out the ALPHA release demo below.
<iframe width="720" height="512" src="http://bing.com/" style="border-webkit-transform:scale(0.5);-moz-transform-scale(0.5);border:1px solid black;border-radius:15px;overflow:auto;width:100%;background-color:#FAEBD7;"></iframe>
Disclaimer: InternetJS may not be suitable for everyone. Ask your doctor if InternetJS is right for you. Side-effects may include:
- Increased awareness
- Loss of appetite after eating large meals
- Inability to forget things you never wanted to remember
*[@jeffpar](http://twitter.com/jeffpar)*
*April 1, 2014*

20
blog/2014/04/12/README.md Normal file
View file

@ -0,0 +1,20 @@
What's New in 1.13.0
---
The latest version adds support for "software manifests", which you can read more about [here](/apps/). Basically, manifests
are simple XML files that describe a piece of software (an application, an operating system, whatever). They can also
link to a PCjs machine configuration capable of running the software, along with a "ready-to-run" machine state file.
Conversely, a PCjs machine XML file can refer back to the manifest, to obtain a list of disk images.
Here are some [demos](/apps/pc/) of "ready-to-run" apps on [PCjs](/docs/about/pcjs/).
There have been lots of server-side changes recently, including API improvements that make it easy (well, *easier*)
to dynamically create diskette images from a list of files, or even an entire folder (including all subfolders),
as long as the total size of all the files will fit on a PCjs-supported diskette image. Support for creating hard disk
images is still on the "TODO" list (the original **convdisk** PHP script supported hard disk images, but that functionality
hasn't been ported to the newer **diskdump** Node module yet).
Almost nothing has changed in the PCjs client-side code (which is where the emulator runs), except for changes to use
the new **diskdump** API.
*[@jeffpar](http://twitter.com/jeffpar)*
*April 12, 2014*

148
blog/2014/04/14/README.md Normal file
View file

@ -0,0 +1,148 @@
Node + Express != Safari
---
There's something very odd going on with between Node+Express and Safari, resulting in blank web pages.
Don't believe me? Just ask [Google](https://www.google.com/#q=node+express+safari+blank+page).
[pcjs.org](http://www.pcjs.org/) contains a lot of XML files that are rendered as web pages using XML
stylesheets. And occasionally Safari -- and ONLY Safari -- will render those XML files as blank pages.
For example, here's the
[machine.xml](/configs/pc/machines/5150/mda/64kb/machine.xml) file that's also embedded on the
[pcjs.org](http://www.pcjs.org/) home page.
When Safari fetched that XML file from an Apache web server (what I used before switching to Node),
the request would look like:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14
and the response would look like:
Date: Mon, 14 Apr 2014 22:11:20 GMT
Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT
Server: Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 mod_ssl/2.2.26 OpenSSL/0.9.8y
Etag: "37a10b3-492-4f6e2e96b2e80"
Content-Type: text/xml
Connection: Keep-Alive
Accept-Ranges: bytes
Keep-Alive: timeout=5, max=100
Content-Length: 1170
with a status code of 200 ("OK"). And no matter how many times I hit Safari's Reload button, the response was the same.
Now with Node+Express, the same exact request would look like:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14
with a response of:
Date: Mon, 14 Apr 2014 22:16:42 GMT
Etag: "1170-1397354346000"
Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT
X-Powered-By: Express
Content-Type: application/xml
Cache-Control: public, max-age=0
Connection: keep-alive
Accept-Ranges: bytes
Content-Length: 1170
HOWEVER, as soon as I used Safari's Back button to return to the home page, and then pressed the Forward button to return to
the XML file, the XML request changed to:
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Cache-Control: max-age=0
If-None-Match: "1170-1397354346000"
If-Modified-Since: Sun, 13 Apr 2014 01:59:06 GMT
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/537.75.14
with a response of 304 ("Not Modified") and the following response headers:
Date: Mon, 14 Apr 2014 22:18:26 GMT
Cache-Control: public, max-age=0
Etag: "1170-1397354346000"
Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT
Connection: keep-alive
Accept-Ranges: bytes
X-Powered-By: Express
And here's where the "blank page" problem occurs: pressing Safari's Reload button. Again, the request looks the same as before,
and the response is still be 304 ("Not Modified"), but the page is blank, and the response now looks like:
Date: Mon, 14 Apr 2014 22:21:15 GMT
Cache-Control: public, max-age=0
Last-Modified: Sun, 13 Apr 2014 01:59:06 GMT
Connection: keep-alive
Accept-Ranges: bytes
X-Powered-By: Express
Etag: "1170-1397354346000"
and no matter how many times I press Reload, the response is the same (except for an updated *Date*), and the page is still blank.
So, here's the kludge I've added to my Express server code, to prevent Safari from displaying blank pages for those XML files:
/*
* The Safari "blank page" problem continues to plague us. Our first work-around was for directory
* "index.html" documents, which we resolved by always sending the document ourselves, along with an
* "ok" (200) response, instead of letting next() handle it, which would result in a "not modified"
* (304) response.
*
* However, the problem also extends to any XML files that we serve to an initial Safari request
* (eg, the machine.xml and manifest.xml files that we style as web pages). Safari includes
* "Cache-Control max-age=0" in the request, and if the response is "Cache-Control public, max-age=0"
* along with a 304 response code, Safari may once again display a blank page.
*
* This problem appears limited to the initial resource request for a particular URL. When these XML
* files are requested by Safari while loading another web page, Safari's caching logic is different
* (eg, it doesn't include the same "Cache-Control" setting).
*/
if (sBaseName == "machine.xml" || sBaseName == "manifest.xml") {
var sAgent = req.headers['user-agent'];
if (sAgent && sAgent.indexOf("Safari/") >= 0 && sAgent.indexOf("Chrome/") < 0 && sAgent.indexOf("OPR/") < 0) {
var sCacheControl = req.headers['cache-control'];
if (sCacheControl && sCacheControl.indexOf("max-age=0") >= 0) {
fs.readFile(sPath, {encoding: "utf8"}, function doneReadFile(err, sData) {
if (err) {
next(); // alternatively: res.status(404).send("Cannot GET " + req.path);
} else {
/*
* HACK: Express may still modify our response, turning our 200 status code into a 304
* and adding an Etag, unless we ALSO change the req.method from "GET" to something else.
* Supposedly, we could also use app.disable('etag'), but I'm not sure that would prevent
* Express from changing the status code, and I'm tired of testing work-arounds for this
* irritating behavior in Safari.
*/
req.method = "NONE";
res.set("Content-Type", "application/xml");
res.status(200).send(sData);
}
});
return;
}
}
}
I should add that this problem wasn't limited to XML files. It's a problem for the first resource requested by
Safari for any URL on the site (eg, URLs that default to "index.html" files).
I'm also rather surprised that no one yet seems to have figured out exactly what's going on here between Node+Express
and Safari. Or maybe they have, and I haven't been keeping my Node.js config up-to-date. I've tried to avoid changing
too many variables.
Lots of people have run into this problem. For example, on
[StackOverflow](http://stackoverflow.com/questions/18811286/nodejs-express-cache-and-304-status-code), someone
concluded that the [node-fresh](https://github.com/visionmedia/node-fresh) module should be changed. And for a while,
it was changed, until the change was [reverted](https://github.com/visionmedia/node-fresh/issues/8) -- along with a
lengthy discussion about why the change was wrong and that this was really a bug in Safari.
This "blank page" behavior may well be a bug in Safari, but that doesn't mean Express server components can't
or shouldn't provide a work-around for that behavior in the meantime. It also seems that some people who decided
this was a bug in Safari did not actually reproduce the bug themselves.
I don't know the right answer, but I do know that the current situation adversely affects users of other Node-powered
websites, who will probably get blank pages when they shouldn't, and other developers, who must all discover/debug/work-around
this problem on their own.
*[@jeffpar](http://twitter.com/jeffpar)*
*April 14, 2014*

39
blog/2014/04/30/README.md Normal file
View file

@ -0,0 +1,39 @@
Heading to New York
---
Lots of tinkering has been going on here at pcjs.org the past couple of weeks, but with nothing substantial to show for it.
Fixing lots of little problems requires only small bits of time, whereas buckling down and tackling "the next BIG thing" for
PCjs requires a much more serious time commitment, with limited interruptions.
And I certainly can't start on "the next BIG thing" now, because I'm heading to New York tomorrow, for [EmpireJS](http://2014.empirejs.org),
my first JavaScript conference *and* my first trip to New York in about 20 years.
I'm going to the conference partly because it was a great excuse to finally visit New York again (and with the whole family,
since all three of us are computer nerds), but also to get a more up-close-and-personal sense of where this whole JavaScript
renaissance is headed.
Is it headed for a fiery crash? This recent blog post
("[you have ruined javascript](http://codeofrob.com/entries/you-have-ruined-javascript.html)")
suggests it already has for some people. Is it drowning in the Sea of Endless Proliferation, as this still-relevant two-year-old
[parody](http://www.webmonkey.com/2012/05/jokes-for-nerds-html9-responsive-boilerstrap-js/) implies? Excerpt:
> *If youre feeling overwhelmed by the endless proliferation of responsive grids, adaptive images, HTML boilerplates,
CSS frameworks and JavaScript whirligigs then what you need is the HTML9 Responsive Boilerstrap JS.*
> *To install HTML9 Responsive Boilerstrap JS just “attackclone the grit repo pushmerge, then rubygem the lymphnode js shawarma
module — and presto!”*
> *If youre wondering what H9RBS.js actually is, well, you can abandon any hopes of one day being hip. But if you must know,
H9RBS.js is a “flexible, dependency-free, lightweight, device-agnostic, modular, baked-in, component framework MVC library
shoelacestrap to help you kickstart your responsive CSS-based app architecture backbone kitchensink tweetybirds.”*
Seriously, I'm concerned about how the JavaScript language (rather than the endless procession of frameworks) is going to evolve,
and whether it even can. Two examples: at a high-level, we have Microsoft pushing [TypeScript](http://www.typescriptlang.org/),
and at a much lower level, we have Mozilla pushing [asm.js](http://asmjs.org). And while I like aspects of both those efforts,
I'm relunctant to go very far down either of those paths right now, because I don't want to get suckered. Inevitably, someone will
see a *different* shiny object along another fork in the road, and everyone will chase after that instead.
Will [EmpireJS](http://2014.empirejs.org) answer any of these big questions? It doesn't really matter. I just expect to learn stuff,
and learning is fun!
*[@jeffpar](http://twitter.com/jeffpar)*
*April 30, 2014*

27
blog/2014/05/12/README.md Normal file
View file

@ -0,0 +1,27 @@
Chrome Kicks Butt
---
I haven't been closely monitoring the performance of PCjs across various browsers. Most of my browser testing has
been limited to "Does the latest version still work in all current web browsers?"
However, at some point during the last couple months, Chrome's performance suddenly jumped through the roof. On my
2.8GHz Intel Core i7 MacBook Pro, Chrome v34.0.1847.131 easily punches through the 120Mhz barrier on a PCjs machine
running PC-DOS 2.00.
That's roughly a 3x-4x increase over previous versions of Chrome. Safari used to be the performance champ, capable
of running a PCjs machine at a top speed of around 70-80MHz, while Chrome was less than half that, and Firefox was
slower still.
Chrome has now leap-frogged Safari in a big way, almost doubling Safari's speed. And with Chrome's superior
Developer Tools, Chrome is clearly the "Browser of Choice," whether you're just playing with PCjs or actually
debugging it.
Firefox is a bit of a disappointment, given all the hoopla over [asm.js](http://asmjs.org/) and other investments
that Mozilla is making. I've taken a "wait-and-see" attitude toward asm.js, because PCjs is hand-coded JavaScript,
and I'm not prepared to build a preprocessor that converts the code to asm.js semantics solely for the benefit of a
single browser.
Chrome's approach to making regular JavaScript run faster seems to be a winning strategy so far, at least for apps
like PCjs.
*[@jeffpar](http://twitter.com/jeffpar)*
*May 12, 2014*

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

75
blog/2014/06/14/README.md Normal file
View file

@ -0,0 +1,75 @@
Halt and Catch Liar
---
I had high hopes for the new AMC series "[Halt and Catch Fire](http://www.amctv.com/shows/halt-and-catch-fire),"
but it has proven to be an utter disappointment. I think I can suspend my disbelief as well as anyone, but this
show requires you to completely turn your brain off in order to be believed. I'm also baffled by the show's
high [IMDb score](http://www.imdb.com/title/tt2543312/), which is currently 8.4 (out of 10). Either AMC has figured
out how to game the system, or viewers are easily turned on by clichés, like the know-it-all Hot Programmer,
the self-assured Sales Guy, and the non-plot-advancing sex that they almost instantly engage in.
The premise: ex-IBM Sales Guy waltzes into a fictional computer company, smooth-talks his way into a top
marketing position without so much as a resumé, and then immediately risks all, including a huge potential lawsuit
with IBM, because he has dreams of building IBM clones that are "2x fast" at "1/2 price" -- with *handles*!
And the first thing they must do to achieve this dream is clone the IBM PC ROM BIOS, which the show pretends
was so secret that you couldn't even tell which chips on the IBM PC motherboard contained the ROM. Never mind
that IBM published the entire ROM BIOS listing in their Technical Reference Manual, which also included system
diagrams identifying every chip in the machine. I think if you're going to weave facts into your fiction,
the least you can do is get your facts right.
And centerpiece of this whole conceit -- the cloning of the IBM PC ROM BIOS. What a farce! Check out this
scene from Episode 2, where Brilliant Engineer looks at Hot Programmer's whiteboard in awe. Apparently, he
is easily awed, because he did the same thing when Sales Guy wrote "2x fast, 1/2 price" on an earlier whiteboard.
!["Halt and Catch Fire" Scene from Episode 2](Halt_and_Catch_Liar-thumbnail.jpg "link:Halt_and_Catch_Liar.jpg")
So if you deconstruct the code on this whiteboard, you quickly notice that while it IS assembly language, it is
NOT the sort of assembly language you would find in a ROM BIOS, let alone ANYTHING that would leave you in awe.
Here are some excerpts:
Initialization
MOV AX,CX ; set up DS
MOV DS,AX
MOV SS,AX ; and SS
LEA AX,BEGINSTACK
MOV SP,AX
MOV AL,OUTINT
...
TSTART
LEA AX,BEGTRACE
MOV POINT,AX
MOV AL,YES ; TURN TRACE ON
MOV TFLAG,AL
MOV AL,NO ; NOT WRAPPED
MOV WRAP,AL
MOV AX,CS ; CONVERT ADDRESS FOR OUTPUT
LEA SI,LOADCS
CALL HEXPRT
MOV AX,100H
LEA SI,LOADIP
CALL HEXPRT
LEA DX,SIGNIN
MOV AH,9
INT DOSINT
LEA DX,OUTPUT
MOV AL,OUTPUT (?)
MOV AH,25H ; Set Interrupt Vector
INT DOSINT ; Have DOS place the interrupt...
...
This is clearly **NOT** code for a PC ROM BIOS, because no PC BIOS would ever issue a DOS interrupt.
A BIOS is designed to be called *by* DOS, not the other way around.
This turns out to be code largely copied from a file I found online: [PCTRACE.ASM](http://ftpmirror.your.org/pub/misc/dos/RbbsInABoxVol1No2_640/files/007P/PCTRACE.ZIP-contents/PCTRACE.ASM)
Another curiosity is that searching for this resulted in a "[Googlewhack](http://en.wikipedia.org/wiki/Googlewhack)"
of sorts:
![Googlewhack](googlewhack.jpg)
Technically, a Googlewhack (a two-word search that yields exactly one result) must use two words found in an actual
dictionary. But dictionaries are so passé.
*[@jeffpar](http://twitter.com/jeffpar)*
*June 14, 2014*

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

13
blog/2014/06/26/README.md Normal file
View file

@ -0,0 +1,13 @@
More Under-The-Hood Changes
---
v1.13.7 of PCjs contains a few minor improvements, mostly in terms of rendering video modes a little more
efficiently. The rest of the changes to the website involved beefing up support for both "software manifests"
and "document manifests."
To that end, there's a new [/pubs/]() directory for old documents, and [/disks/pc/]() contains more disk images,
with more on the way. I have a TON of old diskette images, and it has taken more time to organize them and create
manifests than I would like. I have managed to streamline the process somewhat, however, as discussed in
[/disks/pc/personal/]().
*[@jeffpar](http://twitter.com/jeffpar)*
*June 26, 2014*

38
blog/2014/07/30/README.md Normal file
View file

@ -0,0 +1,38 @@
EGA Support
---
PCjs v1.14.0 now includes basic EGA support. It emulates the EGA hardware well enough to pass the IBM EGA BIOS
diagnostics and run [Windows 1.01](/configs/pc/machines/5160/ega/640kb/win101/) in color. Check out our
[Windows 1.01 "Server Array"](/configs/pc/machines/5160/ega/640kb/array/) demo.
![Windows 1.01 "Server Array" Demo](/blog/2014/07/30/win101-array-demo-small.jpg "link:/blog/2014/07/30/win101-array-demo.jpg")
EGA support is added to a **machine.xml** file using two XML elements; eg:
<video id="videoEGA" model="ega" memory="0x20000" screenwidth="640" screenheight="350"/>
The *model* attribute must be set to "ega" and the *memory* attribute should be set to the amount of memory
desired on the card; valid memory sizes are:
- 0x10000 (64Kb)
- 0x20000 (128Kb)
- 0x40000 (256Kb)
As with the MDA and CGA video cards, the *screenwidth* and *screenheight* attributes specify the size of display
window, which the browser will then scale up or down, unless a specific overall size has been specified on the
&lt;machine&gt; element.
The second required XML element is a &lt;rom&gt; element to load the EGA ROM; eg:
<rom id="romEGA" addr="0xc0000" size="0x4000" file="/devices/pc/video/ibm-ega.json" notify="videoEGA"/>
The *notify* attribute must match the *id* of the &lt;video&gt; element, so that the Video component can load
the initial 8x14 and 8x8 fonts from the ROM. Support for dynamic loading of fonts from plane 2 of the EGA's memory
will be added later; however, current support works well enough to allow switching from 25-line mode to 43-line mode,
which essentially switches from the 8x14 font to the 8x8 font.
The &lt;video&gt; element also supports a *switches* attribute to specify the type of monitor connected to the EGA;
this attribute corresponds to the actual switch settings on the EGA card; our default *switches* setting is "0110",
which selects an Enhanced Color Monitor, enabling the EGA's maximum resolution of 640x350.
*[@jeffpar](http://twitter.com/jeffpar)*
*July 30, 2014*

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

26
blog/2014/08/01/README.md Normal file
View file

@ -0,0 +1,26 @@
PC Tech Journal, 1987
---
As part of an ongoing effort to make classic PC technical literature more accessible, I just finished
scanning and posting the 12 issues of [PC Tech Journal](/pubs/pc/magazines/pctj/) from 1987.
![PC Tech Journal, Jan 1987](http://static.pcjs.org/pubs/pc/magazines/pctj/PCTJ-1987-01/thumbs/PCTJ-1987-01 1.jpeg "link:/pubs/pc/magazines/pctj/PCTJ-1987-01/:200:260")
Future PC Tech Journal postings will include:
- Vol. 1, No. 1, July-August 1983
- Vol. 3, No. 12, December 1985
- Vol. 4, Nos. 1-12, 1986
- Vol. 6, Nos. 1-12, 1988
I'm missing the rest of 1983, all of 1984, most of 1985, and all of 1989 (well, through April 1989, which was
apparently the last issue).
For a nice overview and brief history of PC Tech Journal, check out the [OS/2 Museum](http://www.os2museum.com/wp/?p=2478).
In the meantime, if you have old PC Tech Journal issues that would fill any of the above holes, let me know.
I'd be happy to buy them, scan them, and recycle them.
Thanks.
*[@jeffpar](http://twitter.com/jeffpar)*
*August 1, 2014*

45
blog/2014/08/28/README.md Normal file
View file

@ -0,0 +1,45 @@
Supporting the 80286
---
The next milestone for PCjs is complete 80286 emulation. My hope is to have it working by the end of the year.
PCjs version 1.15.0 is the first step on the path to full 80286 support. It includes changes to the physical
memory manager and separate real-mode and protected-mode address evaluators. The Debugger supports physical
addresses (eg, %FE05B is the same as F000:E05B, assuming real-mode operation), along with breakpoint commands that
stop execution on port input/output operations. And the ChipSet component now contains "infrastructure" (a
fancy way of saying "partial support") for multiple PICs, DMA controllers, the 8042 keyboard controller (including
A20 support), and a bit more -- but not much.
One of the challenges is creating a single "universal" version of PCjs that can adapt itself to different machine
types without impacting performance. There will not be a **pc8088.js** or a **pc80286.js** or whatever. There will
only be **pc.js**.
Up until now, all PCjs machine XML files assumed an 8088 CPU with a 20-bit bus and a model 5150 or 5160 motherboard.
But now, a machine XML file can specify:
<computer name="IBM PC AT" buswidth="24"/>
<cpu model="80286"/>
<chipset model="5170"/>
...
Conventional emulators are usually NOT able to run original BIOS images, or simulate original PC hardware,
or even run at the same speed as the original PC, making some software difficult or impossible to use. PCjs takes a
different approach, by attempting to simulate an entire PC as it originally existed. Which is why a PCjs simulation
of an IBM PC does NOT run at whatever speed your modern PC happens to run in V86-mode or whatever speed your
browser's JavaScript engine tops out at.
No, a PCjs simulation of a 4.77Mhz IBM PC runs at 4.77Mhz. And a PCjs simulation of a 6Mhz IBM PC AT will run at
6Mhz. If you want to run the simulation faster, you have that option, but that's not the default. And I'm not saying
that PCjs is *exact* -- exactness is an exercise I'm leaving for another day and/or to other developers who are even
more obsessive than I am. I'm just saying that original PCs represent the targets that PCjs is shooting for.
PCjs 1.15.0 can now load and run the IBM 5170 ROM BIOS up to the first 80286-specific opcode, so it's off and running.
Although "running" isn't quite the right metaphor, because the process of bringing a new machine simulation to
completion is a *very* long series of baby steps.
Also, in preparation for this new phase, I recently dug up a variety of old [80286 CPU Documentation](/pubs/pc/reference/intel/80286/)
and posted excerpts. I'm sure none of this information is "new" at this point, but it might have some historical interest.
Enjoy.
*[@jeffpar](http://twitter.com/jeffpar)*
*August 28, 2014*

27
blog/2014/09/02/README.md Normal file
View file

@ -0,0 +1,27 @@
Minor Fixes and Additions
---
The following fixes were made in PCjs v1.15.1:
1. Using the "User-defined URL" option when loading a disk image from a 3rd-party server was broken if the URL
contained certain special characters; that should be fixed now, but be aware that only web servers (ie, URLs
using the HTTP protocol) are supported. URLs that trigger a redirect may also not work (more testing required).
2. Any errors that occur during the call to either *embedPC()* or *embedC1P()* should be properly displayed on the
caller's page now.
3. Two embedding helper functions have been added to provide more control over the machine startup
and shutdown process:
+ *enableEvents(boolean)*: pass *false* to disable delivery of all page events to all machines on the page,
or *true* to re-enable;
+ *sendEvent(string)*: pass *"init"*, *"show"* or *"exit"* to simulate the corresponding browser event
(*onload*, *onpageshow* or *onbeforeunload*, respectively).
If a page calls *enableEvents(false)* before calling *embedPC()*, all machine layouts will be instantiated
but the machines themselves will not be initialized. When the page is ready, call *enableEvents(true)* to restore
normal event processing, and if the browser has already sent the *onload* event, then call *sendEvent("init")*
to manually initialize the machine(s).
These two new functions are designed to assist in testing the starting up, shutting down and restarting of machines,
by allowing scripts to control the overall process, without requiring use of the browser's back/forward/close controls.
*[@jeffpar](http://twitter.com/jeffpar)*
*September 2, 2014*

66
blog/2014/09/13/README.md Normal file
View file

@ -0,0 +1,66 @@
The IBM PC AT: Alive and Booting
---
My first IBM PC AT (Model 5170) [Test Configuration](/configs/pc/machines/5170/ega/640kb/debugger/) finally
boots to a PC-DOS prompt. The configuration uses the original [IBM Model 5170 ROM BIOS](/devices/pc/bios/5170/),
dated January 10, 1984.
Getting through the BIOS "POST" (Power-On Self Test) diagnostics was like running an obstacle course, with various
tests derailing the simulation at every turn.
Sometimes the problems were as simple as missing hardware. For example, I knew that the PC AT contained two DMA
controllers, for a total of 8 DMA channels, but what I didn't know (or had forgotten) is that it also contained 16
DMA page registers, some of which the BIOS uses as scratch registers. Since DMA page registers are accessed with
I/O instructions that work identically in both real-mode and protected-mode, they obviously offer some advantages
over RAM, especially when the BIOS hasn't yet tested all the RAM, or determined how much RAM is installed, or set up
descriptors that allow the RAM to be accessed from protected-mode.
Aside from the additional DMA Controller, other major new motherboard components on the PC AT included a second
8259 Interrupt Controller, an 8042 Keyboard ("Kitchen Sink") Controller, and an MC146818 Real-Time Clock/CMOS chip.
The Keyboard Controller and Real-Time Clock/CMOS components required the most tinkering to pass through the ROM BIOS
gauntlet.
For example, at one point, the BIOS ("[TEST.21](../../../../pubs/pc/reference/ibm/static/5170/techref/pages/IBM-5170-TECHREF 202.pdf)")
reset the keyboard ("[KBD_RESET](../../../../pubs/pc/reference/ibm/static/5170/techref/pages/IBM-5170-TECHREF 212.pdf)"),
which unmasked the keyboard IRQ and waited for an interrupt, using a loop where CX was initialized to zero and then
decremented until either CX wrapped around to zero again *or* an interrupt occurred. The "TEST.21" code then assumed
that if "KBD_RESET" returned zero in CX, no interrupt had occurred.
Unfortunately, my Keyboard Controller was a bit too fast: it generated an interrupt as soon as the keyboard IRQ was
unmasked; as a result, CX was never decremented, leaving it at zero.
---
Most of the effort getting to this point involved adding support for 80286 protected-mode. That work is still far
from complete, but getting through multiple real-mode/protected-mode round trips in the BIOS was an important
milestone. Some of the work was outside the CPU component, such as A20 support and processor reset via the 8042
controller. Work inside the CPU component included:
- New 80286 general-purpose instructions (eg, ENTER, LEAVE, new PUSH SP behavior, etc)
- New protected-mode instructions (eg, ARPL, LGDT, LIDT, LAR, LSL, VERR, VERW, etc)
- Protected-mode segment loading, addressing, and fault handling
Another "feature" I spent considerable time on was ensuring that 80286 protected-mode support did not adversely
real-mode performance, so that the PC and PC XT simulations still run (almost) as fast as before. PCjs dynamically
reconfigures itself according to the requirements of the processor and platform it's emulating.
---
There's still no support for [LOADALL](/pubs/pc/reference/intel/80286/loadall/) or triple-fault resets, nor for
call gates or task gates, nor for conforming code segments or expand-down data segments. 80286-specific cycle
counts haven't been incorporated yet, either. The list of remaining 80286 features is long.
And there's plenty of hardware support left to do: I haven't looked at the AT hard disk controller yet (which
I believe is significantly different from the XT hard disk controller), and the keyboard *barely* works; the 8042
Keyboard Controller and AT keyboard had a number of features that older PC/XT keyboards did not (like LEDs and
programmable repeat rate).
And there are plenty of issues to investigate. For example, PC-DOS is picking up the correct RTC time, but not the
date (PCjs initializes the RTC to the browser's current date/time, unless a hard-coded date/time is specified in the
machine XML). And diskette I/O seems a bit slow; I'm concerned that the BIOS is spinning its wheels somewhere
unnecessarily. And even though the test machine is configured with 640Kb of RAM, the BIOS is reporting only 64Kb.
Hmmmm.
*[@jeffpar](http://twitter.com/jeffpar)*
*September 13, 2014*

4
configs/README.md Normal file
View file

@ -0,0 +1,4 @@
Machine Configurations
---
Browse [IBM PC](/configs/pc/) and [Challenger 1P](/configs/c1p/) machine configurations.

5
configs/c1p/README.md Normal file
View file

@ -0,0 +1,5 @@
Challenger 1P Configurations
---
This folder contains Challenger 1P [Machine Configurations](machines/), along with a variety of component configurations,
such as [Control Panels](panels/), [Disk Sets](disks/) and [Serial Program Sets](serial/).

View file

@ -0,0 +1,4 @@
Challenger 1P Disk Sets
---
An assortment of Challenger 1P Disk Sets, for use by [C1P Machine Configurations](../machines/).

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<disk id="disk" pos="left" padleft="8px">
<control type="list" class="input" binding="listDisk">
<item ref="/disks/c1p/OS65D33.json">OS65D33</item>
</control>
<control type="button" class="input" binding="loadDisk">Load Disk</control>
</disk>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.3/machine.xsl"?>
<machine id="c1psim" class="c1p" border="1" width="100%" style="background-color:#FAEBD7">
<name>OSI Challenger 1P (32Kb) with Disk Support</name>
<computer id="c1p" name="Challenger 1P">
<module type="cpu" refid="cpu6502" start="0x0000" end="0xffff"/>
<module type="ram" refid="ram32K" start="0x0000" end="0x7fff"/>
<module type="rom" refid="romNull" start="0x8000" end="0x9fff"/>
<module type="rom" refid="romBasic" start="0xa000" end="0xbfff"/>
<module type="disk" refid="disk" start="0xc000" end="0xc0ff"/>
<module type="video" refid="video" start="0xd000" end="0xd7ff"/>
<module type="keyboard" refid="keyboard" start="0xdf00" end="0xdfff"/>
<module type="serial" refid="serialPort" start="0xf000" end="0xf0ff"/>
<module type="rom" refid="romSystem" start="0xf800" end="0xffff"/>
</computer>
<cpu id="cpu6502"/>
<debugger id="debugger"/>
<ram id="ram32K" size="0x8000"/>
<rom id="romNull" size="0x2000"/>
<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">
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
<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"/>
<disk ref="/configs/c1p/disks/samples.xml"/>
<panel ref="/configs/c1p/panels/default.xml"/>
</machine>

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.3/machine.xsl"?>
<machine id="c1pAll" class="c1p" border="1" width="100%" style="background-color:#FAEBD7">
<name>OSI Challenger 1P (8Kb, More Programs)</name>
<computer id="c1p" name="Challenger 1P">
<module type="cpu" refid="cpu6502" start="0x0000" end="0xffff"/>
<module type="ram" refid="ram8K" start="0x0000" end="0x1fff"/>
<module type="rom" refid="romNull" start="0x2000" end="0x9fff"/>
<module type="rom" refid="romBasic" start="0xa000" end="0xbfff"/>
<module type="video" refid="video" start="0xd000" end="0xd3ff"/>
<module type="keyboard" refid="keyboard" start="0xdf00" end="0xdfff"/>
<module type="serial" refid="serialPort" start="0xf000" end="0xf0ff"/>
<module type="rom" refid="romSystem" start="0xf800" end="0xffff"/>
</computer>
<cpu id="cpu6502"/>
<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">
<name>Video Display</name>
</video>
<keyboard id="keyboard" padleft="8px">
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
<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/all.xml"/>
<panel ref="/configs/c1p/panels/default.xml"/>
</machine>

View file

@ -0,0 +1,12 @@
Challenger 1P (8Kb) "Server Array"
---
[Machine #1](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI1")
[Machine #2](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI2")
[Machine #3](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI3")
[Machine #4](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI4")
[Machine #5](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI5")
[Machine #6](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI6")
[Machine #7](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI7")
[Machine #8](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI8")
[Machine #9](/configs/c1p/machines/8kb/small/ "C1Pjs:OSI9")

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.3/outline.xsl"?>
<outline>
<title>Challenger 1P (8Kb) "Server Array"</title>
<machine id="OSI1" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI2" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI3" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI4" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI5" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI6" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI7" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI8" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
<machine id="OSI9" ref="/configs/c1p/machines/8kb/small/machine.xml"/>
</outline>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<machine id="c1pEmbed" class="c1p" border="1" width="272px" pos="right" padleft="16px" padright="16px" padbottom="16px" style="background-color:#FAEBD7">
<computer id="c1p" name="Challenger 1P">
<module type="cpu" refid="cpu6502" start="0x0000" end="0xffff"/>
<module type="ram" refid="ram8K" start="0x0000" end="0x1fff"/>
<module type="rom" refid="romNull" start="0x2000" end="0x9fff"/>
<module type="rom" refid="romBasic" start="0xa000" end="0xbfff"/>
<module type="video" refid="video" start="0xd000" end="0xd3ff"/>
<module type="keyboard" refid="keyboard" start="0xdf00" end="0xdfff"/>
<module type="serial" refid="serialPort" start="0xf000" end="0xf0ff"/>
<module type="rom" refid="romSystem" start="0xf800" end="0xffff"/>
</computer>
<cpu id="cpu6502"/>
<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="256" screenheight="192" cols="32" rows="32" charset="/devices/c1p/video/chargen1x.png" width="256px" padding="8px"/>
<keyboard id="keyboard" pos="center">
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
<control type="button" class="input" binding="ctrl-o">CTRL-O</control>
<control type="button" class="input" binding="break">BREAK</control>
</keyboard>
<serial id="serialPort" demo="true"/>
</machine>

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.3/machine.xsl"?>
<machine id="c1p8kb" class="c1p" border="1" width="100%" style="background-color:#FAEBD7">
<name>OSI Challenger 1P (8Kb) with Debugger</name>
<computer id="c1p" name="Challenger 1P">
<module type="cpu" refid="cpu6502" start="0x0000" end="0xffff"/>
<module type="ram" refid="ram8K" start="0x0000" end="0x1fff"/>
<module type="rom" refid="romNull" start="0x2000" end="0x9fff"/>
<module type="rom" refid="romBasic" start="0xa000" end="0xbfff"/>
<module type="video" refid="video" start="0xd000" end="0xd3ff"/>
<module type="keyboard" refid="keyboard" start="0xdf00" end="0xdfff"/>
<module type="serial" refid="serialPort" start="0xf000" end="0xf0ff"/>
<module type="rom" refid="romSystem" start="0xf800" end="0xffff"/>
</computer>
<cpu id="cpu6502"/>
<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">
<name>Video Display</name>
</video>
<keyboard id="keyboard" padleft="8px">
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
<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"/>
</machine>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.3/machine.xsl"?>
<machine id="c1pLarge" class="c1p" border="1" pos="center" style="background-color:#FAEBD7">
<name pos="center">OSI Challenger 1P (circa 1978)</name>
<computer id="c1p" name="Challenger 1P">
<module type="cpu" refid="cpu6502" start="0x0000" end="0xffff"/>
<module type="ram" refid="ram8K" start="0x0000" end="0x1fff"/>
<module type="rom" refid="romNull" start="0x2000" end="0x9fff"/>
<module type="rom" refid="romBasic" start="0xa000" end="0xbfff"/>
<module type="video" refid="video" start="0xd000" end="0xd3ff"/>
<module type="keyboard" refid="keyboard" start="0xdf00" end="0xdfff"/>
<module type="serial" refid="serialPort" start="0xf000" end="0xf0ff"/>
<module type="rom" refid="romSystem" start="0xf800" end="0xffff"/>
</computer>
<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" padding="8px"/>
<cpu id="cpu6502" autostart="false" pos="left" padleft="8px">
<control type="button" class="input" binding="run">Run</control>
</cpu>
<keyboard id="keyboard" pos="left" padleft="8px" padbottom="8px">
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
<control type="button" class="input" binding="ctrl-o">CTRL-O</control>
<control type="button" class="input" binding="break">BREAK</control>
</keyboard>
<serial id="serialPort" demo="true"/>
</machine>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/versions/c1pjs/1.15.3/machine.xsl"?>
<machine id="c1pSmall" class="c1p" border="1" width="272px" pos="left" padright="16px" padbottom="16px" style="background-color:#FAEBD7">
<computer id="c1p" name="Challenger 1P">
<module type="cpu" refid="cpu6502" start="0x0000" end="0xffff"/>
<module type="ram" refid="ram8K" start="0x0000" end="0x1fff"/>
<module type="rom" refid="romNull" start="0x2000" end="0x9fff"/>
<module type="rom" refid="romBasic" start="0xa000" end="0xbfff"/>
<module type="video" refid="video" start="0xd000" end="0xd3ff"/>
<module type="keyboard" refid="keyboard" start="0xdf00" end="0xdfff"/>
<module type="serial" refid="serialPort" start="0xf000" end="0xf0ff"/>
<module type="rom" refid="romSystem" start="0xf800" end="0xffff"/>
</computer>
<cpu id="cpu6502"/>
<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="256" screenheight="192" cols="32" rows="32" charset="/devices/c1p/video/chargen1x.png" width="256px" padding="8px"/>
<keyboard id="keyboard" padleft="8px">
<control type="button" class="input" binding="ctrl-c">CTRL-C</control>
<control type="button" class="input" binding="ctrl-o">CTRL-O</control>
<control type="button" class="input" binding="break">BREAK</control>
</keyboard>
<serial id="serialPort" demo="true"/>
</machine>

View file

@ -0,0 +1,13 @@
Challenger 1P Machine Configurations
---
Here are some sample C1P Machine Configurations:
* [8kb with Large Display](8kb/large/)
* [8kb with Large Display, Debugger](8kb/large/debugger/)
* [8kb with Small Display](8kb/small/)
* [8kb with Large Display, Debugger, Additional Software](8kb/all/debugger)
* [8kb "Server Array" Demo](8kb/array/)
* [32kb with Diskette Support](32kb/)
See the [Documentation](/docs/c1pjs/) for details on the operation of C1Pjs.

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<panel id="panel" left="528px" top="8px" width="362px">
<name>Control Panel</name>
<control type="textarea" class="output" binding="print" width="240px" height="280px"/>
<control type="text" class="input" binding="debugInput" width="240px" pos=""/>
<control type="button" class="input" binding="debugEnter" top="290px" left="256px">Enter</control>
<control type="register" class="output" label="A" labelwidth="10px" binding="A" width="50px" height="18px" top="0px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="X" labelwidth="10px" binding="X" width="50px" height="18px" top="19px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="Y" labelwidth="10px" binding="Y" width="50px" height="18px" top="38px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="C" labelwidth="10px" binding="C" width="50px" height="18px" top="57px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="Z" labelwidth="10px" binding="Z" width="50px" height="18px" top="76px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="I" labelwidth="10px" binding="I" width="50px" height="18px" top="95px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="D" labelwidth="10px" binding="D" width="50px" height="18px" top="114px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="B" labelwidth="10px" binding="B" width="50px" height="18px" top="133px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="V" labelwidth="10px" binding="V" width="50px" height="18px" top="152px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="N" labelwidth="10px" binding="N" width="50px" height="18px" top="171px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="S" labelwidth="10px" binding="S" width="50px" height="18px" top="190px" left="256px" style="text-align:right"/>
<control type="register" class="output" label="PC" labelwidth="10px" binding="PC" width="50px" height="18px" top="209px" left="256px" style="text-align:right"/>
<control type="register" class="output" binding="speed" width="78px" height="18px" top="235px" left="256px" style="text-align:right"/>
<control pos=""/>
<control type="button" class="input" binding="run">Run</control>
<control type="button" class="input" binding="step">Step</control>
<control type="button" class="input" binding="reset">Reset</control>
<control type="button" class="input" binding="setSpeed">Fast</control>
</panel>

View file

@ -0,0 +1,8 @@
Challenger 1P Serial Program Sets
---
The C1P serial port has no configurable hardware features. However, there is a "demo" property that can
be set, causing the machine to load some built-in demonstration code via the serial port when it starts up.
The purpose of these configuration files is to create UI controls that allow you to choose from a set of programs
(eg, BASIC programs, 6502 machine code files) and send them to the C1P through the serial port.

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<serial id="serialPort" pos="left" padleft="8px">
<control type="list" class="input" binding="listSerial">
<item ref="/apps/c1p/BASIC/JP/TUBELIST.BAS">TUBELIST (JP)</item>
<item ref="/apps/c1p/BASIC/JP/HANGWOMAN.BAS">HANGWOMAN (JP)</item>
<item ref="/apps/c1p/BASIC/JP/CHECKERS.BAS">CHECKERS (JP)</item>
<item ref="/apps/c1p/BASIC/JP/LIFE.BAS">LIFE (JP)</item>
<item ref="/apps/c1p/BASIC/JP/OTHELLO.BAS">OTHELLO (JP)</item>
<item ref="/apps/c1p/BASIC/JP/SOFORECAST.BAS">SOFORECAST (JP)</item>
<item ref="/apps/c1p/6502/JP/BASICEXT.65V">6502 BASIC MODS (JP)</item>
<item ref="/apps/c1p/6502/JP/LIFE.65V">6502 LIFE (JP)</item>
<item ref="/apps/c1p/6502/tests/bcd/bcd.65v">6502 BCD TESTS</item>
<item ref="/apps/c1p/6502/tests/vflag/vflag.65v">6502 VFLAG TESTS</item>
<item ref="/apps/c1p/BASIC/OSI/POKER.BAS">POKER</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE1.BAS">BASIC MATH</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE2.BAS">CHECKING</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE3.BAS">TRIG TUTOR</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE4.BAS">STAR WARS</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE5.BAS">COUNTER</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE6.BAS">PRESIDENTS</item>
<item ref="/sites/www.osiweb.org/programs/basic/OsiBas/spacewar.bas">SPACEWAR</item>
</control>
<control type="button" class="input" binding="loadSerial">Load File</control>
</serial>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<serial id="serialPort" pos="left" padleft="8px">
<control type="list" class="input" binding="listSerial">
<item ref="/apps/c1p/BASIC/OSI/POKER.BAS">POKER</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE1.BAS">BASIC MATH</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE2.BAS">CHECKING</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE3.BAS">TRIG TUTOR</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE4.BAS">STAR WARS</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE5.BAS">COUNTER</item>
<item ref="/apps/c1p/BASIC/OSI/SAMPLE6.BAS">PRESIDENTS</item>
</control>
<control type="button" class="input" binding="loadSerial">Load File</control>
</serial>

6
configs/pc/README.md Normal file
View file

@ -0,0 +1,6 @@
IBM PC Configurations
---
Here you'll find [Machine Configurations](/configs/pc/machines/), along with a variety of other component configurations
that are used by the machines, such as [Control Panels](/configs/pc/panels/), [Disk Sets](/configs/pc/disks/) and
[Keyboard Layouts](/configs/pc/keyboards/).

View file

@ -0,0 +1,59 @@
IBM PC Disk Sets
---
An assortment of IBM PC Disk Sets, for use by [IBM PC Machine Configurations](../machines/).
### Example
An FDC (Floppy Disk Controller) XML file, such as [samples.xml](samples.xml), typically contains &lt;disk&gt; entries like:
<disk path="/disks/pc/dos/ibm/1.00/PCDOS100.json">PC-DOS 1.0</disk>
<disk path="/disks/pc/dos/ibm/1.10/PCDOS110.json">PC-DOS 1.1</disk>
<disk path="/disks/pc/dos/ibm/2.00/PCDOS200-DISK1.json">PC-DOS 2.0 (Disk 1)</disk>
<disk path="/disks/pc/dos/ibm/2.00/PCDOS200-DISK2.json">PC-DOS 2.0 (Disk 2)</disk>
<disk path="/disks/pc/games/microsoft/adventure/adventure-1981.json">Microsoft Adventure</disk>
<disk path="/apps/pc/1981/visicalc/disk.json" href="http://www.bricklin.com/history/vclicense.htm" desc="VisiCalc License">VisiCalc</disk>
However, if you wanted to load VisiCalc directly from the /apps folder, rather than using a pre-generated disk image,
you could do that with an &lt;manifest&gt; entry that references the application's manifest.xml:
<manifest ref="/apps/pc/1981/visicalc/manifest.xml" disk="disk"/>
The application must have a **manifest.xml** with &lt;disk&gt; section containing an *id* value that matches the *disk* value
specified above:
<disk id="disk" dir="/apps/pc/1981/visicalc/bin/">
<file>VC.COM</file>
<file dir="../">README.md</file>
<link href="http://www.bricklin.com/history/vclicense.htm">VisiCalc License</link>
</disk>
If multiple disks are defined in the manifest, and you want to include them all, you can set the *disk* value to '*', as in:
<manifest ref="/apps/pc/1981/visicalc/manifest.xml" disk="*"/>
As an added bonus, PCjs will automatically display the descriptive &lt;link&gt; whenever this item is selected, and it will
dynamically generate a disk image containing all the specified &lt;file&gt; entries when the selected item is loaded.
Pre-generated images are still preferred, and you can now include those in the application **manifest.xml** as well, by adding
an *href* value to the &lt;disk&gt; section that was used to create the image:
<disk id="disk" dir="/apps/pc/1981/visicalc/bin/" href="/apps/pc/1981/visicalc/disk.json">
<file>VC.COM</file>
<file dir="../">README.md</file>
<link href="http://www.bricklin.com/history/vclicense.htm">VisiCalc License</link>
</disk>
The PCjs "diskdump" module is used to create all our pre-generated JSON-encoded disk images. In the above example, a
pre-generated disk image could be created from the command-line with either the "--dir" option (which will traverse all
subdirectories as well):
node diskdump --dir=./apps/pc/1981/visicalc/bin/ --format=json --output=./apps/pc/1981/visicalc/disk.json
or with the "--path" option, which specifies either a single file or a set files separated by semi-colons:
node diskdump "--path=./apps/pc/1981/visicalc/bin/vc.com;../readme.md" --format=json --output=./apps/pc/1981/visicalc/disk.json
or via the PCjs server's "diskdump" API:
http://www.pcjs.org/api/v1/dump?path=/apps/pc/1981/visicalc/bin/vc.com&format=json

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<hdc id="hdcXT" drives='[{name:"10Mb Hard Disk",path:"/disks/pc/fixed/win101/10mb-ega.json",type:3}]'/>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<hdc id="hdcXT" drives='[{name:"10Mb Hard Disk",path:"/disks/pc/fixed/win101/10mb.json",type:3}]'/>

Some files were not shown because too many files have changed in this diff Show more