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