Modifying software to compile with the Free Pascal compiler and run on modern systems...
authorJason Self <j@jxself.org>
Sun, 16 Nov 2014 21:28:34 +0000 (13:28 -0800)
committerJason Self <j@jxself.org>
Sun, 16 Nov 2014 21:28:34 +0000 (13:28 -0800)
BUILD.TXT [new file with mode: 0644]
agpl-3.0.txt [new file with mode: 0644]
src/ADPAR.PAS
src/CLUERITE.PAS
src/DEFAULT.PAS
src/INSTALL.PAS
src/LINERITE.PAS
src/NOVA.PAS
src/SPECIAL.PAS
src/VOCAB.PAS

diff --git a/BUILD.TXT b/BUILD.TXT
new file mode 100644 (file)
index 0000000..bd15d2e
--- /dev/null
+++ b/BUILD.TXT
@@ -0,0 +1,41 @@
+In order to compile this game you need a Pascal compiler. The Free 
+Pascal Compiler works: http://freepascal.org/
+
+You also need ncurses and SDL.
+
+Your GNU/Linux distro may already have it packaged. In the Trisquel 
+GNU/Linux distro for example:
+
+sudo apt-get install fpc fp-units-multimedia libncursesw5-dev
+
+To compile it change into the src directory and then run:
+
+fpc BEYOND.PAS
+
+The binary will be named BEYOND and stored in the src directory.
+
+Known Limitations:
+* You must be in the 'src' directory to successfully run the program. 
+* You must set your terminal window to 80x25.
+
+These may be addressed in a future version.
+
+-- Copyright (C) 2014 Jason Self <j@jxself.org>
+
+This file is free software: you may copy, redistribute and/or modify 
+it under the terms of the GNU Affero General Public License as 
+published by the Free Software Foundation, either version 3 of the 
+License, or (at your option) any later version.
+
+This file 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 
+Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public 
+License along with this program; if not, see https://gnu.org/licenses 
+or write to:
+  Free Software Foundation, Inc.
+  51 Franklin Street, Fifth Floor
+  Boston, MA 02110-1301
+  USA
diff --git a/agpl-3.0.txt b/agpl-3.0.txt
new file mode 100644 (file)
index 0000000..dba13ed
--- /dev/null
@@ -0,0 +1,661 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 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 Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are 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.
+
+  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.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  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 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 work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero 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 your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  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 AGPL, see
+<http://www.gnu.org/licenses/>.
index 53e4ee6e75476beb65210566a296c2c9998aead9..bf4d65b02a1c5a7b9a0103ef2d5f853e000eb51f 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -46,20 +68,238 @@ function  FN(VNP:byte):Str29;forward;
 function  Here(Obj:byte):Boolean;forward;\r
 function  Up(Word:Str130):Str1;forward;\r
 \r
+{$IFDEF UNIX}\r
+procedure init_windows;\r
+  var lang:string;\r
+ begin\r
+  nEcho(false);\r
+  stdscr:=nscreen;\r
+  { Get ENV LANG and check for UTF-8 support}\r
+  lang:=upcase(GetEnvironmentVariable('LANG'));  \r
+  UTF8Scr:= (Pos('.UTF-8', lang) > 0) or (Pos('.UTF8', lang) > 0);\r
+  { Check min req col & rows}\r
+  {writeln(nCols(stdscr),nRows(stdscr));}\r
+ end;\r
+\r
+procedure WritePrompt(x,y:integer);\r
+ begin\r
+  { UTF-8 print }\r
+  if UTF8Scr then\r
+   { U+00BB, Â», C2 BB, RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK.}\r
+   nFWrite(x,y,TextAttr,0,#$C2#$BB)\r
+  else \r
+   nFWrite(x,y,TextAttr,0,chr(187));\r
+  refresh;\r
+ end;\r
+\r
+{$ELSE}\r
+procedure nSetActiveWin(win:pwin);\r
+ begin\r
+  with win^ do\r
+   window(x,y,x1,y1);\r
+ end;\r
+\r
+procedure nWindow(var win : pwin; x,y,x1,y1 : integer);\r
+ begin\r
+  win^.x:=x;   win^.y:=y;\r
+  win^.x1:=x1; win^.y1:=y1;\r
+ end;\r
+\r
+procedure init_windows;\r
+ begin\r
+  stdscr:=@win_arr[1];\r
+  win1:=@win_arr[2];\r
+  win2:=@win_arr[3];\r
+  nWindow(stdscr,1,1,80,25);\r
+ end;\r
+\r
+procedure WritePrompt(x,y:integer);\r
+ begin\r
+  gotoxy(x,y);\r
+  write(chr(175));\r
+ end;\r
+{$ENDIF}\r
+\r
+function square_wave(time : Real):integer;\r
+  var l:longint;\r
+ begin\r
+  l:=trunc(time);\r
+  if time-l < 0.5 then square_wave:=0 \r
+                  else square_wave:=1;\r
+ end;\r
+\r
+{callback function to generate sound}\r
+procedure ProccessAudio(userdata: Pointer; stream: PUInt8; len: LongInt); cdecl;\r
+  var i,j,k,step:integer;\r
+ begin\r
+  step:=audio_STEP;\r
+  for i:=0 to trunc((len-1)/step) do begin\r
+   \r
+   if speaker_on then\r
+    if sound_i > 0 then begin\r
+     current_freq:=sound_Freqs[sound_play]/audio_freq;\r
+     if current_freq=0 then current_freq:=1;\r
+     sound_play:=sound_play+1;\r
+     if sound_play > sound_i then begin\r
+      speaker_on:=false; sound_i:=0; sound_play:=0; end;\r
+    end;\r
+\r
+   lasttime:=trunc(lasttime*lastfreq/current_freq);\r
+   \r
+   for j:=0 to step-1 do begin\r
+    k:=i*step+j;\r
+    if k<len then\r
+     if speaker_on then\r
+      stream[k]:=audio_VOLUME*square_wave(current_freq * (j+lasttime) )\r
+     else\r
+      stream[k]:=0;\r
+   end;\r
+\r
+   lasttime:=lasttime+step;\r
+   lastfreq:=current_freq; \r
+  end;\r
+ end; \r
+\r
+function InitAudio:boolean;\r
+  var Desired, Obtained: TSDL_AudioSpec;\r
+ begin\r
+  { Set up the requested settings }\r
+  Desired.freq    := audio_FREQ;\r
+  Desired.format  := AUDIO_U8;\r
+  Desired.channels:= 1;\r
+  Desired.samples := audio_SAMPLES;\r
+  Desired.callback:= @ProccessAudio;\r
+  Desired.userdata:= nil;\r
+\r
+  if SDL_Init(SDL_INIT_AUDIO) = 0 then\r
+   if SDL_OpenAudio(@Desired, @Obtained) = 0 then begin\r
+\r
+    speaker_on:=false;\r
+    current_freq:=1; lastfreq:=1;\r
+    sound_ticks:=1;\r
+    SDL_PauseAudio(0);\r
+    InitAudio:=true;\r
+   end \r
+    else InitAudio:=false\r
+  else\r
+   InitAudio:=false;\r
+ end;\r
+\r
+procedure InitScrKbd;\r
+ begin\r
+  buflen:=127;\r
+  CheckBreak:=false;\r
+  if initaudio then sound_supported:=true\r
+   else begin\r
+    WriteLn('SDL failed to initialize audio: ', SDL_GetError);\r
+    sound_supported:=false;\r
+   end;\r
+  UTF8Scr:=false;\r
+  init_windows;\r
+  nWindow(win1,2,2,79,4);\r
+  nWindow(win2,2,5,79,24);\r
+  nsetActiveWin(stdscr);\r
+ end;\r
+\r
+procedure DoneAudio;\r
+ begin\r
+  if sound_supported then begin\r
+   SDL_CloseAudio;\r
+   SDL_Quit;\r
+  end;\r
+ end;\r
+\r
+procedure DoneScrKbd;\r
+ begin\r
+  DoneAudio;\r
+  nSetActiveWin(stdscr);\r
+  clrscr;\r
+ end;\r
+\r
+procedure sound( Hz: Integer );\r
+ begin\r
+  if sound_supported then begin\r
+   sound_i:=0;\r
+   current_freq:=Hz/audio_Freq;\r
+   if current_freq > 0 then\r
+    speaker_on:=true\r
+   else\r
+    current_freq:=1;\r
+  end;\r
+ end;\r
+\r
+procedure nosound;\r
+ begin\r
+  if sound_supported then begin\r
+   if sound_i > 0 then begin\r
+    speaker_on:=true;\r
+    while speaker_on do;\r
+   end else\r
+    speaker_on:=false;\r
+  end;\r
+ end;\r
+\r
+procedure sounddelayed( Hz,step: Integer ); forward;\r
+\r
+procedure sounddelayed( Hz: Integer );\r
+ begin\r
+  sounddelayed( Hz, audio_STEP );\r
+ end;\r
+\r
+procedure sounddelayed( Hz,step: Integer );\r
+ begin\r
+  if sound_supported then begin\r
+   sound_ticks:=sound_ticks+1;\r
+   if sound_ticks mod step = 0 then begin\r
+     if sound_i < audio_MAXENTRIES then begin\r
+      Sound_Freqs[sound_i]:=Hz;\r
+      sound_i:=sound_i+1;\r
+     end;\r
+   end;\r
+  end;\r
+ end;\r
+\r
+procedure delay( MS: Integer);\r
+ begin\r
+  if sound_supported then\r
+   SDL_delay(MS)\r
+  else\r
+{$IFDEF UNIX}\r
+   ocrt.delay(MS);\r
+{$ELSE}\r
+   crt.delay(MS);\r
+{$ENDIF}\r
+ end;\r
+\r
+procedure ReadLine(var S:String);\r
+ var Ch: Char;\r
+ begin\r
+  Repeat\r
+   Ch:=ReadKey;\r
+   write(ch);\r
+   if (buflen>0) and (ch<>Chr(13)) then begin\r
+    S:=S+ch;\r
+    buflen:=buflen-1;\r
+   end;\r
+  Until (Ch=chr(13));\r
+  buflen:=127;\r
+ end;\r
+\r
 procedure SF; begin SFlag:=True end;\r
 \r
 procedure Cur(Num:byte);\r
  begin\r
-  with Result do\r
-   if Color then\r
-    begin AX:=$100;\r
-     case Num of\r
-      1:CX:=$707; { Underline   }\r
-      2:CX:=$8;   { Solid block }\r
-      3:CX:=$800; { Invisible   }\r
-     end;\r
-     intr($10,Result);\r
-    end;\r
+  case Num of  \r
+{$IFDEF UNIX}\r
+   1:ncursor(cON);  { Underline   }\r
+   2:ncursor(cBIG); { Solid block }\r
+   3:nCursor(cOFF); { Invisible   }\r
+{$ELSE}\r
+   1:cursoron;      { Underline   }\r
+   2:cursorbig;     { Solid block }\r
+   3:cursoroff;     { Invisible   }\r
+{$ENDIF}\r
+  end;\r
  end;\r
 \r
 procedure Col(Num1,Num2:byte);\r
@@ -70,8 +310,8 @@ procedure Bak(Num1,Num2:byte);
 \r
 procedure Bor(Num1,Num2:byte);\r
  begin\r
-  with Result do\r
-   begin AX:=$B00;if Color then BX:=Num1 else BX:=Num2 end;intr($10,Result)\r
+  {with Result do\r
+   begin AX:=$B00;if Color then BX:=Num1 else BX:=Num2 end;intr($10,Result)}\r
  end;\r
 \r
 function  En(Num:byte):boolean;\r
@@ -87,11 +327,14 @@ procedure Score(Num,pointer:integer);
  begin if not en(pointer)then begin Sc:=Sc+Num;Add(Pointer)end end;\r
 \r
 procedure Cn(s:str78);\r
- begin gotoxy(40-(length(s)div 2),wherey);writeln(s)end;\r
+ begin gotoxy(40-(length(s)div 2),wherey);write(s);gotoxy(1,wherey+1)end;\r
+\r
+procedure wCn(s:str78);\r
+ begin gotoxy(39-(length(s)div 2),wherey);writeln(s);end;\r
 \r
 procedure Pause;\r
  begin col(15,15);write('Press any key to continue...');\r
-  read(kbd,CFlag);col(11,7);writeln;\r
+  CFlag:=ReadKey;col(11,7);writeln;\r
  end;\r
 \r
 procedure Tune(Octave,Note,Duration:integer);\r
@@ -116,26 +359,32 @@ procedure Play(Start,Stop,Speed:integer);
   var x:integer;\r
  begin\r
   if Start<=Stop then\r
-   for x:=Start to Stop do begin sound(x);delay(Speed)end\r
+   for x:=Start to Stop do\r
+    if Speed>0 then begin sound(x);delay(Speed)end\r
+     else sounddelayed(x)\r
   else\r
-   for x:= Start downto Stop do begin sound(x);delay(Speed)end;\r
-  nosound;if Region=4 then sound(20);if Region=5 then sound(60);\r
+   for x:= Start downto Stop do\r
+    if Speed>0 then begin sound(x);delay(Speed)end\r
+     else sounddelayed(x);\r
+  if Speed>0 then begin\r
+   nosound;if Region=4 then sound(20);if Region=5 then sound(60);\r
+   end;\r
  end;\r
 \r
 procedure Explode(Duration:byte);\r
   var x:integer;\r
- begin for x:=Duration*999 downto 20 do sound(random(x));nosound end;\r
+ begin for x:=Duration*999 downto 20 do sounddelayed(random(x));nosound end;\r
 \r
 procedure Walls(Duration:byte);\r
   var x:integer;\r
- begin for x:=1 to Duration*999 do sound(random(35)+20);nosound end;\r
+ begin for x:=1 to Duration*999 do sounddelayed(random(35)+20);nosound end;\r
 \r
 procedure Static;\r
   var x,y:integer;\r
  begin\r
   for x:=1 to 50 do\r
    case random(2) of\r
-    0:for y:=1 to random(70)+10 do sound(random(4000)+3000);\r
+    0:for y:=1 to random(70)+10 do sounddelayed(random(4000)+3000);\r
     1:begin nosound;delay(random(29))end\r
    end;nosound;if Region=5 then sound(60)\r
  end;\r
@@ -150,14 +399,14 @@ procedure Blast;
 procedure Dopen(Num:byte);\r
  begin writeln('The door slides open...');\r
   if Num<>0 then play(50,125-Num,Num)\r
-  else begin for i:=3500 to 5000 do sound(random(4500)+i);nosound;end;\r
+  else begin for i:=3500 to 5000 do sounddelayed(random(4500)+i);nosound;end;\r
   if Region=5 then sound(60)\r
  end;\r
 \r
 procedure Dclose(Num:byte);\r
  begin writeln('The sliding door closes.');\r
   if Num<>0 then play(125-Num,50,Num)\r
-  else begin for i:=5000 downto 3500 do sound(random(4500)+i);nosound;end;\r
+  else begin for i:=5000 downto 3500 do sounddelayed(random(4500)+i);nosound;end;\r
   if Region=5 then sound(60)\r
  end;\r
 \r
@@ -167,6 +416,45 @@ procedure Door(New,Num:byte);
   if en(8)then RL(23)else begin DOpen(Num);Move(New);DClose(Num)end\r
  end;\r
 \r
+procedure won; forward;\r
+\r
+procedure SoundTest;\r
+  var ch:char;\r
+ begin\r
+\r
+  while true do begin\r
+    \r
+    writeln(' Sounds ');\r
+    writeln(' 1. Won ');\r
+    writeln(' 2. explode(32) ');\r
+    writeln(' 3. Walls(12) ');\r
+    writeln(' 4. Static ');\r
+    writeln(' 5. Blast ');\r
+    writeln(' 6. Dopen(10) ');\r
+    writeln(' 7. Dclose(0) ');\r
+    writeln(' Q. Quit ');\r
+\r
+    ch:=readkey;\r
+\r
+    if ch='q' then halt;\r
+\r
+    case ch of\r
+     '1' : Won;\r
+     '2' : explode(32);\r
+     '3' : Walls(12);\r
+     '4' : Static;\r
+     '5' : Blast;\r
+     '6' : Dopen(10);\r
+     '7' : DClose(0);\r
+     '8' : begin\r
+            for x:=1 to 20 do for y:=1 to x*8 do sounddelayed(x*9,trunc((168-y)/8)); nosound;\r
+           end;\r
+    end;\r
+\r
+  end;\r
+\r
+ end;\r
+\r
 procedure Time1;\r
  begin Tic:=Tic+1; Min(128); { <--Negates DEAD } col(13,15);\r
   for x:=1 to TMax do T[x]:=T[x]-1;\r
@@ -188,7 +476,7 @@ procedure Time1;
    14:RL(9);\r
    5:begin Bor(4,7);RL(10)end;\r
    1:begin RL(126);DEAD;end;\r
-   2..13:begin x:=random(29)+1;\r
+   2..4,6..13:begin x:=random(29)+1;\r
           if(x in Inv)and not(x in Wear)then\r
            begin Van(x);R[x]:=Prm;\r
             writeln('A bout of weariness causes you to loose your grip on',\r
@@ -199,7 +487,7 @@ procedure Time1;
   case T[29] of { Laser Injury }\r
    9:RS(214);\r
    4:begin RL(507);Bor(4,7)end;\r
-   2..11:begin repeat x:=random(27)+1 until x in[1..12,16..20,22..26,28];\r
+   2,3,5..8,10,11:begin repeat x:=random(27)+1 until x in[1..12,16..20,22..26,28];\r
      if(x in Inv)and not(x in Wear)then\r
       begin Van(x);R[x]:=Prm;\r
        if random(2)=0 then\r
@@ -216,7 +504,7 @@ procedure Time1;
    65:begin PStat:=PStat+[3];RL(208)end;\r
    47:RL(209); 30:RS(73); 15:RS(74); 4:begin Bor(4,7);RS(75)end;\r
    1:begin RS(76);DEAD end;\r
-   2..29:if(random(25)=0)and(Inv<>[])and not(en(125))then\r
+   2,3,5..14,16..29:if(random(25)=0)and(Inv<>[])and not(en(125))then\r
           begin RS(232);\r
            for x:=1 to 29 do if(x in Inv)and not(x in Wear)then\r
             begin Van(x);R[x]:=Prm end\r
@@ -226,8 +514,8 @@ procedure Time1;
   if(Prm in[81..88])and(T[30]<1)and(random(4)=0)then\r
    if 28 in Wear then\r
     begin T[30]:=9;RS(153+Prm);\r
-     for i:=999 to 2300 do sound(random(i*3)+i);\r
-     for i:=3000 downto 20 do sound(random(i*4)+i*2);nosound\r
+     for i:=999 to 2300 do sounddelayed(random(i*3)+i);\r
+     for i:=3000 downto 20 do sounddelayed(random(i*4)+i*2);nosound\r
     end\r
    else\r
     begin\r
@@ -237,18 +525,18 @@ procedure Time1;
       84:write('northwest'); 85:write('north'); 86:write('northeast');\r
       87:write('east'); 88:write('southeast')\r
      end; writeln(' section of the corridor and flies');\r
-     RS(242);RS(243);for i:=20 to 3000 do sound(random(i*3)+i);nosound;\r
+     RS(242);RS(243);for i:=20 to 3000 do sounddelayed(random(i*3)+i);nosound;\r
      delay(1500);DEAD\r
     end;\r
  end; { Time1 }\r
 \r
-overlay procedure Time2A;\r
+procedure Time2A;\r
  begin col(10,7);  { Pre-Jungle Planet }\r
   case T[1] of\r
    19:MC(1,13,13,0);\r
    18:begin MC(1,8,8,1);MC(1,13,8,2)end;\r
    17:if en(19) then begin RS(9);T[1]:=11;end;\r
-   11..17:if not(en(19))and(Prm=8)and(random(2)=1)then RL(0);\r
+   11..16:if not(en(19))and(Prm=8)and(random(2)=1)then RL(0);\r
    10:MC(1,8,9,3);\r
    9:begin MC(1,9,0,4);T[1]:=Null;end;\r
    5..7:if(en(2))and(en(3))then begin RB2(5-(T[1]-3),10);col(10,7)end;\r
@@ -290,7 +578,7 @@ overlay procedure Time2A;
   if Prm=SinkRm then begin RL(85);L[Prm]:=L[Prm]+[79];end;\r
 end; { Time2A }\r
 \r
-overlay procedure Time2B;\r
+procedure Time2B;\r
  begin col(10,7);  { Jungle Planet }\r
   Maze:=not(Maze);\r
   if Prm in[42..49]then\r
@@ -320,7 +608,7 @@ overlay procedure Time2B;
   if T[19]=1 then begin RS(128);Walls(12);DEAD;end;\r
  end; { Time2B }\r
 \r
-overlay procedure Time2C;\r
+procedure Time2C;\r
  begin col(11,7);  { Inner Planet }\r
   if T[20]=1 then\r
    case Prm of 73:DClose(20);66:begin RL(337);play(105,50,20)end end;\r
@@ -331,8 +619,8 @@ overlay procedure Time2C;
    writeln('There''s an alarm sound coming over the radio.');\r
    for x:=1 to 23 do\r
     begin\r
-     for i:=450 to 999 do sound(i);\r
-     for i:=999 downto 450 do sound(i);\r
+     for i:=450 to 999 do sounddelayed(i);\r
+     for i:=999 downto 450 do sounddelayed(i);\r
     end;nosound\r
    end;\r
   case random(50) of\r
@@ -343,7 +631,7 @@ overlay procedure Time2C;
   end;\r
  end; { Time2C }\r
 \r
-overlay procedure Time2D;  { Planetship }\r
+procedure Time2D;  { Planetship }\r
   function Warn(Message,IfTime,Said:integer):boolean;\r
    begin Warn:=false;\r
     if not en(Said)and(IfTime>=T[26])then\r
@@ -422,76 +710,38 @@ overlay procedure Time2D;  { Planetship }
   if(T[28]=1998)and(Prm=101)then begin RS(213);Blast;DEAD;end;\r
  end; { Time2D }\r
 \r
-overlay procedure Directory;\r
-type\r
-  Char12arr = array [ 1..12 ] of Char;\r
-  String20  = string[ 20 ];\r
+procedure Directory;\r
 var\r
-  Regs      : Entr;\r
-  DTA       : array [ 1..43 ] of Byte;\r
-  Mask      : Char12arr;\r
-  NamR      : String20;\r
-  Error, I  : Integer;\r
   SM1Found  : boolean;\r
+  Info      : TSearchRec;\r
 begin\r
-  ChDir(Drive+':');\r
+  {ChDir(Drive+':');}\r
   SM1Found:=false;\r
-  FillChar(DTA,SizeOf(DTA),0);\r
-  FillChar(Mask,SizeOf(Mask),0);\r
-  FillChar(NamR,SizeOf(NamR),0);\r
   writeln;\r
-  Regs.AX := $1A00;\r
-  Regs.DS := Seg(DTA);\r
-  Regs.DX := Ofs(DTA);\r
-  MSDos(Regs);\r
-  Error := 0;\r
-  Mask := '????????.???';\r
-  Regs.AX := $4E00;\r
-  Regs.DS := Seg(Mask);\r
-  Regs.DX := Ofs(Mask);\r
-  Regs.CX := 22;\r
-  MSDos(Regs);\r
-  Error := Regs.AX and $FF;\r
-  I := 1;\r
-  if Error=0 then\r
+  if FindFirst ('*',faAnyFile,Info)=0 then\r
     repeat\r
-      NamR[I] := Chr(Mem[Seg(DTA):Ofs(DTA)+29+I]);\r
-      I := I + 1;\r
-    until not (NamR[I-1] in [' '..'~']) or (I>20);\r
-  NamR[0] := Chr(I-1);\r
-  while Error=0 do begin\r
-    Error := 0;\r
-    Regs.AX := $4F00;\r
-    Regs.CX := 22;\r
-    MSDos( Regs );\r
-    Error := Regs.AX and $FF;\r
-    I := 1;\r
-    repeat\r
-      NamR[I] := Chr(Mem[Seg(DTA):Ofs(DTA)+29+I]);\r
-      I := I + 1;\r
-    until not (NamR[I-1] in [' '..'~'] ) or (I > 20);\r
-    NamR[0] := Chr(I-1);\r
-    delete(NamR,length(NamR),2);\r
-    if (Error = 0) then\r
-     if length(NamR)>4 then\r
-      if copy(NamR,length(NamR)-2,3)='SM1' then\r
-       begin\r
-        if not SM1Found then\r
-         writeln('Here is a list of the SAVE/RESTORE files on the ',\r
-                 'disk in drive ',up(Drive),':');\r
+      if length(Info.Name)>4 then\r
+       if copy(Info.Name,length(Info.Name)-2,3)='sm1' then\r
+        begin\r
+         if not SM1Found then\r
+          writeln('Here is a list of the SAVE/RESTORE files on the ',\r
+                  'disk in drive ',up(Drive),':');\r
         SM1Found:=true;\r
-        writeln('    * ',copy(NamR,1,length(NamR)-4));\r
+        writeln('    * ',copy(Info.Name,1,length(Info.Name)-4));\r
        end;\r
-  end; writeln;\r
- if not SM1Found then\r
-  begin\r
-   writeln('There are not any SAVE/RESTORE files on the disk in drive ',\r
+    until FindNext(Info)<>0;\r
+  \r
+  FindClose(Info);\r
+  writeln;\r
+  if not SM1Found then\r
+   begin\r
+    writeln('There are not any SAVE/RESTORE files on the disk in drive ',\r
             up(Drive),':');writeln;\r
-  end;\r
- Pause;ChDir(Log+':');\r
+   end;\r
+  Pause;{ChDir(Log+':');}\r
 end; {Directory}\r
 \r
-function Up;{Word:Str130):Str1}\r
+function Up(Word:Str130):Str1;\r
  begin word:=word+' ';\r
   if(Word[1]='l')and(Word[2]=' ')then insert('ook',Word,2);\r
   if(Word[1]='e')and(Word[2]='x')and(Word[3]=' ')then insert('amine',Word,3);\r
@@ -601,14 +851,14 @@ procedure FindMood(var input:Str130;var Word:Str29;var Md:byte);
   QFormat(input);\r
  end; { FindMood }\r
 \r
-function FN;{(VNP:byte) : Str29;  ( Finds first Noun ) }\r
+function FN(VNP:byte) : Str29; { ( Finds first Noun ) }\r
   var Temp:Str29;\r
  begin SF;\r
   Temp:=n[VNP];\r
   FN:=copy(Temp,1,pos('\',Temp)-1);\r
  end; { FW }\r
 \r
-function Here;{Obj:byte) : Boolean;}\r
+function Here(Obj:byte) : Boolean;\r
  begin Here:=false;\r
   if Obj in L[Prm] then Here:=true;\r
   if(Obj=79)and(MugCon=79)and(29 in Inv)then Here:=true;\r
@@ -722,7 +972,7 @@ procedure Dictionary(IfFound,SkipList:byte);
   end;\r
  end; { Dictionary }\r
 \r
-procedure RL;\r
+procedure RL(Pointer:Integer);\r
  begin SF;\r
   if(pointer<>StoreL)then\r
    begin StoreL:=pointer;\r
@@ -732,7 +982,7 @@ procedure RL;
   writeln(Text3);\r
  end; { Read Line }\r
 \r
-procedure RS;\r
+procedure RS(Pointer:Integer);\r
  begin SF;\r
   if(pointer<>StoreS)then\r
    begin StoreS:=pointer;\r
@@ -742,7 +992,7 @@ procedure RS;
   writeln(Text4);\r
  end; { Read Special }\r
 \r
-procedure RR;\r
+procedure RR(Pointer:integer);\r
  begin SF;\r
   if(pointer<>StoreR)then\r
    begin StoreR:=pointer;\r
@@ -751,10 +1001,11 @@ procedure RR;
     read(R1,Text1);\r
     read(R2,Text2);\r
    end;\r
-  writeln(Text1,Text2);\r
+  write(Text1);\r
+  writeln(Text2);\r
  end; { Read Room }\r
 \r
-procedure RB;\r
+procedure RB(Pointer,Colour:byte);\r
   var Block:Str255;\r
       Tstart,TStop:Str19;\r
  begin SF; Col(Colour,7);\r
@@ -771,7 +1022,7 @@ procedure RB;
   until Block=TStop; col(11,7);\r
  end;\r
 \r
-procedure RB2;\r
+procedure RB2(Pointer,Colour:byte);\r
   var Block:Str255;\r
       Tstart,TStop:Str19;\r
  begin SF; Col(Colour,7);\r
@@ -788,7 +1039,7 @@ procedure RB2;
   until Block=TStop; col(11,7);\r
  end;\r
 \r
-overlay procedure Won;\r
+procedure Won;\r
   const W=800;H=400;Q=200;T=131;\r
   label JUMP;\r
  begin writeln;\r
@@ -833,70 +1084,74 @@ overlay procedure Won;
    tune(3,3,h);tune(3,1,h);tune(2,12,h);tune(2,10,t);tune(2,10,t);tune(2,10,t);\r
    tune(3,1,w);\r
   until keypressed;\r
-  JUMP: read(kbd,CFlag);\r
+  JUMP: CFlag:=ReadKey;\r
+  DoneScrKbd;\r
   window(1,1,80,25);clrscr;gotoxy(2,2);Col(31,31);Bor(0,0);Cur(1);Bak(2,0);\r
   writeln('Congratulations!');\r
   HALT;\r
  end; { Won }\r
 \r
-overlay procedure PlayerInput(var LINE:Str130);\r
+procedure PlayerInput(var LINE:Str130);\r
   label JUMP;\r
+  var Ch : Char;\r
+      ExtCode : integer;\r
   procedure Key(k:Str19); begin Line:=Line+k;QFlag:=true;write(k)end;\r
  begin\r
- with Result do begin\r
+ {with Result do begin}\r
   WRITELN; { Main Space In Game }\r
   if(length(Line)=0)then\r
    begin\r
+    nSetActiveWin(win1);\r
     bak(4,7);col(14,0);\r
-    window(1,1,80,22);\r
-    gotoxy(8,2);write(Tic,'   ');\r
-    gotoxy(35-(length(RN[Prm])div 2),2);\r
+    gotoxy(7,1);write(Tic,'   ');\r
+    gotoxy(34-(length(RN[Prm])div 2),1);\r
       write('      ',RN[Prm],'      ');\r
-    gotoxy(75,2);write('    ');gotoxy(75,2);write(Sc,' ');\r
+    gotoxy(74,1);write('    ');gotoxy(74,1);write(Sc,' ');\r
     bak(7,7);\r
-    col(1,0);gotoxy(22,3);\r
+    col(1,0);gotoxy(21,2);\r
     if PStat=[] then write('Healthy') else write('  *    ');\r
-    col(15,0);gotoxy(33,3);\r
+    col(15,0);gotoxy(32,2);\r
     if 2 in PStat then begin col(31,16);write('Hungry')end\r
     else write(' *    ');\r
-    col(4,0);gotoxy(43,3);\r
+    col(4,0);gotoxy(42,2);\r
     if 3 in PStat then begin col(20,16);write('Sick')end\r
     else write(' *  ');\r
-    col(0,0);gotoxy(51,3);\r
+    col(0,0);gotoxy(50,2);\r
     if 4 in PStat then begin col(16,16);write('Injured')end\r
     else write('   *   ');\r
-    col(6,0);gotoxy(62,3);\r
+    col(6,0);gotoxy(61,2);\r
     if 5 in PStat then begin col(22,16);write('Tired')end\r
     else write('  *  ');\r
-    col(5,0);gotoxy(71,3);\r
+    col(5,0);gotoxy(70,2);\r
     if 6 in PStat then begin col(21,16);write('Thirsty')end\r
     else write('   *   ');\r
-    bak(0,0);window(2,5,79,24);\r
+    nSetActiveWin(win2);bak(0,0);\r
     if en(66)then begin gotoxy(1,20);goto JUMP;end;\r
-    gotoxy(1,20);col(28,31);writeln(chr(175));\r
+    gotoxy(1,20);col(28,31);writeln;\r
+    WritePrompt(1,19);\r
     Cur(1);\r
     col(14,7);gotoxy(3,19);\r
     QFlag:=false;\r
     repeat\r
-     ax:=0;\r
-     intr($16,result);\r
-     sound(99);nosound;case Region of 4:sound(20);5:sound(60)end;\r
-     case chr(Lo(ax)) of\r
+     Ch:=Readkey;\r
+     { Read Extended (Scan) Code }\r
+     if Ch = #0 then ExtCode:=Ord(Readkey);\r
+     sounddelayed(99,1);speaker_on:=true;delay(1);case Region of 4:sound(20);5:sound(60)end;\r
+     case Ch of\r
      ^h:begin\r
-         if(wherex=1)and(wherey=20)then\r
-          begin window(1,1,80,25);gotoxy(80,23)end;\r
+       if(wherex=1)and(wherey=20)then\r
+           begin gotoxy(78,wherey-1); ClrEol; end else\r
          if length(Line)>0 then write(^h,' ',^h);\r
          delete(Line,length(Line),2);\r
-         window(2,5,79,24);\r
         end;\r
      ^m:QFlag:=true\r
      else\r
       begin\r
-       if(Lo(ax)>0)and(length(Line)<110)then\r
-        begin write(chr(Lo(ax)));Line:=Line+chr(Lo(ax));end\r
+       if(Ord(Ch)>0)and(length(Line)<110)then\r
+        begin write(Ch);Line:=Line+Ch;end\r
        else { read scan }\r
         begin\r
-         case hi(ax) of\r
+         case ExtCode of\r
           59:key('Save');      71:key('Northwest');\r
           60:key('Restore');   73:key('Northeast');\r
           61:key('R D');       79:key('Southwest');\r
@@ -909,13 +1164,14 @@ overlay procedure PlayerInput(var LINE:Str130);
           68:begin Line:='';key('Repeat')end;\r
           94,30:key('by Scott Miller');\r
           95,47:key('Version A Dec 9, 85');\r
+          31:SoundTest;\r
          end;\r
         if Prm in[1..7] then\r
-         case hi(ax) of\r
+         case ExtCode of\r
           72:key('Fore'); 75:key('Port'); 77:key('Starboard'); 80:key('Aft')\r
          end\r
         else\r
-         case hi(ax) of\r
+         case ExtCode of\r
           72:key('North'); 75:key('West'); 77:key('East'); 80:key('South')\r
          end\r
        end\r
@@ -923,7 +1179,7 @@ overlay procedure PlayerInput(var LINE:Str130);
      end; {case}\r
      until QFlag=true;\r
     Cur(3);\r
-    gotoxy(1,19);col(5,7);write(chr(175));col(11,7);gotoxy(1,20);\r
+    col(5,7);WritePrompt(1,19);col(11,7);gotoxy(1,20);\r
     if length(Line)>76 then writeln;\r
     LowerCase(Line);Spaces(Line);\r
     if(pos(' r ',Line)>0)or(pos(' repeat ',Line)>0)then PreFormat(Line);\r
@@ -959,16 +1215,19 @@ overlay procedure PlayerInput(var LINE:Str130);
    QFormat(input);\r
    col(11,7);\r
    JUMP:\r
end; { of with statement }\r
{end;} { of with statement }\r
  end; { PlayerInput }\r
 \r
-overlay procedure Title;\r
+procedure Title;\r
+{$IFDEF UNIX}\r
+ var win:pwindow;\r
+{$ENDIF}\r
  begin\r
   clrscr;textcolor(7);Color:=true;\r
   if ParamCount=0 then begin\r
    write('Do you want ');textcolor(15);write('C');textcolor(7);\r
    write('olor or ');textcolor(15);write('B');textcolor(7);\r
-   write('lack and white? ');textcolor(15);read(kbd,CFlag);\r
+   write('lack and white? ');textcolor(15); CFlag:=ReadKey;\r
    if(upcase(CFlag)='B')or(upcase(CFlag)='M')then\r
     begin Color:=false;write('Monochrome')end\r
    else write('Color');delay(300);\r
@@ -984,7 +1243,7 @@ overlay procedure Title;
   Cur(3);\r
 \r
                  {**** Public Domain title screen ****}\r
-  Col(9,9);gotoxy(1,1);\r
+  {Col(9,9);gotoxy(1,1);\r
   cn('S U P E R N O V A');\r
   Col(9,7);gotoxy(1,3);\r
   cn('Published by');\r
@@ -1013,17 +1272,22 @@ overlay procedure Title;
   cn('Thanks, enjoy the game...');\r
 \r
   Col(7,7);gotoxy(27,25);delay(999);\r
-  write('Press any key to continue.');repeat;begin;end;until keypressed;\r
-  read(kbd,CFlag);bak(1,0);clrscr;\r
+  write('Press any key to continue.');repeat;delay(1);until keypressed;\r
+  CFlag:=ReadKey;}bak(1,0);clrscr;\r
                  {**** Main SUPERNOVA title screen ****}\r
 \r
   Bor(1,0);Col(15,15);Bak(4,0);\r
+{$IFDEF UNIX}\r
+  nWindow(win,1,1,80,24);\r
+  nFrame(win);\r
+{$ELSE}\r
   for x:=1 to 80 do\r
    begin gotoxy(x,1);write(chr(205));gotoxy(x,24);write(chr(205))end;\r
   for y:=1 to 24 do\r
    begin gotoxy(1,y);write(chr(186));gotoxy(80,y);write(chr(186))end;\r
   gotoxy(1,1);write(chr(201)); gotoxy(80,1);write(chr(187));\r
   gotoxy(1,24);write(chr(200)); gotoxy(80,24);write(chr(188));\r
+{$ENDIF}\r
   Bak(1,0);\r
   Col(2,7);gotoxy(1,10);cn('Copyright 1987 Scott Miller');\r
   Col(14,7);gotoxy(1,12);cn('Version B');\r
@@ -1037,12 +1301,17 @@ overlay procedure Title;
    if Color then textcolor(random(16))\r
    else case random(3) of  0:textcolor(0); 1:textcolor(7); 2:textcolor(15)end;\r
    write('S U P E R N O V A');\r
+   delay(1);\r
   until keypressed;\r
-  read(kbd,CFlag);\r
+  CFlag:=ReadKey;\r
+{$IFDEF UNIX}\r
+  nSetActiveWin(stdscr);\r
+  nDelWindow(win);\r
+{$ENDIF}\r
   if Color then textmode(C80)else textmode(BW80);\r
  end; { Title }\r
 \r
-overlay procedure Init1;\r
+procedure Init1;\r
   label Abort;\r
  begin ABORT:\r
   Bor(0,0);bak(0,0);clrscr;nosound;\r
@@ -1051,12 +1320,14 @@ overlay procedure Init1;
   for x:=1 to 20 do begin sound(x*9);delay(x*2)end;nosound;\r
   gotoxy(1,9);y:=0;col(14,7);Identity:='';\r
   Cn('Please enter your identity code name:');col(12,15);\r
-  repeat i:=random(maxint) until keypressed;\r
-  repeat read(kbd,CFlag);\r
+  repeat begin i:=random(maxint); delay(1) end; until keypressed;\r
+  repeat CFlag:=ReadKey;\r
    if(CFlag<>chr(13))then\r
     if(CFlag<>^h)then Identity:=Identity+upcase(CFlag)\r
     else delete(Identity,length(Identity),2);\r
-   gotoxy(1,11);Cn(' '+Identity+' ');sound(50);delay(50);nosound;\r
+   gotoxy(1,11);Cn(' '+Identity+' ');\r
+{sound(50);delay(50);nosound;}\r
+   for x:=1 to 50 do sounddelayed(50,1); nosound;\r
   until CFlag=chr(13);\r
   col(10,7);gotoxy(1,7);\r
   if identity<>'' then\r
@@ -1075,9 +1346,15 @@ overlay procedure Init1;
   reset(S1);reset(L1);reset(C1);\r
  end; { Init1 }\r
 \r
-overlay procedure Init2;\r
+procedure Init2;\r
  begin\r
   col(7,15);bak(1,7);\r
+{$IFDEF UNIX}\r
+  nFrame(stdscr);\r
+  nWriteAC(stdscr,1,4,TextAttr,nLT);\r
+  nWriteAC(stdscr,nCols(stdScr),4,TextAttr,nRT);\r
+  nrefresh(stdscr);\r
+{$ELSE}\r
   for x:=1 to 80 do\r
    begin gotoxy(x,1);write(chr(205));gotoxy(x,24);write(chr(205))end;\r
   gotoxy(80,24);write(chr(190));gotoxy(1,24);write(chr(212));\r
@@ -1087,27 +1364,35 @@ overlay procedure Init2;
   gotoxy(1,4);write(chr(198));for x:=2 to 79 do\r
    begin gotoxy(x,4);write(chr(205))end;write(chr(181));\r
   gotoxy(1,1);write(chr(213));gotoxy(80,1);write(chr(184));\r
-  bak(4,7);col(14,0);gotoxy(2,2);\r
+{$ENDIF}\r
+  nSetActiveWin(win1);\r
+  bak(4,7);col(14,0);gotoxy(1,1);\r
   for x:=1 to 78 do write(' ');\r
-   gotoxy(2,2);write('Move');\r
-  gotoxy(68,2);write('Score');\r
-  bak(7,7);gotoxy(2,3);\r
+   gotoxy(1,1);write('Move');\r
+  gotoxy(67,1);write('Score');\r
+  bak(7,7);gotoxy(1,2);\r
   for x:=1 to 78 do write(' ');\r
   bak(5,7);col(15,0);\r
-  gotoxy(2,3);write('Player Condition:');\r
+  gotoxy(1,2);write('Player Condition:');\r
+  col(7,15);bak(1,7);\r
+{$IFDEF UNIX}\r
+  gotoxy(1,3);whLine(win1,nHL,nCols(stdScr)-2);\r
+  nRefresh(win1);\r
+{$ENDIF}\r
+  nSetActiveWin(win2);\r
   bak(0,0);\r
-  gotoxy(1,14);col(14,7);\r
-  cn('Working 14 hours a day in the core of some dusty, smelly mine');\r
-  cn('is not your idea of the perfect lifestyle.');\r
-  cn('Barre-An is a dust ball in space, its only salvation being that it is');\r
-  cn('rich in precious barre-an metal.  Or used to be.  Nowadays the mines');\r
-  cn('don''t seem so generous, which is why you''re looking for a more');\r
-  cn('profitable venture.');\r
-  cn('A break, that''s all you ask for, maybe today you figure...');\r
+  gotoxy(1,10);col(14,7);\r
+  wcn('Working 14 hours a day in the core of some dusty, smelly mine');\r
+  wcn('is not your idea of the perfect lifestyle.');\r
+  wcn('Barre-An is a dust ball in space, its only salvation being that it is');\r
+  wcn('rich in precious barre-an metal.  Or used to be.  Nowadays the mines');\r
+  wcn('don''t seem so generous, which is why you''re looking for a more');\r
+  wcn('profitable venture.');\r
+  wcn('A break, that''s all you ask for, maybe today you figure...');\r
   writeln;\r
  end; { Init2 }\r
 \r
-overlay procedure Init3;\r
+procedure Init3;\r
  begin\r
   Line    :='';\r
   Again   :='z';\r
@@ -1161,23 +1446,24 @@ overlay procedure Init3;
   ToNounOnly  :=[33,49,64,88,93];\r
   ToNounMaybe :=[19,41..44,48,50,53,54,74..76,89,90,92,94];\r
   { NOTE:  All other verbs would be OneNounOnly! }\r
-  window(2,5,79,24);gotoxy(1,19);\r
+  nSetActiveWin(win2);gotoxy(1,19);\r
  end; { Init3 }\r
 \r
-overlay procedure Save;\r
+procedure Save;\r
   label JUMPABORT,JUMPBACK;\r
-  var   DiskTest:file;\r
+  {var   DiskTest:file;}\r
  begin SF; JUMPBACK: nosound; for x:=1 to 20 do writeln;\r
   Bor(2,7);CFlag:=Drive;Cur(2);\r
   gotoxy(1,2);\r
+  { remove floppy drive selection\r
   write('Which disk drive (default ',Up(Drive),':)? ');\r
-  col(14,15);buflen:=1;readln(Drive);col(11,7);\r
-  Drive:=upcase(Drive);if not(Drive in['A','B'])then Drive:=CFlag;\r
+  col(14,15);buflen:=1;readline(Drive);col(11,7);\r
+  Drive:=upcase(Drive);if not(Drive in['A','B'])then Drive:=CFlag;}\r
   gotoxy(1,5);\r
   writeln('Make sure your SAVE/RESTORE disk is in disk drive ',up(Drive),':');\r
   writeln;writeln;\r
   write('SAVE under what file name (''',up('/'),''' aborts SAVE)? ');\r
-  buflen:=8;col(14,15);readln(input);col(11,7);\r
+  buflen:=8;col(14,15);readline(input);col(11,7);\r
   Cur(3);\r
   while pos(' ',input)>0 do delete(input,pos(' ',input),1);\r
   while pos('.',input)>0 do delete(input,pos('.',input),1);\r
@@ -1190,7 +1476,8 @@ overlay procedure Save;
   if length(input)=0 then input:='LASTSAVE';writeln;writeln;\r
   writeln('The game file ',Up(Input),' is now being saved on disk drive ',\r
            up(Drive),':...');\r
-  input:=Drive+':'+input;\r
+  { don't put Drive\r
+  input:=Drive+':'+input;}\r
   assign(Objects,input+'.sm1');\r
   rewrite(Objects);\r
   for x:=0 to RMax do write(Objects,L[x]);\r
@@ -1218,33 +1505,35 @@ overlay procedure Save;
   writeln('Your present game location is now SAVED under the name ',\r
            up(input),'.');\r
   writeln; JUMPABORT: writeln;\r
+  { remove checking SUPERNOVA floppy disk\r
   writeln('Please make sure the SUPERNOVA disk is in drive ',up(Log),':');\r
   writeln;writeln;Pause;\r
-  assign(DiskTest,'Nova.com');\r
+  assign(DiskTest,'Nova.com');}\r
   {$I-}\r
-  reset(DiskTest);\r
+  {reset(DiskTest);}\r
   {$I+}\r
-  if IOResult<>0 then\r
+  {if IOResult<>0 then\r
    begin Col(15,15);close(DiskTest);write(^g);goto JUMPABORT;end;\r
-  close(DiskTest);Col(11,7);\r
+  close(DiskTest);Col(11,7);\r
   Bor(0,0);Line:='l';\r
   case Region of 4:sound(20);5:sound(60)end\r
  end; { SAVE }\r
 \r
-overlay procedure Restore;\r
+procedure Restore;\r
   label JUMP,JUMPBACK;\r
-  var   DiskTest:file;\r
+  {var   DiskTest:file;}\r
  begin SF; JUMPBACK: nosound; for x:=1 to 25 do writeln;\r
   Bor(6,7);CFlag:=Drive;Cur(2);\r
   gotoxy(1,2);\r
+  { remove floppy disk selection\r
   write('Which disk drive (default ',Up(Drive),':)? ');\r
-  col(14,15);buflen:=1;readln(Drive);col(11,7);\r
-  Drive:=upcase(Drive);if not(Drive in['A','B'])then Drive:=CFlag;\r
+  col(14,15);buflen:=1;readline(Drive);col(11,7);\r
+  Drive:=upcase(Drive);if not(Drive in['A','B'])then Drive:=CFlag;}\r
   gotoxy(1,5);\r
   writeln('Make sure your SAVE/RESTORE disk is in disk drive ',up(Drive),':');\r
   writeln;writeln;\r
   write('RESTORE from what file name (''',up('/'),''' aborts RESTORE)? ');\r
-  buflen:=8;col(14,15);readln(input);col(11,7);\r
+  buflen:=8;col(14,15);readline(input);col(11,7);\r
   Cur(3);\r
   while pos(' ',input)>0 do delete(input,pos(' ',input),1);\r
   while pos('.',input)>0 do delete(input,pos('.',input),1);\r
@@ -1257,7 +1546,8 @@ overlay procedure Restore;
   if length(input)=0 then input:='LASTSAVE';writeln;writeln;\r
   writeln('The game file ',Up(Input),' is now being restored from drive ',\r
            up(Drive),':...');\r
-  input:=Drive+':'+input;\r
+  { Don't put Drive\r
+  input:=Drive+':'+input;}\r
   assign(Objects,input+'.sm1');\r
   {$I-}\r
   reset(Objects);\r
@@ -1265,7 +1555,7 @@ overlay procedure Restore;
   if IOResult<>0 then\r
    begin close(Objects);col(12,15);writeln;writeln;delete(input,1,2);\r
     for x:=1 to length(input) do input[x]:=upcase(input[x]);\r
-    Cn('The file '+input+' does not exist on your SAVE/RESTORE disk!');\r
+    wCn('The file '+input+' does not exist on your SAVE/RESTORE disk!');\r
     writeln(^g);delay(2000);col(11,7);goto JUMPBACK;\r
    end;\r
   reset(Objects);\r
@@ -1295,15 +1585,16 @@ overlay procedure Restore;
   writeln('Your present game location is now RESTORED from the name ',\r
            up(input),'.');\r
   writeln; JUMP: writeln;\r
+  { remove checking SUPERNOVA floppy disk\r
   writeln('Please make sure the SUPERNOVA disk is in drive ',up(Log),':');\r
   writeln;writeln;Pause;\r
-  assign(DiskTest,'Nova.com');\r
+  assign(DiskTest,'Nova.com');}\r
   {$I-}\r
-  reset(DiskTest);\r
+  {reset(DiskTest);}\r
   {$I+}\r
-  if IOResult<>0 then\r
+  {if IOResult<>0 then\r
    begin Col(15,15);close(DiskTest);write(^g);goto JUMP;end;\r
-  close(DiskTest);Col(11,7);\r
+  close(DiskTest);Col(11,7);\r
   Bor(0,0);\r
   case Region of 4:sound(20);5:sound(60)end;\r
   if Region>1 then\r
@@ -1337,7 +1628,7 @@ procedure MoreThanOne;
   if((N1=58)or(58 in NounSet)or(N2=58))and Here(3) and Here(4) then\r
    begin Cur(2);\r
     repeat write('Which one, the R)usty or S)hiney key? ');\r
-     read(kbd,CFlag);writeln(CFlag);writeln until upcase(CFlag) in ['R','S'];\r
+     CFlag:=Readkey;writeln(CFlag);writeln until upcase(CFlag) in ['R','S'];\r
     case upcase(CFlag) of 'R':x:=3; 'S':x:=4 end;\r
     if N1=58 then N1:=x;\r
     if N2=58 then N2:=x;\r
@@ -1346,7 +1637,7 @@ procedure MoreThanOne;
   if((N1=86)or(86 in NounSet)or(N2=86))and(Prm=8)then\r
    begin Cur(2);\r
     repeat write('Which one, the W)estern, M)iddle or E)astern table? ');\r
-     read(kbd,CFlag);writeln(CFlag);\r
+     CFlag:=ReadKey;writeln(CFlag);\r
      writeln until upcase(CFlag) in ['W','M','E'];\r
     case upcase(CFlag) of 'W':x:=83; 'M':x:=84; 'E':x:=85 end;\r
     if N1=86 then N1:=x;\r
@@ -1356,7 +1647,7 @@ procedure MoreThanOne;
   if((N1=44)or(44 in NounSet)or(N2=44))and(Prm in[1,70])and(Vb<>28)then\r
    begin Cur(2);\r
     repeat write('Which one, the T)an, P)urple or C)yan button? ');\r
-     read(kbd,CFlag);writeln(CFlag);\r
+     CFlag:=ReadKey;writeln(CFlag);\r
      writeln until upcase(CFlag) in ['T','P','C'];\r
     case upcase(CFlag) of 'T':x:=41; 'P':x:=43; 'C':x:=40 end;\r
     if N1=44 then N1:=x;\r
@@ -1535,7 +1826,7 @@ JUMP2:  { Used if the player forgets the second noun or preposition. }
  end;\r
 end; { Parser Syntax }\r
 \r
-procedure MC;{WhichChar,WatchRoom,ToRoom:byte;MessageNum:Integer}\r
+procedure MC(WhichChar,WatchRoom,ToRoom:byte;MessageNum:Integer);\r
     { WhichChar refers to the character(s) being moved.               }\r
     { WatchRoom is the room the player must be in to see the responce.}\r
     { ToRoom is the room the character(s) move to.                    }\r
@@ -1555,7 +1846,7 @@ procedure MC;{WhichChar,WatchRoom,ToRoom:byte;MessageNum:Integer}
   SFlag:=false;\r
  end;\r
 \r
-procedure Van;\r
+procedure Van(o:byte);\r
  begin\r
   Inv:=Inv-[o];\r
   r[o]:=Null;\r
index 52abeeff2276fa4cfabe48093fed313e25ef67cc..b379046a8a9357569af59ed5dde4f063f1a25fdc 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -25,6 +47,8 @@
 {*/                                                                         }\r
 {//-------------------------------------------------------------------------}\r
 {$c-}\r
+uses crt;\r
+\r
 const\r
   Max = 77;\r
 \r
@@ -62,7 +86,7 @@ text1   : MaxLength;
       begin\r
         highvideo;\r
         READ(C1,text1);\r
-        if list then writeln(lst,counter,':',text1)\r
+        if list then writeln(counter,':',text1)\r
         else\r
           begin\r
             writeln('Here is CLUE # ',counter);\r
@@ -89,7 +113,7 @@ repeat          {Main loop.}
 \r
 writeln;\r
 writeln('Do you want to R)ead, W)rite or Q)uit?');\r
-read(kbd,answer);\r
+answer:=readkey;\r
 if upcase(answer) = 'Q' then begin writeln('FINISHED');halt;end;\r
 if upcase(answer) <> 'R' then       {Write to 'Clues'.}\r
     begin\r
@@ -103,7 +127,7 @@ if upcase(answer) <> 'R' then       {Write to 'Clues'.}
       x:=wherey;if(x>21)then x:=22;for stop:=1 to 3 do writeln;gotoxy(1,x);\r
       textcolor(11);\r
         repeat\r
-          read(trm,letter);\r
+          letter:=readkey;\r
           if letter = ^h then\r
             begin\r
               write(^h,' ',^h);\r
@@ -129,7 +153,7 @@ else                      {Read from 'Clues'.}
   begin\r
     writeln;writeln;\r
     writeln('To the S)creen or the P)rinter');\r
-    read(kbd,answer);\r
+    answer:=readkey;\r
     if(upcase(answer)='P')then List:=True else List:=False;\r
     assign(C1,'C1');\r
     reset(C1);\r
index c7107f29f4b7f9f56e995e26593caa15c6abb0f5..acf7ce391d993f005f6fd4661fe1c7f65d4edb30 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -59,7 +81,7 @@ case Vb of
  end {main case}\r
 end; { Default0 }\r
 {----------}\r
-overlay procedure Default1;\r
+procedure Default1;\r
 begin\r
 case Vb of\r
 \r
@@ -124,8 +146,8 @@ case Vb of
  end; {main case}\r
 end; { Default1 }\r
 {----------}\r
-overlay procedure Default2;\r
- label JUMP;\r
+procedure Default2;\r
+{ label JUMP;}\r
 begin\r
 case Vb of\r
 \r
@@ -141,11 +163,16 @@ case Vb of
             'should first use the');writeln('SAVE command.');\r
     write('Are you still sure you want to QUIT?  ');\r
     Cur(2);\r
-    read(kbd,CFlag);\r
+    CFlag:=Readkey;\r
     if upcase(CFlag)='Y' then\r
      begin\r
       RL(12);delay(2200);\r
-      close(R1);close(R2);close(S1);close(L1);close(C1);close(T1);close(T2);\r
+      close(R1);close(R2);close(S1);close(L1);close(C1);\r
+      {$I-}\r
+      close(T1);if IOResult<>0 then begin end;\r
+      close(T2);if IOResult<>0 then begin end;\r
+      {$I+}\r
+      DoneScrKbd;\r
       window(1,1,80,25);nosound;clrscr;Cur(1);Bor(0,0);gotoxy(2,2);\r
       Col(31,16);Bak(4,7);writeln('Good-bye!');halt;\r
      end\r
@@ -217,7 +244,7 @@ case Vb of
  end; {main case}\r
 end; { Default2 }\r
 {----------}\r
-overlay procedure Default3;\r
+procedure Default3;\r
 begin SFlag:=false;\r
 case Vb of\r
 \r
@@ -282,7 +309,7 @@ case Vb of
  end {main case}\r
 end; { Default3 }\r
 {----------}\r
-overlay procedure Default4;\r
+procedure Default4;\r
 begin\r
 case VB of\r
 \r
@@ -358,7 +385,7 @@ case VB of
  end; {main case}\r
 end; { Default4 }\r
 {----------}\r
-overlay procedure Default5;\r
+procedure Default5;\r
  label JUMP,JUMP1;\r
 begin\r
 case Vb of\r
@@ -432,7 +459,7 @@ JUMP: if MugCon<>Null then
  end; {main case}\r
 end; { Default5 }\r
 {----------}\r
-overlay procedure Default6;\r
+procedure Default6;\r
  function Word(W:Str29):boolean;\r
   begin if pos(' '+W+' ',input)>0 then Word:=true else Word:=false end;\r
 begin\r
@@ -503,7 +530,7 @@ case Vb of
  end; {main case}\r
 end; { Default6 }\r
 {----------}\r
-overlay procedure Default7;\r
+procedure Default7;\r
 begin\r
 case Vb of\r
 \r
@@ -563,7 +590,7 @@ case Vb of
 93:if Pr=6 then\r
     if(N2 in Mov)or(N2=60)then\r
      case N1 of\r
-      60:begin Cur(2);write('Are you sure? ');read(kbd,CFlag);Cur(3);writeln;\r
+      60:begin Cur(2);write('Are you sure? ');CFlag:=Readkey;Cur(3);writeln;\r
           if upcase(CFlag)='Y' then begin RL(488);Add(128);end\r
           else writeln('Whew!')end;\r
       123:RL(465);\r
@@ -583,7 +610,7 @@ case Vb of
  end; {main case}\r
 end; { Default7 }\r
 {----------}\r
-overlay procedure Default8;\r
+procedure Default8;\r
  label JUMP;\r
 begin\r
 case Vb of\r
@@ -656,7 +683,7 @@ case Vb of
  end; {main case}\r
 end; { Default8 }\r
 {----------}\r
-overlay procedure Default9;\r
+procedure Default9;\r
  label JUMP;\r
 begin\r
 case Vb of\r
@@ -671,7 +698,7 @@ case Vb of
     29:if MugCon<>Null then writeln('The mug contains ',FN(MugCon),'.')\r
        else RL(111);\r
     35:if NStr='toilet' then RL(114)else RL(113);\r
-    7,10,26,28,32,62,64,69,98,113:writeln('The ',NStr,' is empty.');\r
+    10,26,28,32,62,64,69,98,113:writeln('The ',NStr,' is empty.');\r
     119:RL(112);\r
     103..109,115,118:if Prm=63 then RL(113)else RL(115)\r
     else RL(113)\r
@@ -701,7 +728,7 @@ case Vb of
     if not en(15) then\r
      begin Add(15);RS(30);\r
       Cur(2);\r
-      write('Do you still wish to see the clue? ');read(kbd,CFlag);writeln;\r
+      write('Do you still wish to see the clue? ');CFlag:=Readkey;writeln;\r
       if upcase(CFlag)='N' then\r
        begin writeln('OK, no clue will be shown.');goto JUMP;end\r
      end;\r
@@ -717,7 +744,7 @@ case Vb of
  end; {main case}\r
 end; { Default9 }\r
 {----------}\r
-overlay procedure Default10;\r
+procedure Default10;\r
 begin\r
 case Vb of\r
 \r
@@ -799,7 +826,7 @@ case Vb of
  end; {main case}\r
 end; { Default10 }\r
 {----------}\r
-overlay procedure Default11;\r
+procedure Default11;\r
 begin\r
 case Vb of\r
 \r
@@ -853,12 +880,17 @@ case Vb of
 { RESTART }\r
 86:begin Bor(1,0);Cur(2);\r
     write('Are you sure you want to restart your game? ');\r
-    read(kbd,CFlag);\r
+    CFlag:=Readkey;\r
     if upcase(CFlag)<>'Y' then RL(169)\r
     else\r
      begin RL(170);delay(2000);window(1,1,80,25);clrscr;Bor(0,0);nosound;\r
-      close(R1);close(R2);close(S1);close(L1);close(C1);close(T1);close(T2);\r
-      assign(R1,'nova.com');execute(R1)\r
+      close(R1);close(R2);close(S1);close(L1);close(C1);\r
+      {$I-}\r
+      close(T1);if IOResult<>0 then begin end;\r
+      close(T2);if IOResult<>0 then begin end;\r
+      {$I+}\r
+      DoneScrKbd;\r
+      Halt(ExecuteProcess(ParamStr(0),''));\r
      end;Bor(0,0);\r
    end;\r
 \r
@@ -876,7 +908,7 @@ case Vb of
  end; {main case}\r
 end; { Default11 }\r
 {----------}\r
-overlay procedure Default12;\r
+procedure Default12;\r
 begin\r
 case Vb of\r
 \r
@@ -947,7 +979,7 @@ case Vb of
  end; {main case}\r
 end; { Default12 }\r
 {----------}\r
-overlay procedure Default13;\r
+procedure Default13;\r
 begin\r
 case Vb of\r
 \r
@@ -1014,7 +1046,7 @@ case Vb of
  end; {main case}\r
 end; { Default13 }\r
 {----------}\r
-overlay procedure Default14;\r
+procedure Default14;\r
 begin\r
 case Vb of\r
 \r
@@ -1073,7 +1105,7 @@ case Vb of
  end; {main case}\r
 end; { Default14 }\r
 {----------}\r
-overlay procedure DeadMain;\r
+procedure DeadMain;\r
   label JUMP;\r
  begin writeln;\r
   gotoxy(1,20);for x:=5 downto 1 do\r
@@ -1101,17 +1133,26 @@ overlay procedure DeadMain;
    write('Would you like to ');Col(14,15);write('S');Col(11,7);\r
    write('tart a new game, ');Col(14,15);write('R');Col(11,7);\r
    write('estore or ');Col(14,15);write('Q');Col(11,7);write('uit? ');\r
-   read(kbd,CFlag);CFlag:=upcase(CFlag);Col(9,15);writeln(CFlag);\r
+   CFlag:=Readkey;CFlag:=upcase(CFlag);Col(9,15);writeln(CFlag);\r
    play(500,500,40);Col(11,7);\r
   until CFlag in['S','R','Q'];Bor(0,0);Cur(3);\r
   case CFlag of\r
    'S':begin RL(170);delay(1500);window(1,1,80,25);clrscr;\r
-        close(R1);close(R2);close(S1);close(L1);close(C1);close(T1);close(T2);\r
-        assign(R1,'nova.com');execute(R1)\r
+        close(R1);close(R2);close(S1);close(L1);close(C1);\r
+        {$I-}\r
+        close(T1);if IOResult<>0 then begin end;\r
+        close(T2);if IOResult<>0 then begin end;\r
+        {$I+}\r
+        DoneScrKbd;\r
+        Halt(ExecuteProcess(ParamStr(0),''));\r
        end;\r
    'R':begin Min(126);Restore;if not en(126)then goto JUMP end;\r
    'Q':begin window(1,1,80,25);clrscr;Col(3,7);\r
-        close(R1);close(R2);close(S1);close(L1);close(C1);close(T1);close(T2);\r
+        close(R1);close(R2);close(S1);close(L1);close(C1);\r
+        {$I-}\r
+        close(T1);if IOResult<>0 then begin end;\r
+        close(T2);if IOResult<>0 then begin end;\r
+        {$I+}\r
         writeln('In ',Tic,' moves you scored ',Sc,\r
                 ' out of a possible 1000 points.');writeln;\r
         Col(31,16);Bak(1,7);writeln('Good-bye!');writeln;Cur(1);\r
index ee2e6143c5fbd4636915bad8bca4733a16aca9ed..333de3c882a220762b1cfc2927a61d94731ca5b5 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -26,7 +48,7 @@
 {//-------------------------------------------------------------------------}\r
 program Install;  { Used to add FILES=16 to a CONFIG.SYS file. }\r
 \r
-uses crt, dos, turbo3;\r
+uses crt, dos;\r
 \r
 {$V-}\r
 label JUMP;\r
@@ -43,7 +65,7 @@ procedure Pause(X:integer);
   textcolor(7);\r
   if X=1 then write('Press any key to continue . . .')\r
   else write('Press any key to end installation program . . .');\r
-  read(kbd,CH);textcolor(15);writeln;\r
+  CH:=readkey;textcolor(15);writeln;\r
  end;\r
 \r
 BEGIN JUMP:\r
index c9e6d0011adfad806e5273f2fad9184f3be23dc8..476d6351df82f3e58a9a44e0d66e84f33a0afd2f 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -25,6 +47,8 @@
 {*/                                                                         }\r
 {//-------------------------------------------------------------------------}\r
 {$c-}\r
+uses crt, dos;\r
+\r
 const\r
   Max = 78;\r
 \r
index f7e41ee146a42aa0a84730b77d2668f14a15ee0f..39735c9f86b44652f18756360dd23d6402248714 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
 (*                       Copyright 1985 Scott Miller                        *)\r
 (****************************************************************************)\r
 \r
-{$C-,R-,V-,K-}\r
+{$C-,R-,V-,S-}\r
+{$IFDEF UNIX}\r
+uses ncurses,ocrt,sysutils,SDL;\r
+{$ELSE}\r
+uses crt,sysutils,SDL;\r
+{$ENDIF}\r
 \r
 const\r
    VMax    = 95;     { Verbs   }\r
@@ -44,6 +71,11 @@ const
    MMax    = 29;     { Mov's   }\r
    Null    = 0;\r
    Legal   = 255;\r
+   audio_FREQ    = 22050;  { SDL Audio parameters }\r
+   audio_SAMPLES = 512;\r
+   audio_STEP    = 16;\r
+   audio_VOLUME  = 24;\r
+   audio_MAXENTRIES = 50000;\r
 \r
 type\r
    Str1    = string[1];\r
@@ -56,7 +88,11 @@ type
    Str130  = string[131];\r
    Str234  = string[234];\r
    Str255  = string[255];\r
-   Entr    = record AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags:integer;end;\r
+   {Entr    = record AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags:integer;end;}\r
+{$IFNDEF UNIX}\r
+   TWindow = record x,y,x1,y1:integer;end;\r
+   PWin    = ^TWindow;\r
+{$ENDIF}\r
    LSet    = set of 1..NMax;\r
    SaveSet = record\r
               aInv    : set of 1..MMax;\r
@@ -67,6 +103,22 @@ type
              end;\r
 \r
 var\r
+   buflen  : byte;\r
+   sound_i,\r
+   sound_play   : integer;\r
+   sound_Freqs  : array [0..audio_MAXENTRIES] of Integer;\r
+   sound_supported,\r
+   speaker_on   : boolean;\r
+   lasttime,  \r
+   sound_ticks  : UInt32;\r
+   lastfreq,\r
+   current_freq : Real;\r
+   win1,win2,\r
+   stdscr  : pwin;\r
+   UTF8Scr : boolean;\r
+{$IFNDEF UNIX}\r
+   win_arr : array [1..3] of TWindow;\r
+{$ENDIF}\r
    SetSave : SaveSet;\r
    Sets    : file of SaveSet;\r
    Objects : file of LSet;\r
@@ -126,6 +178,7 @@ var
    Old,      { for Block Reader }\r
    Old2,\r
    x,y,o   : byte;\r
+   xi,yi   : integer;\r
    Code,     { dials, etc }\r
    Tic,\r
    StoreR,   { Knows if the previous Room that was read is the same as the  }\r
@@ -148,14 +201,14 @@ var
    R1,R2,S1: file of Str234;\r
    L1      : file of Str78;\r
    C1      : file of Str77;\r
-   T1,T2   : text[2500];\r
+   T1,T2   : Text;\r
    Identity,\r
    VStr,\r
    NStr,\r
    PStr,\r
    LastNoun,\r
    Word    : Str29;\r
-   Result  : Entr;\r
+   {Result  : Entr;}\r
    Drive,\r
    Log,\r
    CFlag   : char;\r
@@ -166,7 +219,7 @@ var
    SFlag   : boolean;  { If TRUE then a Special action took place. }\r
 {----------}\r
 \r
-{$Ia:ADPAR.pas   <<<<<------  LOADS IN MANY PARSER COMMANDS  ***************}\r
+{$I ADPAR.pas   <<<<<------  LOADS IN MANY PARSER COMMANDS  ***************}\r
 \r
 procedure Describe(Room:byte);\r
  begin\r
@@ -218,7 +271,7 @@ procedure Describe(Room:byte);
     end;\r
  end; { Describe }\r
 \r
-procedure Move{New:byte};\r
+procedure Move(New:byte);\r
  begin SF;\r
   if en(7) then RL(22) else\r
   if en(8) then RL(23) else\r
@@ -235,11 +288,11 @@ procedure Move{New:byte};
  end; { Move }\r
 \r
 \r
-{$Ia:VOCAB.pas    <<<<<-------  Loads in VOCABULARY LIST  **********}\r
+{$I VOCAB.pas    <<<<<-------  Loads in VOCABULARY LIST  **********}\r
 \r
 \r
 {****************************** ROOM ROUTINES *******************************}\r
-overlay procedure Room1;   { The Player's Ship }\r
+procedure Room1;   { The Player's Ship }\r
 begin\r
 case Prm of\r
  1:case Vb of  { Bridge }\r
@@ -309,7 +362,7 @@ case Prm of
  end; {main case}\r
 end; { Room1 }\r
 {----------}\r
-overlay procedure Room2;   { The Player's Ship }\r
+procedure Room2;   { The Player's Ship }\r
 begin\r
 case Prm of\r
  2:case Vb of  { Forward Corridor }\r
@@ -329,10 +382,10 @@ case Prm of
         if en(22) then\r
          begin RL(96);Add(23);\r
           if(not en(44))and(Region=2)then\r
-           begin Add(44);RL(327);for i:=1 to 400 do sound(random(3500)+999);\r
-            for i:=7500 downto 500 do begin sound(random(i)+i);\r
-             sound(random(3500)+2000)end;\r
-            for i:=1 to 300 do sound(random(3500)+2500);nosound;\r
+           begin Add(44);RL(327);for i:=1 to 400 do sounddelayed(random(3500)+999);\r
+            for i:=7500 downto 500 do begin sounddelayed(random(i)+i);\r
+             sounddelayed(random(3500)+2000)end;\r
+            for i:=1 to 300 do sounddelayed(random(3500)+2500);nosound;\r
            end\r
          end\r
         else RL(97)\r
@@ -351,7 +404,7 @@ case Prm of
  end; {main case}\r
 end; { Room2 }\r
 {----------}\r
-overlay procedure Room3;   { The Player's Ship }\r
+procedure Room3;   { The Player's Ship }\r
 begin\r
 case Prm of\r
 \r
@@ -418,7 +471,7 @@ case Prm of
  end; {main case}\r
 end; { Room3 }\r
 {----------}\r
-overlay procedure Room4;   { The Tavern }\r
+procedure Room4;   { The Tavern }\r
 begin\r
 case Prm of\r
  8:case Vb of  { Tavern }\r
@@ -497,7 +550,7 @@ case Prm of
  end; {main case}\r
 end; { Room4 }\r
 {----------}\r
-overlay procedure Room5;   { Barre-An Planet }\r
+procedure Room5;   { Barre-An Planet }\r
  procedure Zap; begin for x:=1 to 29 do if R[x]=Prm then Van(x) end;\r
 begin\r
 case Prm of\r
@@ -582,7 +635,7 @@ case Prm of
  end {main case}\r
 end; { Room5 }\r
 {----------}\r
-overlay procedure Room6;   { Jungle Planet }\r
+procedure Room6;   { Jungle Planet }\r
 begin\r
 case Prm of\r
 23:case Vb of  { Deep Pit }\r
@@ -608,7 +661,7 @@ case Prm of
 25:case Vb of { Sandy Clearing }\r
    4,9,51:if N1 in[Null,62,71] then begin RL(234);move(24)end;\r
    1:begin move(26);Score(5,75)end;\r
-   1..8:RL(200);\r
+   2,3,5..8:RL(200);\r
    end; {Vb}\r
 \r
 26:case Vb of { Winding Path 1 }\r
@@ -617,7 +670,7 @@ case Prm of
    59:if N1=66 then\r
        if VStr='jump in' then begin RL(288);DEAD;end\r
        else begin RS(66);move(27);Score(25,76)end;\r
-   1..8:RL(200);\r
+   1,3,4,6..8:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    28:if N1=66 then RS(85);\r
    35,62:if N1=66 then begin RL(288);DEAD;end;\r
@@ -629,7 +682,7 @@ case Prm of
 27:case Vb of { Winding Path 2 }\r
    6:move(28);\r
    8,11:begin RS(65);DEAD;end;\r
-   1..8:RL(200);\r
+   1..5,7:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    59:if N1=66 then\r
        if VStr='jump in' then begin RL(288);DEAD;end\r
@@ -645,7 +698,7 @@ case Prm of
    7:move(27);\r
    6:move(29);\r
    8:begin RS(67);DEAD;end;\r
-   1..8:RL(200);\r
+   1..5:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    28:if N1=112 then RS(86);\r
    24:if N1=112 then RL(553);\r
@@ -658,7 +711,7 @@ case Prm of
    9,51:if N1 in[Null,112] then begin RL(201);move(30)end;\r
    6:begin RS(69);Prm:=31;T[11]:=4;end;\r
    8:if en(35)or en(130)then begin RC:=1;move(59);Score(20,77)end;\r
-   1..8:RL(200);\r
+   1..4:RL(200);\r
    28:case N1 of 112:RL(238);120:RL(544);\r
        113:if Md=1 then begin RL(314);Add(130)end end;\r
    59:if N1=120 then begin RL(541);Prm:=31;T[11]:=4;end;\r
@@ -667,7 +720,7 @@ case Prm of
  end {main case}\r
 end; { Room6 }\r
 {----------}\r
-overlay procedure Room7;   { Jungle Planet }\r
+procedure Room7;   { Jungle Planet }\r
 begin\r
 case Prm of\r
 30:case Vb of { Top of Tree }\r
@@ -689,14 +742,14 @@ case Prm of
 32:case Vb of { Winding Path 5 }\r
    1:move(33);\r
    8:begin move(29);if en(35) and not en(40) then begin RL(314);Add(40)end end;\r
-   1..8:RL(200);\r
+   2..7:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    end;\r
 \r
 33:case Vb of { Winding Path 6 }\r
    2:move(32);\r
    6:if not en(28)then begin RS(68);Add(28);move(34)end else move(34);\r
-   1..8:RL(200);\r
+   1,3,4,5,7,8:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    end;\r
 \r
@@ -715,7 +768,7 @@ case Prm of
    39:if(PyraCon in NounSet)or((30 in Nounset)and(PyraCon=9))then\r
        begin RL(225);Min(30);SFlag:=false;end else\r
       if HingeCon in NounSet then begin RL(228);SFlag:=false;end;\r
-   1..8:RL(200);\r
+   2..6,8:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    92:if N1 in[Null,49,122] then begin RL(216);move(23) end;\r
    31:if N1 in[81,89,119] then begin RB(8,7);Pause;end;\r
@@ -733,7 +786,7 @@ case Prm of
  end {main case}\r
 end; { Room7 }\r
 {----------}\r
-overlay procedure Room8;   { Inside Pyramid (Top Level) }\r
+procedure Room8;   { Inside Pyramid (Top Level) }\r
 begin\r
 case Prm of\r
 35:case Vb of  { Vestibule }\r
@@ -774,7 +827,7 @@ case Prm of
  end {main case}\r
 end; { Room8 }\r
 {----------}\r
-overlay procedure Room9;   { Inside Pyramid (Top Level) }\r
+procedure Room9;   { Inside Pyramid (Top Level) }\r
 begin\r
 case Prm of\r
 39:case Vb of  { Holey Hall }\r
@@ -787,9 +840,9 @@ case Prm of
          begin n[68]:='podium\alter\column\';WRITE('');move(41)end;\r
    3,13:if(18 in Inv)or(4 in Inv)then begin Brief:=Brief-[39];move(39);\r
           T[15]:=3;T[16]:=9;col(10,7);RS(93);\r
-          for i:=500 to 5500 do sound(random(i)+random(i));\r
-          for j:=1 to 7000 do sound(random(i)+random(i));\r
-          for j:=i downto 500 do sound(random(j)+random(j));nosound;\r
+          for i:=500 to 5500 do sounddelayed(random(i)+random(i));\r
+          for j:=1 to 7000 do sounddelayed(random(i)+random(i));\r
+          for j:=i downto 500 do sounddelayed(random(j)+random(j));nosound;\r
          end\r
         else move(39);\r
    42,44,51,75,84,94:\r
@@ -824,7 +877,7 @@ case Prm of
  end {main case}\r
 end; { Room9 }\r
 {----------}\r
-overlay procedure Room10;   { Pyramid Maze }\r
+procedure Room10;   { Pyramid Maze }\r
 begin\r
 case Prm of\r
 42:case Vb of  { Ladder Room }\r
@@ -896,7 +949,7 @@ case Prm of
  end {main case}\r
 end; { Room10 }\r
 {----------}\r
-overlay procedure Room11;   { Inside Pyramid (Bottom Level) }\r
+procedure Room11;   { Inside Pyramid (Bottom Level) }\r
 begin\r
 case Prm of\r
 51:case Vb of  { Lower Stairway }\r
@@ -950,7 +1003,7 @@ case Prm of
  end {main case}\r
 end; { Room11 }\r
 {----------}\r
-overlay procedure Room12;   { Inside Pyramid (Bottom Level) }\r
+procedure Room12;   { Inside Pyramid (Bottom Level) }\r
 begin\r
 case Prm of\r
 56:case Vb of  { The Erusaert }\r
@@ -1019,7 +1072,7 @@ case Prm of
  end {main case}\r
 end; { Room12 }\r
 {----------}\r
-overlay procedure Room13;   { Inside Pyramid (Bottom Level) }\r
+procedure Room13;   { Inside Pyramid (Bottom Level) }\r
 begin\r
 case Prm of\r
 57:case Vb of  { Solar Chamber }\r
@@ -1036,7 +1089,7 @@ case Prm of
 59:case Vb of  { Overgrown Path }\r
    5:begin RC:=RC-1;if RC<1 then begin RL(309);move(29)end else RL(310)end;\r
    8:begin RC:=RC+1;if RC>7 then begin RL(309);move(60)end else RL(310)end;\r
-   1..8:RL(200);\r
+   1..4,6,7:RL(200);\r
    9,51:if N1=112 then RL(204);\r
    end;\r
 \r
@@ -1044,7 +1097,7 @@ case Prm of
    4,11:begin Door(61,25);\r
          if not en(43)then begin RS(137);Score(10,43)end end;\r
    5:move(59);\r
-   1..8:RL(200);\r
+   1..3,6,7,8:RL(200);\r
    28:case N1 of 96:RL(323);115:RL(324)end;\r
    41..44,54,75,88:if N1=56 then RL(315);\r
    9,51:if N1=112 then RL(204)else RL(316);\r
@@ -1064,7 +1117,7 @@ case Prm of
      case N1 of\r
       37,38:RL(318);\r
       44:begin RS(138);\r
-          for y:=60 downto 1 do for x:=800 downto 1 do sound(x*y);\r
+          for yi:=60 downto 1 do for xi:=800 downto 1 do sounddelayed(xi*yi);\r
           nosound;TFlag:=3;Brief:=Brief-[70];Score(10,89);\r
           for x:=1 to MMax do if R[x]=62 then R[x]:=70;move(70)\r
          end\r
@@ -1078,7 +1131,7 @@ case Prm of
    42,44,75:case N1 of\r
             37,38:RL(318);\r
             44:begin RS(138);\r
-                for y:=60 downto 1 do for x:=800 downto 1 do sound(x*y);\r
+                for yi:=60 downto 1 do for xi:=800 downto 1 do sounddelayed(xi*yi);\r
                 nosound;TFlag:=3;Brief:=Brief-[70];\r
                 for x:=1 to MMax do if R[x]=63 then R[x]:=70;move(70)\r
                end\r
@@ -1091,7 +1144,7 @@ case Prm of
  end {main case}\r
 end; { Room13 }\r
 {----------}\r
-overlay procedure Room14;   { Inner Planet }\r
+procedure Room14;   { Inner Planet }\r
 begin\r
 case Prm of\r
 64:case Vb of  { Lobby }\r
@@ -1176,7 +1229,7 @@ case Prm of
  end {main case}\r
 end; { Room14 }\r
 {----------}\r
-overlay procedure Room15;   { Inner Planet }\r
+procedure Room15;   { Inner Planet }\r
 begin\r
 case Prm of\r
 68:case Vb of  { Decontamination }\r
@@ -1199,7 +1252,7 @@ case Prm of
    42,44,75:\r
      if N1 in[40..43]then\r
       begin Brief:=Brief-[62,63,78];RS(138);Min(45);\r
-       for y:=60 downto 1 do for x:=800 downto 1 do sound(x*y);nosound;\r
+       for yi:=60 downto 1 do for xi:=800 downto 1 do sounddelayed(xi*yi);nosound;\r
         case N1 of\r
          40:begin for x:=1 to MMax do if R[x]=70 then R[x]:=78;\r
              TFlag:=4;move(78);Score(15,97)end;\r
@@ -1216,7 +1269,7 @@ case Prm of
  end {main case}\r
 end; { Room15 }\r
 {----------}\r
-overlay procedure Room16;   { Inner Planet }\r
+procedure Room16;   { Inner Planet }\r
 begin\r
 case Prm of\r
 73:case Vb of  { Communications }\r
@@ -1264,7 +1317,7 @@ case Prm of
  end {main case}\r
 end; { Room16 }\r
 {----------}\r
-overlay procedure Room17;   { Planetship }\r
+procedure Room17;   { Planetship }\r
 begin\r
 case Prm of\r
 78:case Vb of  { Icy Platform }\r
@@ -1305,7 +1358,7 @@ case Prm of
  end {main case}\r
 end; { Room17 }\r
 {----------}\r
-overlay procedure Room18;   { Planetship }\r
+procedure Room18;   { Planetship }\r
 begin\r
 case Prm of\r
 81:case Vb of  { Circular Corridor }\r
@@ -1373,7 +1426,7 @@ case Prm of
  end {main case}\r
 end; { Room18 }\r
 {----------}\r
-overlay procedure Room19;   { Planetship }\r
+procedure Room19;   { Planetship }\r
 begin\r
 case Prm of\r
 84:case Vb of  { Circular Corridor }\r
@@ -1437,13 +1490,13 @@ case Prm of
              begin i:=random(7000)+999;play(i,i,50);delay(random(15)+5)end\r
            end else\r
           if N1 in[38,128]then RL(403);\r
-     42,75:if N1 in[38,128]then RL(403);\r
+     42:if N1 in[38,128]then RL(403);\r
    end;\r
 \r
  end {main case}\r
 end; { Room19 }\r
 {----------}\r
-overlay procedure Room20;   { Planetship }\r
+procedure Room20;   { Planetship }\r
 begin\r
 case Prm of\r
 90:case Vb of  { Reactors East }\r
@@ -1499,7 +1552,7 @@ case Prm of
  end {main case}\r
 end; { Room20 }\r
 {----------}\r
-overlay procedure Room21;   { Planetship }\r
+procedure Room21;   { Planetship }\r
 begin\r
 case Prm of\r
 94:case Vb of  { Maintenance }\r
@@ -1561,7 +1614,7 @@ case Prm of
  end {main case}\r
 end; { Room21 }\r
 {----------}\r
-overlay procedure Room22;   { Planetship (Lower Level) }\r
+procedure Room22;   { Planetship (Lower Level) }\r
 begin\r
 case Prm of\r
 101:case Vb of  { Security Tunnel #3 }\r
@@ -1624,7 +1677,7 @@ case Prm of
  end {main case}\r
 end; { Room22 }\r
 {----------}\r
-overlay procedure Room23;   { Planetship (Lower Level) }\r
+procedure Room23;   { Planetship (Lower Level) }\r
  label JUMP;\r
 begin\r
 case Prm of\r
@@ -1690,12 +1743,13 @@ end; { Room23 }
 {**************************** END OF ROOM ROUTINES **************************}\r
 \r
 \r
-{$Ia:DEFAULT.pas   <<<<<------  LOADS IN DEFAULT ROUTINES  *******************}\r
+{$I DEFAULT.pas   <<<<<------  LOADS IN DEFAULT ROUTINES  *******************}\r
 \r
 \r
 BEGIN { Main Program }\r
 Assign1;Assign2;Assign3;Assign4;Assign5;\r
 Names1;Names2;Names3;\r
+InitScrKbd;\r
 Title;\r
 Init1;Init2;Init3;\r
 Place1;Place2;\r
index fed6d97cad26c613430bd3ce57147200db63b4c6..97031c289f0dfa22a2c86a28a67bd982f470f90b 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -25,6 +47,8 @@
 {*/                                                                         }\r
 {//-------------------------------------------------------------------------}\r
 {$c-}\r
+uses crt, dos;\r
+\r
 const\r
   Max = 234;\r
 \r
@@ -64,8 +88,8 @@ text1   : MaxLength;
         READ(S1,text1);\r
         if list then\r
           begin\r
-            writeln(lst,'Discription # ',counter);\r
-            writeln(lst,text1);\r
+            writeln('Discription # ',counter);\r
+            writeln(text1);\r
           end\r
         else\r
           begin\r
@@ -93,7 +117,7 @@ repeat          {Main loop.}
 \r
 writeln;\r
 writeln('Do you want to R)ead, W)rite or Q)uit?');\r
-read(kbd,answer);\r
+answer:=readkey;\r
 if upcase(answer) = 'Q' then begin writeln('FINISHED');halt;end;\r
 if upcase(answer) <> 'R' then       {Write to 'SPECIAL'.}\r
     begin\r
@@ -107,7 +131,7 @@ if upcase(answer) <> 'R' then       {Write to 'SPECIAL'.}
       x:=wherey;if(x>17)then x:=18;for stop:=1 to 7 do writeln;gotoxy(1,x);\r
       textcolor(11);\r
         repeat\r
-          read(trm,letter);\r
+          letter:=readkey;\r
           if letter = ^h then\r
             begin\r
               if(wherex=1)then\r
@@ -136,7 +160,7 @@ else                      {Read from 'SPECIAL'.}
   begin\r
     writeln;writeln;\r
     writeln('To the S)creen or the P)rinter');\r
-    read(kbd,answer);\r
+    answer:=readkey;\r
     if(upcase(answer)='P')then List:=True else List:=False;\r
     assign(S1,'S1');\r
     reset(S1);\r
index 9cdf015fa3a5a62cc0044ffcc699ac0d98b362d9..5d14941278ff4b1465acfa826f285dd8f426a70e 100644 (file)
@@ -1,5 +1,27 @@
 {//-------------------------------------------------------------------------}\r
 {/*                                                                         }\r
+{Copyright (C) 2014 Jason Self <j@jxself.org>                               }\r
+{                                                                           }\r
+{This file is free software: you may copy, redistribute and/or modify it    }\r
+{under the terms of the GNU Affero General Public License as published by   }\r
+{the Free Software Foundation, either version 3 of the License, or (at your }\r
+{option) any later version.                                                 }\r
+{                                                                           }\r
+{This file is distributed in the hope that it will be useful, but WITHOUT   }\r
+{ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      }\r
+{FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License}\r
+{for more details.                                                          }\r
+{                                                                           }\r
+{You should have received a copy of the GNU Affero General Public License   }\r
+{along with this program; if not, see https://gnu.org/licenses or write to: }\r
+{  Free Software Foundation, Inc.                                           }\r
+{  51 Franklin Street, Fifth Floor                                          }\r
+{  Boston, MA 02110-1301                                                    }\r
+{  USA                                                                      }\r
+{                                                                           }\r
+{This file incorporates work covered by the following copyright and         }\r
+{permission notice:                                                         }\r
+{                                                                           }\r
 {Copyright (C) 1990, 2009 - Apogee Software, Ltd.                           }\r
 {                                                                           }\r
 {This file is part of Supernova.  Supernova is free software; you can       }\r
@@ -33,7 +55,7 @@
 (*****************************************************************************)\r
 \r
                        {VERB LIST:  GROUPS ALL SYNONYMS}\r
-overlay procedure Assign1;\r
+procedure Assign1;\r
 begin\r
 v[1]:='north\n\fore\f\';\r
 v[2]:='south\s\aft\a\';\r
@@ -81,7 +103,7 @@ v[43]:='flip\turn off\deactiv\';
 v[44]:='push\move\press\turn on\';        {cont}\r
 v[45]:='activat\flip on\push on\';\r
 end; { Assign1 }\r
-overlay procedure Assign2;\r
+procedure Assign2;\r
 begin\r
 v[46]:='drink some\drink from\drink\';\r
 v[47]:='eat\swallow\digest\consume\';\r
@@ -136,7 +158,7 @@ v[95]:='command\verbs\verb\words\';
 end; { Assign2 }\r
 \r
                      {NOUN LIST:  GROUPS ALL OBJECTS}\r
-overlay procedure Assign3;\r
+procedure Assign3;\r
 begin\r
 n[1]:='clear crystal\clear\crystal\';\r
 n[2]:='device\';\r
@@ -186,7 +208,7 @@ n[45]:='buttons\';
 n[46]:='robot\defense robot\defense\';    {cont at #133}\r
 n[47]:='vines\vine\branche\branch\';\r
 end; { Assign3 }\r
-overlay procedure Assign4;\r
+procedure Assign4;\r
 begin\r
 n[48]:='dial\knob\dials\knobs\tap\';\r
 n[49]:='ground\floor\earth\deck\bay\';    {cont}\r
@@ -235,7 +257,7 @@ n[91]:='serum dispens\';
 n[92]:='serum\medicin\cure\liquid\';\r
 n[93]:='platform\platfor\';\r
 end; { Assign4 }\r
-overlay procedure Assign5;\r
+procedure Assign5;\r
 begin\r
 n[94]:='booth\transpo\';\r
 n[95]:='wristband\wristba\transla\';\r
@@ -303,7 +325,7 @@ end; { Assign5 }
 \r
                                {ROOM  NAMES}\r
 \r
-overlay procedure Names1;\r
+procedure Names1;\r
 begin\r
 rn[1]:='Bridge';\r
 rn[2]:='Forward Corridor';\r
@@ -346,7 +368,7 @@ rn[38]:='Departure Room';
 rn[39]:='Holey Hall';\r
 rn[40]:='Pyramid Lobby';\r
   end; { Names1 }\r
-overlay procedure Names2;\r
+procedure Names2;\r
 begin\r
 rn[41]:='Treasure''s Keeper';\r
 rn[42]:='Ladder Room';\r
@@ -389,7 +411,7 @@ rn[78]:='Icy Platform';
 rn[79]:='Confirmation Port';\r
 rn[80]:='Inspection Lobby';\r
   end; { Names2 }\r
-overlay procedure Names3;\r
+procedure Names3;\r
 begin\r
 rn[81]:='Circular Corridor';\r
 rn[82]:=rn[81];\r
@@ -424,7 +446,7 @@ rn[109]:='Medical Quarters #6';
 \r
 \r
                                {ROOM  NAMES}\r
-overlay procedure Place1;\r
+procedure Place1;\r
  begin\r
 for x:=1 to RMax do L[x]:=[];\r
 L[1]:=[16,35..41,43,44,52,55,56,59,62,112,120,125];\r
@@ -477,7 +499,7 @@ L[53]:=[];
 L[54]:=[];\r
 L[55]:=[11];\r
  end; { Place1 }\r
-overlay procedure Place2;\r
+procedure Place2;\r
  begin\r
 L[56]:=[66,68,110];\r
 L[57]:=[56,72,82,103,109];\r