--- /dev/null
+ GNU GENERAL PUBLIC LICENSE\r
+ Version 3, 29 June 2007\r
+\r
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+ Preamble\r
+\r
+ The GNU General Public License is a free, copyleft license for\r
+software and other kinds of works.\r
+\r
+ The licenses for most software and other practical works are designed\r
+to take away your freedom to share and change the works. By contrast,\r
+the GNU General Public License is intended to guarantee your freedom to\r
+share and change all versions of a program--to make sure it remains free\r
+software for all its users. We, the Free Software Foundation, use the\r
+GNU General Public License for most of our software; it applies also to\r
+any other work released this way by its authors. You can apply it to\r
+your programs, too.\r
+\r
+ When we speak of free software, we are referring to freedom, not\r
+price. Our General Public Licenses are designed to make sure that you\r
+have the freedom to distribute copies of free software (and charge for\r
+them if you wish), that you receive source code or can get it if you\r
+want it, that you can change the software or use pieces of it in new\r
+free programs, and that you know you can do these things.\r
+\r
+ To protect your rights, we need to prevent others from denying you\r
+these rights or asking you to surrender the rights. Therefore, you have\r
+certain responsibilities if you distribute copies of the software, or if\r
+you modify it: responsibilities to respect the freedom of others.\r
+\r
+ For example, if you distribute copies of such a program, whether\r
+gratis or for a fee, you must pass on to the recipients the same\r
+freedoms that you received. You must make sure that they, too, receive\r
+or can get the source code. And you must show them these terms so they\r
+know their rights.\r
+\r
+ Developers that use the GNU GPL protect your rights with two steps:\r
+(1) assert copyright on the software, and (2) offer you this License\r
+giving you legal permission to copy, distribute and/or modify it.\r
+\r
+ For the developers' and authors' protection, the GPL clearly explains\r
+that there is no warranty for this free software. For both users' and\r
+authors' sake, the GPL requires that modified versions be marked as\r
+changed, so that their problems will not be attributed erroneously to\r
+authors of previous versions.\r
+\r
+ Some devices are designed to deny users access to install or run\r
+modified versions of the software inside them, although the manufacturer\r
+can do so. This is fundamentally incompatible with the aim of\r
+protecting users' freedom to change the software. The systematic\r
+pattern of such abuse occurs in the area of products for individuals to\r
+use, which is precisely where it is most unacceptable. Therefore, we\r
+have designed this version of the GPL to prohibit the practice for those\r
+products. If such problems arise substantially in other domains, we\r
+stand ready to extend this provision to those domains in future versions\r
+of the GPL, as needed to protect the freedom of users.\r
+\r
+ Finally, every program is threatened constantly by software patents.\r
+States should not allow patents to restrict development and use of\r
+software on general-purpose computers, but in those that do, we wish to\r
+avoid the special danger that patents applied to a free program could\r
+make it effectively proprietary. To prevent this, the GPL assures that\r
+patents cannot be used to render the program non-free.\r
+\r
+ The precise terms and conditions for copying, distribution and\r
+modification follow.\r
+\r
+ TERMS AND CONDITIONS\r
+\r
+ 0. Definitions.\r
+\r
+ "This License" refers to version 3 of the GNU General Public License.\r
+\r
+ "Copyright" also means copyright-like laws that apply to other kinds of\r
+works, such as semiconductor masks.\r
+\r
+ "The Program" refers to any copyrightable work licensed under this\r
+License. Each licensee is addressed as "you". "Licensees" and\r
+"recipients" may be individuals or organizations.\r
+\r
+ To "modify" a work means to copy from or adapt all or part of the work\r
+in a fashion requiring copyright permission, other than the making of an\r
+exact copy. The resulting work is called a "modified version" of the\r
+earlier work or a work "based on" the earlier work.\r
+\r
+ A "covered work" means either the unmodified Program or a work based\r
+on the Program.\r
+\r
+ To "propagate" a work means to do anything with it that, without\r
+permission, would make you directly or secondarily liable for\r
+infringement under applicable copyright law, except executing it on a\r
+computer or modifying a private copy. Propagation includes copying,\r
+distribution (with or without modification), making available to the\r
+public, and in some countries other activities as well.\r
+\r
+ To "convey" a work means any kind of propagation that enables other\r
+parties to make or receive copies. Mere interaction with a user through\r
+a computer network, with no transfer of a copy, is not conveying.\r
+\r
+ An interactive user interface displays "Appropriate Legal Notices"\r
+to the extent that it includes a convenient and prominently visible\r
+feature that (1) displays an appropriate copyright notice, and (2)\r
+tells the user that there is no warranty for the work (except to the\r
+extent that warranties are provided), that licensees may convey the\r
+work under this License, and how to view a copy of this License. If\r
+the interface presents a list of user commands or options, such as a\r
+menu, a prominent item in the list meets this criterion.\r
+\r
+ 1. Source Code.\r
+\r
+ The "source code" for a work means the preferred form of the work\r
+for making modifications to it. "Object code" means any non-source\r
+form of a work.\r
+\r
+ A "Standard Interface" means an interface that either is an official\r
+standard defined by a recognized standards body, or, in the case of\r
+interfaces specified for a particular programming language, one that\r
+is widely used among developers working in that language.\r
+\r
+ The "System Libraries" of an executable work include anything, other\r
+than the work as a whole, that (a) is included in the normal form of\r
+packaging a Major Component, but which is not part of that Major\r
+Component, and (b) serves only to enable use of the work with that\r
+Major Component, or to implement a Standard Interface for which an\r
+implementation is available to the public in source code form. A\r
+"Major Component", in this context, means a major essential component\r
+(kernel, window system, and so on) of the specific operating system\r
+(if any) on which the executable work runs, or a compiler used to\r
+produce the work, or an object code interpreter used to run it.\r
+\r
+ The "Corresponding Source" for a work in object code form means all\r
+the source code needed to generate, install, and (for an executable\r
+work) run the object code and to modify the work, including scripts to\r
+control those activities. However, it does not include the work's\r
+System Libraries, or general-purpose tools or generally available free\r
+programs which are used unmodified in performing those activities but\r
+which are not part of the work. For example, Corresponding Source\r
+includes interface definition files associated with source files for\r
+the work, and the source code for shared libraries and dynamically\r
+linked subprograms that the work is specifically designed to require,\r
+such as by intimate data communication or control flow between those\r
+subprograms and other parts of the work.\r
+\r
+ The Corresponding Source need not include anything that users\r
+can regenerate automatically from other parts of the Corresponding\r
+Source.\r
+\r
+ The Corresponding Source for a work in source code form is that\r
+same work.\r
+\r
+ 2. Basic Permissions.\r
+\r
+ All rights granted under this License are granted for the term of\r
+copyright on the Program, and are irrevocable provided the stated\r
+conditions are met. This License explicitly affirms your unlimited\r
+permission to run the unmodified Program. The output from running a\r
+covered work is covered by this License only if the output, given its\r
+content, constitutes a covered work. This License acknowledges your\r
+rights of fair use or other equivalent, as provided by copyright law.\r
+\r
+ You may make, run and propagate covered works that you do not\r
+convey, without conditions so long as your license otherwise remains\r
+in force. You may convey covered works to others for the sole purpose\r
+of having them make modifications exclusively for you, or provide you\r
+with facilities for running those works, provided that you comply with\r
+the terms of this License in conveying all material for which you do\r
+not control copyright. Those thus making or running the covered works\r
+for you must do so exclusively on your behalf, under your direction\r
+and control, on terms that prohibit them from making any copies of\r
+your copyrighted material outside their relationship with you.\r
+\r
+ Conveying under any other circumstances is permitted solely under\r
+the conditions stated below. Sublicensing is not allowed; section 10\r
+makes it unnecessary.\r
+\r
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r
+\r
+ No covered work shall be deemed part of an effective technological\r
+measure under any applicable law fulfilling obligations under article\r
+11 of the WIPO copyright treaty adopted on 20 December 1996, or\r
+similar laws prohibiting or restricting circumvention of such\r
+measures.\r
+\r
+ When you convey a covered work, you waive any legal power to forbid\r
+circumvention of technological measures to the extent such circumvention\r
+is effected by exercising rights under this License with respect to\r
+the covered work, and you disclaim any intention to limit operation or\r
+modification of the work as a means of enforcing, against the work's\r
+users, your or third parties' legal rights to forbid circumvention of\r
+technological measures.\r
+\r
+ 4. Conveying Verbatim Copies.\r
+\r
+ You may convey verbatim copies of the Program's source code as you\r
+receive it, in any medium, provided that you conspicuously and\r
+appropriately publish on each copy an appropriate copyright notice;\r
+keep intact all notices stating that this License and any\r
+non-permissive terms added in accord with section 7 apply to the code;\r
+keep intact all notices of the absence of any warranty; and give all\r
+recipients a copy of this License along with the Program.\r
+\r
+ You may charge any price or no price for each copy that you convey,\r
+and you may offer support or warranty protection for a fee.\r
+\r
+ 5. Conveying Modified Source Versions.\r
+\r
+ You may convey a work based on the Program, or the modifications to\r
+produce it from the Program, in the form of source code under the\r
+terms of section 4, provided that you also meet all of these conditions:\r
+\r
+ a) The work must carry prominent notices stating that you modified\r
+ it, and giving a relevant date.\r
+\r
+ b) The work must carry prominent notices stating that it is\r
+ released under this License and any conditions added under section\r
+ 7. This requirement modifies the requirement in section 4 to\r
+ "keep intact all notices".\r
+\r
+ c) You must license the entire work, as a whole, under this\r
+ License to anyone who comes into possession of a copy. This\r
+ License will therefore apply, along with any applicable section 7\r
+ additional terms, to the whole of the work, and all its parts,\r
+ regardless of how they are packaged. This License gives no\r
+ permission to license the work in any other way, but it does not\r
+ invalidate such permission if you have separately received it.\r
+\r
+ d) If the work has interactive user interfaces, each must display\r
+ Appropriate Legal Notices; however, if the Program has interactive\r
+ interfaces that do not display Appropriate Legal Notices, your\r
+ work need not make them do so.\r
+\r
+ A compilation of a covered work with other separate and independent\r
+works, which are not by their nature extensions of the covered work,\r
+and which are not combined with it such as to form a larger program,\r
+in or on a volume of a storage or distribution medium, is called an\r
+"aggregate" if the compilation and its resulting copyright are not\r
+used to limit the access or legal rights of the compilation's users\r
+beyond what the individual works permit. Inclusion of a covered work\r
+in an aggregate does not cause this License to apply to the other\r
+parts of the aggregate.\r
+\r
+ 6. Conveying Non-Source Forms.\r
+\r
+ You may convey a covered work in object code form under the terms\r
+of sections 4 and 5, provided that you also convey the\r
+machine-readable Corresponding Source under the terms of this License,\r
+in one of these ways:\r
+\r
+ a) Convey the object code in, or embodied in, a physical product\r
+ (including a physical distribution medium), accompanied by the\r
+ Corresponding Source fixed on a durable physical medium\r
+ customarily used for software interchange.\r
+\r
+ b) Convey the object code in, or embodied in, a physical product\r
+ (including a physical distribution medium), accompanied by a\r
+ written offer, valid for at least three years and valid for as\r
+ long as you offer spare parts or customer support for that product\r
+ model, to give anyone who possesses the object code either (1) a\r
+ copy of the Corresponding Source for all the software in the\r
+ product that is covered by this License, on a durable physical\r
+ medium customarily used for software interchange, for a price no\r
+ more than your reasonable cost of physically performing this\r
+ conveying of source, or (2) access to copy the\r
+ Corresponding Source from a network server at no charge.\r
+\r
+ c) Convey individual copies of the object code with a copy of the\r
+ written offer to provide the Corresponding Source. This\r
+ alternative is allowed only occasionally and noncommercially, and\r
+ only if you received the object code with such an offer, in accord\r
+ with subsection 6b.\r
+\r
+ d) Convey the object code by offering access from a designated\r
+ place (gratis or for a charge), and offer equivalent access to the\r
+ Corresponding Source in the same way through the same place at no\r
+ further charge. You need not require recipients to copy the\r
+ Corresponding Source along with the object code. If the place to\r
+ copy the object code is a network server, the Corresponding Source\r
+ may be on a different server (operated by you or a third party)\r
+ that supports equivalent copying facilities, provided you maintain\r
+ clear directions next to the object code saying where to find the\r
+ Corresponding Source. Regardless of what server hosts the\r
+ Corresponding Source, you remain obligated to ensure that it is\r
+ available for as long as needed to satisfy these requirements.\r
+\r
+ e) Convey the object code using peer-to-peer transmission, provided\r
+ you inform other peers where the object code and Corresponding\r
+ Source of the work are being offered to the general public at no\r
+ charge under subsection 6d.\r
+\r
+ A separable portion of the object code, whose source code is excluded\r
+from the Corresponding Source as a System Library, need not be\r
+included in conveying the object code work.\r
+\r
+ A "User Product" is either (1) a "consumer product", which means any\r
+tangible personal property which is normally used for personal, family,\r
+or household purposes, or (2) anything designed or sold for incorporation\r
+into a dwelling. In determining whether a product is a consumer product,\r
+doubtful cases shall be resolved in favor of coverage. For a particular\r
+product received by a particular user, "normally used" refers to a\r
+typical or common use of that class of product, regardless of the status\r
+of the particular user or of the way in which the particular user\r
+actually uses, or expects or is expected to use, the product. A product\r
+is a consumer product regardless of whether the product has substantial\r
+commercial, industrial or non-consumer uses, unless such uses represent\r
+the only significant mode of use of the product.\r
+\r
+ "Installation Information" for a User Product means any methods,\r
+procedures, authorization keys, or other information required to install\r
+and execute modified versions of a covered work in that User Product from\r
+a modified version of its Corresponding Source. The information must\r
+suffice to ensure that the continued functioning of the modified object\r
+code is in no case prevented or interfered with solely because\r
+modification has been made.\r
+\r
+ If you convey an object code work under this section in, or with, or\r
+specifically for use in, a User Product, and the conveying occurs as\r
+part of a transaction in which the right of possession and use of the\r
+User Product is transferred to the recipient in perpetuity or for a\r
+fixed term (regardless of how the transaction is characterized), the\r
+Corresponding Source conveyed under this section must be accompanied\r
+by the Installation Information. But this requirement does not apply\r
+if neither you nor any third party retains the ability to install\r
+modified object code on the User Product (for example, the work has\r
+been installed in ROM).\r
+\r
+ The requirement to provide Installation Information does not include a\r
+requirement to continue to provide support service, warranty, or updates\r
+for a work that has been modified or installed by the recipient, or for\r
+the User Product in which it has been modified or installed. Access to a\r
+network may be denied when the modification itself materially and\r
+adversely affects the operation of the network or violates the rules and\r
+protocols for communication across the network.\r
+\r
+ Corresponding Source conveyed, and Installation Information provided,\r
+in accord with this section must be in a format that is publicly\r
+documented (and with an implementation available to the public in\r
+source code form), and must require no special password or key for\r
+unpacking, reading or copying.\r
+\r
+ 7. Additional Terms.\r
+\r
+ "Additional permissions" are terms that supplement the terms of this\r
+License by making exceptions from one or more of its conditions.\r
+Additional permissions that are applicable to the entire Program shall\r
+be treated as though they were included in this License, to the extent\r
+that they are valid under applicable law. If additional permissions\r
+apply only to part of the Program, that part may be used separately\r
+under those permissions, but the entire Program remains governed by\r
+this License without regard to the additional permissions.\r
+\r
+ When you convey a copy of a covered work, you may at your option\r
+remove any additional permissions from that copy, or from any part of\r
+it. (Additional permissions may be written to require their own\r
+removal in certain cases when you modify the work.) You may place\r
+additional permissions on material, added by you to a covered work,\r
+for which you have or can give appropriate copyright permission.\r
+\r
+ Notwithstanding any other provision of this License, for material you\r
+add to a covered work, you may (if authorized by the copyright holders of\r
+that material) supplement the terms of this License with terms:\r
+\r
+ a) Disclaiming warranty or limiting liability differently from the\r
+ terms of sections 15 and 16 of this License; or\r
+\r
+ b) Requiring preservation of specified reasonable legal notices or\r
+ author attributions in that material or in the Appropriate Legal\r
+ Notices displayed by works containing it; or\r
+\r
+ c) Prohibiting misrepresentation of the origin of that material, or\r
+ requiring that modified versions of such material be marked in\r
+ reasonable ways as different from the original version; or\r
+\r
+ d) Limiting the use for publicity purposes of names of licensors or\r
+ authors of the material; or\r
+\r
+ e) Declining to grant rights under trademark law for use of some\r
+ trade names, trademarks, or service marks; or\r
+\r
+ f) Requiring indemnification of licensors and authors of that\r
+ material by anyone who conveys the material (or modified versions of\r
+ it) with contractual assumptions of liability to the recipient, for\r
+ any liability that these contractual assumptions directly impose on\r
+ those licensors and authors.\r
+\r
+ All other non-permissive additional terms are considered "further\r
+restrictions" within the meaning of section 10. If the Program as you\r
+received it, or any part of it, contains a notice stating that it is\r
+governed by this License along with a term that is a further\r
+restriction, you may remove that term. If a license document contains\r
+a further restriction but permits relicensing or conveying under this\r
+License, you may add to a covered work material governed by the terms\r
+of that license document, provided that the further restriction does\r
+not survive such relicensing or conveying.\r
+\r
+ If you add terms to a covered work in accord with this section, you\r
+must place, in the relevant source files, a statement of the\r
+additional terms that apply to those files, or a notice indicating\r
+where to find the applicable terms.\r
+\r
+ Additional terms, permissive or non-permissive, may be stated in the\r
+form of a separately written license, or stated as exceptions;\r
+the above requirements apply either way.\r
+\r
+ 8. Termination.\r
+\r
+ You may not propagate or modify a covered work except as expressly\r
+provided under this License. Any attempt otherwise to propagate or\r
+modify it is void, and will automatically terminate your rights under\r
+this License (including any patent licenses granted under the third\r
+paragraph of section 11).\r
+\r
+ However, if you cease all violation of this License, then your\r
+license from a particular copyright holder is reinstated (a)\r
+provisionally, unless and until the copyright holder explicitly and\r
+finally terminates your license, and (b) permanently, if the copyright\r
+holder fails to notify you of the violation by some reasonable means\r
+prior to 60 days after the cessation.\r
+\r
+ Moreover, your license from a particular copyright holder is\r
+reinstated permanently if the copyright holder notifies you of the\r
+violation by some reasonable means, this is the first time you have\r
+received notice of violation of this License (for any work) from that\r
+copyright holder, and you cure the violation prior to 30 days after\r
+your receipt of the notice.\r
+\r
+ Termination of your rights under this section does not terminate the\r
+licenses of parties who have received copies or rights from you under\r
+this License. If your rights have been terminated and not permanently\r
+reinstated, you do not qualify to receive new licenses for the same\r
+material under section 10.\r
+\r
+ 9. Acceptance Not Required for Having Copies.\r
+\r
+ You are not required to accept this License in order to receive or\r
+run a copy of the Program. Ancillary propagation of a covered work\r
+occurring solely as a consequence of using peer-to-peer transmission\r
+to receive a copy likewise does not require acceptance. However,\r
+nothing other than this License grants you permission to propagate or\r
+modify any covered work. These actions infringe copyright if you do\r
+not accept this License. Therefore, by modifying or propagating a\r
+covered work, you indicate your acceptance of this License to do so.\r
+\r
+ 10. Automatic Licensing of Downstream Recipients.\r
+\r
+ Each time you convey a covered work, the recipient automatically\r
+receives a license from the original licensors, to run, modify and\r
+propagate that work, subject to this License. You are not responsible\r
+for enforcing compliance by third parties with this License.\r
+\r
+ An "entity transaction" is a transaction transferring control of an\r
+organization, or substantially all assets of one, or subdividing an\r
+organization, or merging organizations. If propagation of a covered\r
+work results from an entity transaction, each party to that\r
+transaction who receives a copy of the work also receives whatever\r
+licenses to the work the party's predecessor in interest had or could\r
+give under the previous paragraph, plus a right to possession of the\r
+Corresponding Source of the work from the predecessor in interest, if\r
+the predecessor has it or can get it with reasonable efforts.\r
+\r
+ You may not impose any further restrictions on the exercise of the\r
+rights granted or affirmed under this License. For example, you may\r
+not impose a license fee, royalty, or other charge for exercise of\r
+rights granted under this License, and you may not initiate litigation\r
+(including a cross-claim or counterclaim in a lawsuit) alleging that\r
+any patent claim is infringed by making, using, selling, offering for\r
+sale, or importing the Program or any portion of it.\r
+\r
+ 11. Patents.\r
+\r
+ A "contributor" is a copyright holder who authorizes use under this\r
+License of the Program or a work on which the Program is based. The\r
+work thus licensed is called the contributor's "contributor version".\r
+\r
+ A contributor's "essential patent claims" are all patent claims\r
+owned or controlled by the contributor, whether already acquired or\r
+hereafter acquired, that would be infringed by some manner, permitted\r
+by this License, of making, using, or selling its contributor version,\r
+but do not include claims that would be infringed only as a\r
+consequence of further modification of the contributor version. For\r
+purposes of this definition, "control" includes the right to grant\r
+patent sublicenses in a manner consistent with the requirements of\r
+this License.\r
+\r
+ Each contributor grants you a non-exclusive, worldwide, royalty-free\r
+patent license under the contributor's essential patent claims, to\r
+make, use, sell, offer for sale, import and otherwise run, modify and\r
+propagate the contents of its contributor version.\r
+\r
+ In the following three paragraphs, a "patent license" is any express\r
+agreement or commitment, however denominated, not to enforce a patent\r
+(such as an express permission to practice a patent or covenant not to\r
+sue for patent infringement). To "grant" such a patent license to a\r
+party means to make such an agreement or commitment not to enforce a\r
+patent against the party.\r
+\r
+ If you convey a covered work, knowingly relying on a patent license,\r
+and the Corresponding Source of the work is not available for anyone\r
+to copy, free of charge and under the terms of this License, through a\r
+publicly available network server or other readily accessible means,\r
+then you must either (1) cause the Corresponding Source to be so\r
+available, or (2) arrange to deprive yourself of the benefit of the\r
+patent license for this particular work, or (3) arrange, in a manner\r
+consistent with the requirements of this License, to extend the patent\r
+license to downstream recipients. "Knowingly relying" means you have\r
+actual knowledge that, but for the patent license, your conveying the\r
+covered work in a country, or your recipient's use of the covered work\r
+in a country, would infringe one or more identifiable patents in that\r
+country that you have reason to believe are valid.\r
+\r
+ If, pursuant to or in connection with a single transaction or\r
+arrangement, you convey, or propagate by procuring conveyance of, a\r
+covered work, and grant a patent license to some of the parties\r
+receiving the covered work authorizing them to use, propagate, modify\r
+or convey a specific copy of the covered work, then the patent license\r
+you grant is automatically extended to all recipients of the covered\r
+work and works based on it.\r
+\r
+ A patent license is "discriminatory" if it does not include within\r
+the scope of its coverage, prohibits the exercise of, or is\r
+conditioned on the non-exercise of one or more of the rights that are\r
+specifically granted under this License. You may not convey a covered\r
+work if you are a party to an arrangement with a third party that is\r
+in the business of distributing software, under which you make payment\r
+to the third party based on the extent of your activity of conveying\r
+the work, and under which the third party grants, to any of the\r
+parties who would receive the covered work from you, a discriminatory\r
+patent license (a) in connection with copies of the covered work\r
+conveyed by you (or copies made from those copies), or (b) primarily\r
+for and in connection with specific products or compilations that\r
+contain the covered work, unless you entered into that arrangement,\r
+or that patent license was granted, prior to 28 March 2007.\r
+\r
+ Nothing in this License shall be construed as excluding or limiting\r
+any implied license or other defenses to infringement that may\r
+otherwise be available to you under applicable patent law.\r
+\r
+ 12. No Surrender of Others' Freedom.\r
+\r
+ If conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License. If you cannot convey a\r
+covered work so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you may\r
+not convey it at all. For example, if you agree to terms that obligate you\r
+to collect a royalty for further conveying from those to whom you convey\r
+the Program, the only way you could satisfy both those terms and this\r
+License would be to refrain entirely from conveying the Program.\r
+\r
+ 13. Use with the GNU Affero General Public License.\r
+\r
+ Notwithstanding any other provision of this License, you have\r
+permission to link or combine any covered work with a work licensed\r
+under version 3 of the GNU Affero General Public License into a single\r
+combined work, and to convey the resulting work. The terms of this\r
+License will continue to apply to the part which is the covered work,\r
+but the special requirements of the GNU Affero General Public License,\r
+section 13, concerning interaction through a network will apply to the\r
+combination as such.\r
+\r
+ 14. Revised Versions of this License.\r
+\r
+ The Free Software Foundation may publish revised and/or new versions of\r
+the GNU General Public License from time to time. Such new versions will\r
+be similar in spirit to the present version, but may differ in detail to\r
+address new problems or concerns.\r
+\r
+ Each version is given a distinguishing version number. If the\r
+Program specifies that a certain numbered version of the GNU General\r
+Public License "or any later version" applies to it, you have the\r
+option of following the terms and conditions either of that numbered\r
+version or of any later version published by the Free Software\r
+Foundation. If the Program does not specify a version number of the\r
+GNU General Public License, you may choose any version ever published\r
+by the Free Software Foundation.\r
+\r
+ If the Program specifies that a proxy can decide which future\r
+versions of the GNU General Public License can be used, that proxy's\r
+public statement of acceptance of a version permanently authorizes you\r
+to choose that version for the Program.\r
+\r
+ Later license versions may give you additional or different\r
+permissions. However, no additional obligations are imposed on any\r
+author or copyright holder as a result of your choosing to follow a\r
+later version.\r
+\r
+ 15. Disclaimer of Warranty.\r
+\r
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\r
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r
+\r
+ 16. Limitation of Liability.\r
+\r
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r
+SUCH DAMAGES.\r
+\r
+ 17. Interpretation of Sections 15 and 16.\r
+\r
+ If the disclaimer of warranty and limitation of liability provided\r
+above cannot be given local legal effect according to their terms,\r
+reviewing courts shall apply local law that most closely approximates\r
+an absolute waiver of all civil liability in connection with the\r
+Program, unless a warranty or assumption of liability accompanies a\r
+copy of the Program in return for a fee.\r
+\r
+ END OF TERMS AND CONDITIONS\r
+\r
+ How to Apply These Terms to Your New Programs\r
+\r
+ If you develop a new program, and you want it to be of the greatest\r
+possible use to the public, the best way to achieve this is to make it\r
+free software which everyone can redistribute and change under these terms.\r
+\r
+ To do so, attach the following notices to the program. It is safest\r
+to attach them to the start of each source file to most effectively\r
+state the exclusion of warranty; and each file should have at least\r
+the "copyright" line and a pointer to where the full notice is found.\r
+\r
+ <one line to give the program's name and a brief idea of what it does.>\r
+ Copyright (C) <year> <name of author>\r
+\r
+ This program is free software: you can redistribute it and/or modify\r
+ it under the terms of the GNU General Public License as published by\r
+ the Free Software Foundation, either version 3 of the License, or\r
+ (at your option) any later version.\r
+\r
+ This program is distributed in the hope that it will be useful,\r
+ but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ GNU General Public License for more details.\r
+\r
+ You should have received a copy of the GNU General Public License\r
+ along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+\r
+Also add information on how to contact you by electronic and paper mail.\r
+\r
+ If the program does terminal interaction, make it output a short\r
+notice like this when it starts in an interactive mode:\r
+\r
+ <program> Copyright (C) <year> <name of author>\r
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r
+ This is free software, and you are welcome to redistribute it\r
+ under certain conditions; type `show c' for details.\r
+\r
+The hypothetical commands `show w' and `show c' should show the appropriate\r
+parts of the General Public License. Of course, your program's commands\r
+might be different; for a GUI interface, you would use an "about box".\r
+\r
+ You should also get your employer (if you work as a programmer) or school,\r
+if any, to sign a "copyright disclaimer" for the program, if necessary.\r
+For more information on this, and how to apply and follow the GNU GPL, see\r
+<http://www.gnu.org/licenses/>.\r
+\r
+ The GNU General Public License does not permit incorporating your program\r
+into proprietary programs. If your program is a subroutine library, you\r
+may consider it more useful to permit linking proprietary applications with\r
+the library. If this is what you want to do, use the GNU Lesser General\r
+Public License instead of this License. But first, please read\r
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.\r
+ //CPI EDITOR vresion 1.2b\r
+ // Balthasar Szczepaäski Copyright 2013\r
+ //\r
+ // This file is part of CPIED also known as the CPI EDITOR or EDYTOR NAPISàW\r
+// \r
+ //CPIED is free software: you can redistribute it and/or modify\r
+ // it under the terms of the GNU General Public License as published by\r
+ // the Free Software Foundation, either version 3 of the License, or\r
+ // (at your option) any later version.\r
+//\r
+ //CPIED is distributed in the hope that it will be useful,\r
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ // GNU General Public License for more details.\r
+//\r
+ //You should have received a copy of the GNU General Public License along\r
+ // with CPIED (copying.txt). If not, see <http://www.gnu.org/licenses/>.\r
+ // \r
+ //\r
+// Compiled with Turbo C++ 3.0\r
#include <graphics.h>\r
#include <stdio.h>\r
#include <conio.h>\r
char8 lit[256];\r
};\r
\r
-\r
int status;\r
char nazwap[256]="Nie_wybrano_pliku";\r
char err[256];\r
//int premy;\r
int klik;\r
int prek;\r
-\r
\r
void showMaus();\r
void hideMaus();\r
-int setMaus();\r
-void getMaus(int *x,int *y,int *k);\r
+int setMaus ();\r
+void getMaus (int *x,int *y,int *k);\r
\r
void nullpointers();\r
-void offset();\r
+void offset ();\r
\r
-void new8 ();\r
-void menu8();\r
-void cpwys();\r
+void new8 ();\r
+void menu8 ();\r
+void cpwys ();\r
+void redraw();\r
\r
-void displayDialog(int color, char *text, int type=0);\r
+void displayDialog(int color, char *text, int type=0);\r
int message (char *text, char *value, int type=1);\r
void question (char *text, char *result);\r
unsigned question (char *text);\r
void ent14();\r
void ent16();\r
\r
-int otw();\r
-int otw2();\r
+int otw ();\r
+int otw2();\r
+void otw3();\r
\r
-int zap();\r
-int zap2();\r
+int zap ();\r
+int zap2();\r
+void zap3();\r
\r
-int zmn();\r
+void use3();\r
\r
-int newCPI ();\r
-int newCPI2(short CP, short h);\r
+int zmn ();\r
+void zmn3();\r
+\r
+int newCPI ();\r
+int newCPI2(short CP, short h);\r
+void newCPI3();\r
\r
void deleteCPI(short st=6,short a=0,short b=0);\r
\r
-int newCP ();\r
-int newCP2(short CP,short h);\r
+int newCP ();\r
+int newCP2(short CP,short h);\r
+void newCP3();\r
+\r
+void normCP();\r
+void nextCP();\r
+void prevCP();\r
\r
-int delCP();\r
+int delCP ();\r
+void delCP3();\r
\r
-int newF ();\r
-int newF2 (short h);\r
-int newF8 (short CP);\r
-int newF14(short CP);\r
-int newF16(short CP);\r
+int newF ();\r
+int newF2 (short h);\r
+void newF3();\r
+int newF8 (short CP);\r
+int newF14(short CP);\r
+int newF16(short CP);\r
\r
-int delF ();\r
-int delF8 (short h);\r
-int delF14(short h);\r
-int delF16(short h);\r
+void prevF();\r
+void nextF();\r
+\r
+int delF ();\r
+void delF3();\r
+int delF8 (short h);\r
+int delF14(short h);\r
+int delF16(short h);\r
\r
int main(int argc,char* argv[]);\r
\r
iR.x.ax=0x0001;\r
int86(0x33,&iR,&oR);\r
}\r
-\r
void hideMaus()\r
{\r
iR.x.ax=0x0002;\r
int86(0x33,&iR,&oR);\r
}\r
-\r
int setMaus()\r
{\r
iR.x.ax=0x0000;\r
int86(0x33,&iR,&oR);\r
return oR.x.ax;\r
}\r
-\r
void getMaus(int *x,int *y,int *k)\r
{\r
iR.x.ax=0x0003;\r
}\r
\r
}\r
-void deleteCPI(short st,short a,short b)\r
-{\r
- short i,j;\r
- switch(st)\r
- {\r
- case 6:\r
- if(FIH==NULL)\r
- return;\r
- a=FIH->num_codepages-1;\r
- b=CPIH[a]->num_fonts-1;\r
- case 5:\r
- switch(SFH[a][b]->height)\r
- {\r
- case 8:\r
- delete SFB8[a];\r
- SFB8[a] = NULL;\r
- byo8[a] = 0;\r
- break;\r
- case 14:\r
- delete SFB14[a];\r
- SFB14[a] = NULL;\r
- byo14[a] = 0;\r
- break;\r
- case 16:\r
- delete SFB16[a];\r
- SFB16[a] = NULL;\r
- byo16[a] = 0;\r
- break;\r
- //default:\r
- //totally unexpected;\r
- }\r
- case 4:\r
- delete SFH[a][b];\r
- SFH[a][b] = NULL;\r
- for(j=0;j<b;++j)\r
- {\r
- switch(SFH[a][j]->height)\r
- {\r
- case 8:\r
- delete SFB8[a];\r
- SFB8[a] = NULL;\r
- byo8[a] = 0;\r
- break;\r
- case 14:\r
- delete SFB14[a];\r
- SFB14[a] = NULL;\r
- byo14[a] = 0;\r
- break;\r
- case 16:\r
- delete SFB16[a];\r
- SFB16[a] = NULL;\r
- byo16[a] = 0;\r
- break;\r
- //default:\r
- //totally unexpected;\r
- }\r
- delete SFH[a][j];\r
- SFH[a][j] = NULL;\r
- }\r
- case 3:\r
- delete CPIH[a];\r
- CPIH[a] = NULL;\r
- case 2:\r
- delete CPEH[a];\r
- CPEH[a] = NULL;\r
- for(i=0;i<a;++i)\r
- {\r
- for(j=0;j<CPIH[i]->num_fonts;++j)\r
- {\r
- switch(SFH[i][j]->height)\r
- {\r
- case 8:\r
- delete SFB8[i];\r
- SFB8[i] = NULL;\r
- byo8[i] = 0;\r
- break;\r
- case 14:\r
- delete SFB14[i];\r
- SFB14[i] = NULL;\r
- byo14[i] = 0;\r
- break;\r
- case 16:\r
- delete SFB16[i];\r
- SFB16[i] = NULL;\r
- byo16[i] = 0;\r
- break;\r
- //default:\r
- //totally unexpected;\r
- }\r
- delete SFH[i][j];\r
- SFH[i][j] = NULL;\r
- }\r
- delete CPIH[i];\r
- delete CPEH[i];\r
- CPIH[i] = NULL;\r
- CPEH[i] = NULL;\r
- }\r
- case 1:\r
- delete FIH;\r
- FIH = NULL;\r
- case 0:\r
- delete FFH;\r
- FFH = NULL;\r
- }\r
-}\r
-\r
void new8()\r
{\r
cleardevice();\r
\r
outtextxy(0,0, "CPI editor 1.2±");\r
outtextxy(0,8, "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
- //outtextxy(600,16,"v1.2a");\r
+ //outtextxy(600,16,"v1.2b");\r
}\r
void menu8()\r
{\r
void cpwys()\r
{\r
char cpw[256];\r
- setcolor(BLACK);\r
- outtextxy(0x78,0,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");\r
+ setfillstyle(EMPTY_FILL,BLACK);\r
+ bar(120,0,639,7);\r
if(any)\r
{\r
if((unsigned)(CPEH[cp]->codepage)>=1000)\r
strcpy(cpw, "°No CPI open°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°");\r
setcolor(GREEN);\r
\r
- outtextxy(0x78,0,cpw);\r
+ outtextxy(120,0,cpw);\r
+}\r
+void redraw()//\r
+{\r
+ cury&=7;\r
+ new8();\r
+ menu8();\r
+ cpwys();\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ return;\r
+}\r
+\r
+void displayDialog(int color,char *text,int type)\r
+{\r
+ gotoxy(21,13);\r
+ char t1[43]="±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±";\r
+ strcpy(t1+1,text);\r
+ t1[strlen(t1)]='±';\r
+ setfillstyle(EMPTY_FILL,BLACK);\r
+ bar(152,184,487,215);\r
+ setcolor(color);\r
+ outtextxy(152,184,t1);\r
+ outtextxy(152,192,"± ±");\r
+ outtextxy(152,200,"± ±");\r
+ switch(type)\r
+ {\r
+ case 2:\r
+ outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)±");\r
+ break;\r
+ case 1:\r
+ outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey±");\r
+ break;\r
+ case 0:\r
+ default:\r
+ outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
+ break;\r
+ }\r
+}\r
+int message(char *text, char *value, int type)\r
+{\r
+ if (type!=2)\r
+ {\r
+ displayDialog(BROWN,text,1);\r
+ printf("%s",value);\r
+ bioskey(_KEYBRD_READ);\r
+ return 0;\r
+ }\r
+ else\r
+ {\r
+ displayDialog(BROWN,text,2);\r
+ printf("%s",value);\r
+ int a;\r
+ for(;;)\r
+ {\r
+ a=bioskey(_KEYBRD_READ);\r
+ if((a&0xFF)==0x59||(a&0xFF)==0x79)\r
+ return 0;\r
+ if((a&0xFF)==0x4e||(a&0xff)==0x6e)\r
+ return 1;\r
+ }\r
+ }\r
+}\r
+inline void question(char *text, char *result)\r
+{\r
+ displayDialog(GREEN,text);\r
+ scanf("%s",result);\r
+}\r
+inline unsigned question(char *text)\r
+{\r
+ char temp[256];\r
+ question(text,temp);\r
+ return atoi(temp);\r
}\r
\r
void ramka8()\r
setcolor(GREEN);\r
else\r
setcolor(RED);\r
- rectangle(15,222,144,447);\r
+ rectangle(15,223,144,448);\r
if(tab!=0&&wys==14)\r
setcolor(GREEN);\r
else\r
setcolor(RED);\r
- rectangle(175,222,304,447);\r
+ rectangle(175,223,304,448);\r
}\r
void ramka16()\r
{\r
setcolor(GREEN);\r
else\r
setcolor(RED);\r
- rectangle(335,110,464,367);\r
+ rectangle(335,111,464,368);\r
if(tab!=0&&wys==16)\r
setcolor(GREEN);\r
else\r
setcolor(RED);\r
- rectangle(495,110,624,367);\r
+ rectangle(495,111,624,368);\r
}\r
-void lin14(int mode)\r
+void lin8(int mode)\r
{\r
if(!any)\r
return;\r
if(mode==3)\r
{\r
- if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- putpixel(176+curx+(lit%16)*8,223+cury+(lit/16)*14,GREEN);\r
+ if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
+ putpixel(176+curx+((lit&15)<<3),32+cury+((lit>>4)<<3),GREEN);\r
else\r
- putpixel(176+curx+(lit%16)*8,223+cury+(lit/16)*14,BLACK);\r
+ putpixel(176+curx+((lit&15)<<3),32+cury+((lit>>4)<<3),BLACK);\r
return;\r
}\r
char ab[2]="X";\r
int color1,color2;\r
- if(byo14[cp]==0)\r
+ if(byo8[cp]==0)\r
{\r
setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(176,223,303,446);\r
+ bar(176,32,303,159);\r
return;\r
}\r
- if(wys==14)\r
+ if(wys==8)\r
{\r
color1=GREEN;\r
color2=GREEN;\r
color1=BROWN;\r
color2=RED;\r
}\r
- int a,b,l;\r
+ int l;\r
switch(mode)\r
{\r
case 2:\r
setcolor(RED);\r
- if(pre%16!=lit%16)\r
- {\r
- ab[0]=abc[pre%16];\r
- outtextxy(176+8*(pre%16),215,ab);\r
- }\r
- if(pre/16!=lit/16)\r
+ if((pre&15)!=(lit&15))\r
{\r
- ab[0]=abc[pre/16];\r
- outtextxy(168,226+14*(pre/16),ab);\r
+ ab[0]=abc[pre&15];\r
+ outtextxy(176+((pre&15)<<3),24,ab);\r
}\r
- for(a=0;a<14;++a)\r
+ if(pre>>4!=lit>>4)\r
{\r
- for(b=0;b<8;++b)\r
- {\r
- if(SFB14[cp]->lit[pre].lin[a]&(0x80>>b))\r
- putpixel(176+b+(pre%16)*8,223+a+(pre/16)*14,BROWN);\r
- else\r
- putpixel(176+b+(pre%16)*8,223+a+(pre/16)*14,BLACK);\r
- }\r
+ ab[0]=abc[pre>>4];\r
+ outtextxy(168,32+((pre>>4)<<3),ab);\r
}\r
+ setfillpattern(SFB8[cp]->lit[pre].lin,BROWN);\r
+ bar(176+((pre&15)<<3),32+((pre>>4)<<3),183+((pre&15)<<3),39+((pre>>4)<<3));\r
+ \r
+ \r
case 3:\r
case 1:\r
setcolor(color2);\r
- ab[0]=abc[lit%16];\r
- outtextxy(176+8*(lit%16),215,ab);\r
- ab[0]=abc[lit/16];\r
- outtextxy(168,226+14*(lit/16),ab);\r
- for(a=0;a<14;++a)\r
- {\r
- for(b=0;b<8;++b)\r
- {\r
- if(SFB14[cp]->lit[lit].lin[a]&(0x80>>b))\r
- putpixel(176+b+(lit%16)*8,223+a+(lit/16)*14,color1);\r
- else\r
- putpixel(176+b+(lit%16)*8,223+a+(lit/16)*14,BLACK);\r
- }\r
- }\r
+ ab[0]=abc[lit&15];\r
+ outtextxy(176+((lit&15)<<3),24,ab);\r
+ ab[0]=abc[lit>>4];\r
+ outtextxy(168,32+((lit>>4)<<3),ab);\r
+ setfillpattern(SFB8[cp]->lit[lit].lin,color1);\r
+ bar(176+((lit&15)<<3),32+((lit>>4)<<3),183+((lit&15)<<3),39+((lit>>4)<<3));\r
+ \r
+ \r
break;\r
case 0:\r
default:\r
for(l=0;l<16;++l)\r
{\r
ab[0]=abc[l];\r
- if(lit%16==l)\r
+ if((lit&15)==l)\r
setcolor(color2);\r
else\r
setcolor(RED);\r
- outtextxy(176+8*l,215,ab);\r
- if(lit/16==l)\r
+ outtextxy(176+(l<<3),24,ab);\r
+ if(lit>>4==l)\r
setcolor(color2);\r
else\r
setcolor(RED);\r
- outtextxy(168,226+14*l,ab);\r
+ outtextxy(168,32+(l<<3),ab);\r
}\r
for(l=0;l<256;++l)\r
{\r
- for(a=0;a<14;++a)\r
- {\r
- for(b=0;b<8;++b)\r
- {\r
- if (l==lit)\r
- {\r
- if(SFB14[cp]->lit[l].lin[a]&(0x80>>b))\r
- putpixel(176+b+(l%16)*8,223+a+(l/16)*14,color1);\r
- else\r
- putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
- }\r
- else\r
- {\r
- if(SFB14[cp]->lit[l].lin[a]&(0x80>>b))\r
- putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BROWN);\r
- else\r
- putpixel(176+b+(l%16)*8,223+a+(l/16)*14,BLACK);\r
- }\r
- }\r
- }\r
+ if(l==lit)\r
+ setfillpattern(SFB8[cp]->lit[l].lin,color1);\r
+ else\r
+ setfillpattern(SFB8[cp]->lit[l].lin,BROWN);\r
+ bar(176+((l&15)<<3),32+((l>>4)<<3),183+((l&15)<<3),39+((l>>4)<<3));\r
}\r
break;\r
}\r
}\r
-void lin8(int mode)\r
+void lin14(int mode)\r
{\r
if(!any)\r
return;\r
if(mode==3)\r
{\r
- if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- putpixel(176+curx+(lit%16)*8,32+cury+(lit/16)*8,GREEN);\r
+ if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
+ putpixel(176+curx+((lit&15)<<3),224+cury+(lit>>4)*14,GREEN);\r
else\r
- putpixel(176+curx+(lit%16)*8,32+cury+(lit/16)*8,BLACK);\r
+ putpixel(176+curx+((lit&15)<<3),224+cury+(lit>>4)*14,BLACK);\r
return;\r
}\r
char ab[2]="X";\r
int color1,color2;\r
- if(byo8[cp]==0)\r
+ if(byo14[cp]==0)\r
{\r
setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(176,32,303,159);\r
+ bar(176,224,303,447);\r
return;\r
}\r
- if(wys==8)\r
+ if(wys==14)\r
{\r
color1=GREEN;\r
color2=GREEN;\r
color1=BROWN;\r
color2=RED;\r
}\r
- int a,b,l;\r
+ int a,l;\r
switch(mode)\r
{\r
case 2:\r
setcolor(RED);\r
- if(pre%16!=lit%16)\r
+ if((pre&15)!=(lit&15))\r
{\r
- ab[0]=abc[pre%16];\r
- outtextxy(176+8*(pre%16),24,ab);\r
+ ab[0]=abc[pre&15];\r
+ outtextxy(176+((pre&15)<<3),216,ab);\r
}\r
- if(pre/16!=lit/16)\r
+ if(pre>>4!=lit>>4)\r
{\r
- ab[0]=abc[pre/16];\r
- outtextxy(168,32+8*(pre/16),ab);\r
+ ab[0]=abc[pre>>4];\r
+ outtextxy(168,227+(pre>>4)*14,ab);\r
}\r
- for(a=0;a<8;++a)\r
+ a=(pre>>4)&3;\r
+ if(a)\r
{\r
- for(b=0;b<8;++b)\r
- {\r
- if(SFB8[cp]->lit[pre].lin[a]&(0x80>>b))\r
- putpixel(176+b+(pre%16)*8,32+a+(pre/16)*8,BROWN);\r
- else\r
- putpixel(176+b+(pre%16)*8,32+a+(pre/16)*8,BLACK);\r
- }\r
+ setfillpattern(SFB14[cp]->lit[pre].lin+(a<<1)-8,BROWN);\r
+ bar(176+((pre&15)<<3),224+(pre>>4)*14,183+((pre&15)<<3),223+(a<<1)+(pre>>4)*14);\r
+ }\r
+ setfillpattern(SFB14[cp]->lit[pre].lin+(a<<1),BROWN);\r
+ bar(176+((pre&15)<<3),224+(a<<1)+(pre>>4)*14,183+((pre&15)<<3),231+(a<<1)+(pre>>4)*14);\r
+ if(a!=3)\r
+ {\r
+ setfillpattern(SFB14[cp]->lit[pre].lin+(a<<1)+8,BROWN);\r
+ bar(176+((pre&15)<<3),232+(a<<1)+(pre>>4)*14,183+((pre&15)<<3),237+(pre>>4)*14);\r
}\r
case 3:\r
case 1:\r
setcolor(color2);\r
- ab[0]=abc[lit%16];\r
- outtextxy(176+8*(lit%16),24,ab);\r
- ab[0]=abc[lit/16];\r
- outtextxy(168,32+8*(lit/16),ab);\r
- for(a=0;a<8;++a)\r
- {\r
- for(b=0;b<8;++b)\r
- {\r
- if(SFB8[cp]->lit[lit].lin[a]&(0x80>>b))\r
- putpixel(176+b+(lit%16)*8,32+a+(lit/16)*8,color1);\r
- else\r
- putpixel(176+b+(lit%16)*8,32+a+(lit/16)*8,BLACK);\r
- }\r
- }\r
+ ab[0]=abc[lit&15];\r
+ outtextxy(176+((lit&15)<<3),216,ab);\r
+ ab[0]=abc[lit>>4];\r
+ outtextxy(168,227+(lit>>4)*14,ab);\r
+ a=(lit>>4)&3;\r
+ if(a)\r
+ {\r
+ setfillpattern(SFB14[cp]->lit[lit].lin+(a<<1)-8,color1);\r
+ bar(176+((lit&15)<<3),224+(lit>>4)*14,183+((lit&15)<<3),223+(a<<1)+(lit>>4)*14);\r
+ }\r
+ setfillpattern(SFB14[cp]->lit[lit].lin+(a<<1),color1);\r
+ bar(176+((lit&15)<<3),224+(a<<1)+(lit>>4)*14,183+((lit&15)<<3),231+(a<<1)+(lit>>4)*14);\r
+ if(a!=3)\r
+ {\r
+ setfillpattern(SFB14[cp]->lit[lit].lin+(a<<1)+8,color1);\r
+ bar(176+((lit&15)<<3),232+(a<<1)+(lit>>4)*14,183+((lit&15)<<3),237+(lit>>4)*14);\r
+ } \r
break;\r
case 0:\r
default:\r
for(l=0;l<16;++l)\r
{\r
ab[0]=abc[l];\r
- if(lit%16==l)\r
+ if((lit&15)==l)\r
setcolor(color2);\r
else\r
setcolor(RED);\r
- outtextxy(176+8*l,24,ab);\r
- if(lit/16==l)\r
+ outtextxy(176+(l<<3),216,ab);\r
+ if(lit>>4==l)\r
setcolor(color2);\r
else\r
setcolor(RED);\r
- outtextxy(168,32+8*l,ab);\r
+ outtextxy(168,227+l*14,ab);\r
}\r
for(l=0;l<256;++l)\r
{\r
- for(a=0;a<8;++a)\r
+ a=(l>>4)&3;\r
+ if(l==lit)\r
{\r
- for(b=0;b<8;++b)\r
+ if(a)\r
{\r
- if (l==lit)\r
- {\r
- if(SFB8[cp]->lit[l].lin[a]&(0x80>>b))\r
- putpixel(176+b+(l%16)*8,32+a+(l/16)*8,color1);\r
- else\r
- putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
- }\r
- else\r
- {\r
- if(SFB8[cp]->lit[l].lin[a]&(0x80>>b))\r
- putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BROWN);\r
- else\r
- putpixel(176+b+(l%16)*8,32+a+(l/16)*8,BLACK);\r
- }\r
+ setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)-8,color1);\r
+ bar(176+((l&15)<<3),224+(l>>4)*14,183+((l&15)<<3),223+(a<<1)+(l>>4)*14);\r
+ }\r
+ setfillpattern(SFB14[cp]->lit[l].lin+(a<<1),color1);\r
+ bar(176+((l&15)<<3),224+(a<<1)+(l>>4)*14,183+((l&15)<<3),231+(a<<1)+(l>>4)*14);\r
+ if(a!=3)\r
+ {\r
+ setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)+8,color1);\r
+ bar(176+((l&15)<<3),232+(a<<1)+(l>>4)*14,183+((l&15)<<3),237+(l>>4)*14);\r
+ }\r
+ }\r
+ else\r
+ {\r
+ if(a)\r
+ {\r
+ setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)-8,BROWN);\r
+ bar(176+((l&15)<<3),224+(l>>4)*14,183+((l&15)<<3),223+(a<<1)+(l>>4)*14);\r
+ }\r
+ setfillpattern(SFB14[cp]->lit[l].lin+(a<<1),BROWN);\r
+ bar(176+((l&15)<<3),224+(a<<1)+(l>>4)*14,183+((l&15)<<3),231+(a<<1)+(l>>4)*14);\r
+ if(a!=3)\r
+ {\r
+ setfillpattern(SFB14[cp]->lit[l].lin+(a<<1)+8,BROWN);\r
+ bar(176+((l&15)<<3),232+(a<<1)+(l>>4)*14,183+((l&15)<<3),237+(l>>4)*14);\r
}\r
}\r
}\r
if(mode==3)\r
{\r
if(SFB16[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
- putpixel(496+curx+(lit%16)*8,111+cury+(lit/16)*16,GREEN);\r
+ putpixel(496+curx+((lit&15)<<3),112+cury+((lit>>4)<<4),GREEN);\r
else\r
- putpixel(496+curx+(lit%16)*8,111+cury+(lit/16)*16,BLACK);\r
+ putpixel(496+curx+((lit&15)<<3),112+cury+((lit>>4)<<4),BLACK);\r
return;\r
}\r
char ab[2]="X";\r
if(byo16[cp]==0)\r
{\r
setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(496,111,623,366);\r
+ bar(496,112,623,367);\r
return;\r
}\r
if(wys==16)\r
color1=BROWN;\r
color2=RED;\r
}\r
- int a,b,l;\r
+ int l;\r
switch(mode)\r
{\r
- case 3:\r
case 2:\r
setcolor(RED);\r
- if(pre%16!=lit%16)\r
- {\r
- ab[0]=abc[pre%16];\r
- outtextxy(496+8*(pre%16),103,ab);\r
- }\r
- if(pre/16!=lit/16)\r
+ if((pre&15)!=(lit&15))\r
{\r
- ab[0]=abc[pre/16];\r
- outtextxy(488,115+16*(pre/16),ab);\r
+ ab[0]=abc[pre&15];\r
+ outtextxy(496+((pre&15)<<3),104,ab);\r
}\r
- for(a=0;a<16;++a)\r
+ if(pre>>4!=lit>>4)\r
{\r
- for(b=0;b<8;++b)\r
- {\r
- if(SFB16[cp]->lit[pre].lin[a]&(0x80>>b))\r
- putpixel(496+b+(pre%16)*8,111+a+(pre/16)*16,BROWN);\r
- else\r
- putpixel(496+b+(pre%16)*8,111+a+(pre/16)*16,BLACK);\r
- }\r
+ ab[0]=abc[pre>>4];\r
+ outtextxy(488,116+((pre>>4)<<4),ab);\r
}\r
+ setfillpattern(SFB16[cp]->lit[pre].lin,BROWN);\r
+ bar(496+((pre&15)<<3),112+((pre>>4)<<4),503+((pre&15)<<3),119+((pre>>4)<<4));\r
+ setfillpattern(SFB16[cp]->lit[pre].lin+8,BROWN);\r
+ bar(496+((pre&15)<<3),120+((pre>>4)<<4),503+((pre&15)<<3),127+((pre>>4)<<4));\r
+ case 3: \r
case 1:\r
setcolor(color2);\r
- ab[0]=abc[lit%16];\r
- outtextxy(496+8*(lit%16),103,ab);\r
- ab[0]=abc[lit/16];\r
- outtextxy(488,115+16*(lit/16),ab);\r
- for(a=0;a<16;++a)\r
- {\r
- for(b=0;b<8;++b)\r
- {\r
- if(SFB16[cp]->lit[lit].lin[a]&(0x80>>b))\r
- putpixel(496+b+(lit%16)*8,111+a+(lit/16)*16,color1);\r
- else\r
- putpixel(496+b+(lit%16)*8,111+a+(lit/16)*16,BLACK);\r
- }\r
- }\r
- break;\r
- case 0:\r
- default:\r
- for(l=0;l<16;++l)\r
+ ab[0]=abc[lit&15];\r
+ outtextxy(496+((lit&15)<<3),104,ab);\r
+ ab[0]=abc[lit>>4];\r
+ outtextxy(488,116+((lit>>4)<<4),ab);\r
+ setfillpattern(SFB16[cp]->lit[lit].lin,color1);\r
+ bar(496+((lit&15)<<3),112+((lit>>4)<<4),503+((lit&15)<<3),119+((lit>>4)<<4));\r
+ setfillpattern(SFB16[cp]->lit[lit].lin+8,color1);\r
+ bar(496+((lit&15)<<3),120+((lit>>4)<<4),503+((lit&15)<<3),127+((lit>>4)<<4));\r
+ break;\r
+ case 0:\r
+ default:\r
+ for(l=0;l<16;++l)\r
{\r
ab[0]=abc[l];\r
- if(lit%16==l)\r
+ if((lit&15)==l)\r
setcolor(color2);\r
else\r
setcolor(RED);\r
- outtextxy(496+8*l,103,ab);\r
- if(lit/16==l)\r
+ outtextxy(496+(l<<3),104,ab);\r
+ if(lit>>4==l)\r
setcolor(color2);\r
else\r
setcolor(RED);\r
- outtextxy(488,115+16*l,ab);\r
+ outtextxy(488,116+(l<<4),ab);\r
}\r
for(l=0;l<256;++l)\r
{\r
- for(a=0;a<16;++a)\r
+ if(l==lit)\r
{\r
- for(b=0;b<8;++b)\r
- {\r
- if (l==lit)\r
- {\r
- if(SFB16[cp]->lit[l].lin[a]&(0x80>>b))\r
- putpixel(496+b+(l%16)*8,111+a+(l/16)*16,color1);\r
- else\r
- putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
- }\r
- else\r
- {\r
- if(SFB16[cp]->lit[l].lin[a]&(0x80>>b))\r
- putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BROWN);\r
- else\r
- putpixel(496+b+(l%16)*8,111+a+(l/16)*16,BLACK);\r
- }\r
- }\r
+ setfillpattern(SFB16[cp]->lit[l].lin,color1);\r
+ bar(496+((l&15)<<3),112+((l>>4)<<4),503+((l&15)<<3),119+((l>>4)<<4));\r
+ setfillpattern(SFB16[cp]->lit[l].lin+8,color1);\r
+ bar(496+((l&15)<<3),120+((l>>4)<<4),503+((l&15)<<3),127+((l>>4)<<4));\r
+ }\r
+ else\r
+ {\r
+ setfillpattern(SFB16[cp]->lit[l].lin,BROWN);\r
+ bar(496+((l&15)<<3),112+((l>>4)<<4),503+((l&15)<<3),119+((l>>4)<<4));\r
+ setfillpattern(SFB16[cp]->lit[l].lin+8,BROWN);\r
+ bar(496+((l&15)<<3),120+((l>>4)<<4),503+((l&15)<<3),127+((l>>4)<<4));\r
}\r
}\r
break;\r
if(curx!=prex)\r
{\r
ab[0]=abc[prex];\r
- outtextxy(20+16*prex,24,ab);\r
+ outtextxy(20+(prex<<4),24,ab);\r
}\r
if(prey<8)\r
{\r
if(cury!=prey)\r
{\r
ab[0]=abc[prey];\r
- outtextxy(8,36+16*prey,ab);\r
+ outtextxy(8,36+(prey<<4),ab);\r
}\r
if(SFB8[cp]->lit[lit].lin[prey]&(0x80>>prex))\r
{\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(0x10+prex*0x10,0x20+prey*0x10,0x1f+prex*0x10,0x2f+prey*0x10);\r
+ bar(16+(prex<<4),32+(prey<<4),31+(prex<<4),47+(prey<<4));\r
}\r
case 1:\r
setcolor(color);\r
ab[0]=abc[curx];\r
- outtextxy(20+16*curx,24,ab);\r
+ outtextxy(20+(curx<<4),24,ab);\r
if(cury<8)\r
{\r
ab[0]=abc[cury];\r
- outtextxy(8,36+16*cury,ab);\r
+ outtextxy(8,36+(cury<<4),ab);\r
if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
{\r
setcolor(BROWN);\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(0x10+curx*0x10,0x20+cury*0x10,0x1f+curx*0x10,0x2f+cury*0x10);\r
+ bar(16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
if(wys==8)\r
{\r
setcolor(GREEN);\r
- rectangle(0x10 + curx*0x10, 0x20 + cury*0x10 ,0x1f + curx*0x10, 0x2f + cury*0x10);\r
+ rectangle(16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
setcolor(BLACK);\r
- rectangle(0x11 + curx*0x10, 0x21 + cury*0x10, 0x1e + curx*0x10, 0x2e + cury*0x10);\r
+ rectangle(17+(curx<<4),33+(cury<<4),30+(curx<<4),46+(cury<<4));\r
}\r
}\r
break;\r
setcolor(RED);\r
ab[0]=abc[l];\r
\r
- outtextxy(20+16*l,24,ab);\r
+ outtextxy(20+(l<<4),24,ab);\r
if(l==cury)\r
setcolor(color);\r
else\r
setcolor(RED);\r
ab[0]=abc[l];\r
- outtextxy(8,36+16*l,ab);\r
+ outtextxy(8,36+(l<<4),ab);\r
}\r
for(int a=0;a<8;++a)\r
{\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(0x10+b*0x10,0x20+a*0x10,0x1f+b*0x10,0x2f+a*0x10);\r
+ bar(16+(b<<4),32+(a<<4),31+(b<<4),47+(a<<4));\r
}\r
}\r
if(wys==8)\r
{\r
setcolor(GREEN);\r
- rectangle(0x10 + curx*0x10, 0x20 + cury*0x10 ,0x1f + curx*0x10, 0x2f + cury*0x10);\r
+ rectangle(16+(curx<<4),32+(cury<<4),31+(curx<<4),47+(cury<<4));\r
setcolor(BLACK);\r
- rectangle(0x11 + curx*0x10, 0x21 + cury*0x10, 0x1e + curx*0x10, 0x2e + cury*0x10);\r
+ rectangle(17+(curx<<4),33+(cury<<4),30+(curx<<4),46+(cury<<4));\r
}\r
break;\r
}\r
if(byo14[cp]==0)\r
{\r
setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(16,223,143,446);\r
+ bar(16,224,143,447);\r
return;\r
}\r
char ab[2]="q";\r
if(curx!=prex)\r
{\r
ab[0]=abc[prex];\r
- outtextxy(20+16*prex,215,ab);\r
+ outtextxy(20+(prex<<4),216,ab);\r
}\r
if(prey<14)\r
{\r
if(cury!=prey)\r
{\r
ab[0]=abc[prey];\r
- outtextxy(8,227+16*prey,ab);\r
+ outtextxy(8,228+(prey<<4),ab);\r
}\r
if(SFB14[cp]->lit[lit].lin[prey]&(0x80>>prex))\r
{\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(16+prex*16,223+prey*16,31+prex*16,238+prey*16);\r
+ bar(16+(prex<<4),224+(prey<<4),31+(prex<<4),239+(prey<<4));\r
}\r
case 1:\r
setcolor(color);\r
ab[0]=abc[curx];\r
- outtextxy(20+16*curx,215,ab);\r
+ outtextxy(20+(curx<<4),216,ab);\r
if(cury<14)\r
{\r
ab[0]=abc[cury];\r
- outtextxy(8,227+16*cury,ab);\r
+ outtextxy(8,228+(cury<<4),ab);\r
if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
{\r
setcolor(BROWN);\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(16+curx*16,223+cury*16,31+curx*16,238+cury*16);\r
+ bar(16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
if(wys==14)\r
{\r
setcolor(GREEN);\r
- rectangle(16+curx*16,223+cury*16,31+curx*16,238+cury*16);\r
+ rectangle(16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
setcolor(BLACK);\r
- rectangle(17+curx*16,224+cury*16,30+curx*16,237+cury*16);\r
+ rectangle(17+(curx<<4),225+(cury<<4),30+(curx<<4),238+(cury<<4));\r
}\r
}\r
break;\r
setcolor(RED);\r
ab[0]=abc[l];\r
if(l<8)\r
- outtextxy(20+16*l,215,ab);\r
+ outtextxy(20+(l<<4),216,ab);\r
if(l==cury)\r
setcolor(color);\r
else\r
setcolor(RED);\r
ab[0]=abc[l];\r
- outtextxy(8,227+16*l,ab);\r
+ outtextxy(8,228+(l<<4),ab);\r
}\r
for(int a=0;a<14;++a)\r
{\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(16+b*16,223+a*16,31+b*16,238+a*16);\r
+ bar(16+(b<<4),224+(a<<4),31+(b<<4),239+(a<<4)); \r
}\r
}\r
if(wys==14)\r
{\r
setcolor(GREEN);\r
- rectangle(16+curx*16,223+cury*16,31+curx*16,238+cury*16);\r
+ rectangle(16+(curx<<4),224+(cury<<4),31+(curx<<4),239+(cury<<4));\r
setcolor(BLACK);\r
- rectangle(17+curx*16,224+cury*16,30+curx*16,237+cury*16);\r
+ rectangle(17+(curx<<4),225+(cury<<4),30+(curx<<4),238+(cury<<4));\r
}\r
break;\r
}\r
if(byo16[cp]==0)\r
{\r
setfillstyle(WIDE_DOT_FILL,RED);\r
- bar(336,111,463,366);\r
+ bar(336,112,463,367);\r
return;\r
}\r
char ab[2]="q";\r
if(curx!=prex)\r
{\r
ab[0]=abc[prex];\r
- outtextxy(340+16*prex,103,ab);\r
+ outtextxy(340+(prex<<4),104,ab);\r
}\r
if(cury!=prey)\r
{\r
ab[0]=abc[prey];\r
- outtextxy(328,115+16*prey,ab);\r
+ outtextxy(328,116+(prey<<4),ab);\r
}\r
if(SFB16[cp]->lit[lit].lin[prey]&(0x80>>prex))\r
{\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(336+prex*16,111+prey*16,351+prex*16,126+prey*16);\r
+ bar(336+(prex<<4),112+(prey<<4),351+(prex<<4),127+(prey<<4));\r
case 1:\r
setcolor(color);\r
ab[0]=abc[curx];\r
- outtextxy(340+16*curx,103,ab);\r
+ outtextxy(340+(curx<<4),104,ab);\r
ab[0]=abc[cury];\r
- outtextxy(328,115+16*cury,ab);\r
+ outtextxy(328,116+(cury<<4),ab);\r
if(SFB16[cp]->lit[lit].lin[cury]&(0x80>>curx))\r
{\r
setcolor(BROWN);\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(336+curx*16,111+cury*16,351+curx*16,126+cury*16);\r
+ bar(336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4)); \r
if(wys==16)\r
{\r
setcolor(GREEN);\r
- rectangle(336+curx*16,111+cury*16,351+curx*16,126+cury*16);\r
+ rectangle(336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4));\r
setcolor(BLACK);\r
- rectangle(337+curx*16,112+cury*16,350+curx*16,125+cury*16);\r
+ rectangle(337+(curx<<4),113+(cury<<4),350+(curx<<4),126+(cury<<4));\r
}\r
break;\r
case 0:\r
setcolor(RED);\r
ab[0]=abc[l];\r
if(l<8)\r
- outtextxy(340+16*l,103,ab);\r
+ outtextxy(340+(l<<4),104,ab);\r
if(l==cury)\r
setcolor(color);\r
else\r
setcolor(RED);\r
ab[0]=abc[l];\r
- outtextxy(328,115+16*l,ab);\r
+ outtextxy(328,116+(l<<4),ab);\r
}\r
for(int a=0;a<16;++a)\r
{\r
setcolor(BLACK);\r
setfillstyle(SOLID_FILL,BLACK);\r
}\r
- bar(336+b*16,111+a*16,351+b*16,126+a*16);\r
+ bar(336+(b<<4),112+(a<<4),351+(b<<4),127+(a<<4));\r
}\r
}\r
if(wys==16)\r
{\r
setcolor(GREEN);\r
- rectangle(336+curx*16,111+cury*16,351+curx*16,126+cury*16);\r
+ rectangle(336+(curx<<4),112+(cury<<4),351+(curx<<4),127+(cury<<4));\r
setcolor(BLACK);\r
- rectangle(337+curx*16,112+cury*16,350+curx*16,125+cury*16);\r
+ rectangle(337+(curx<<4),113+(cury<<4),350+(curx<<4),126+(cury<<4));\r
}\r
}\r
}\r
{\r
SFB8[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
}\r
-inline void bsp8()\r
+inline void spc14()\r
{\r
- SFB8[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
+ SFB14[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
}\r
-inline void ent8()\r
+inline void spc16()\r
{\r
- SFB8[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
+ SFB16[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
}\r
-inline void spc14()\r
+inline void bsp8()\r
{\r
- SFB14[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
+ SFB8[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
}\r
inline void bsp14()\r
{\r
SFB14[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
}\r
-inline void ent14()\r
+inline void bsp16()\r
{\r
- SFB14[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
+ SFB16[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
}\r
-inline void spc16()\r
+inline void ent8()\r
{\r
- SFB16[cp]->lit[lit].lin[cury]^=0x80>>curx;\r
+ SFB8[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
}\r
-inline void bsp16()\r
+inline void ent14()\r
{\r
- SFB16[cp]->lit[lit].lin[cury]&=~(0x80>>curx);\r
+ SFB14[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
}\r
inline void ent16()\r
{\r
SFB16[cp]->lit[lit].lin[cury]|=0x80>>curx;\r
}\r
\r
-\r
+int otw()\r
+{\r
+ question("Filename",nazwap);\r
+ return otw2();\r
+}\r
int otw2()\r
{\r
int a;\r
int c;\r
int d;\r
int NT;\r
-\r
\r
CPI=fopen(nazwap,"rb");\r
-\r
if(CPI==NULL)\r
{\r
sprintf(err,"100:No valid file at this path");\r
}\r
else\r
sprintf(err,"OK");\r
+\r
FFH=new FontFileHeader;\r
if(!FFH)\r
{\r
deleteCPI(0);\r
return 104;\r
}\r
+ \r
FIH=new FontInfoHeader;\r
if(!FIH)\r
{\r
deleteCPI(1);\r
return 105;\r
}\r
- \r
if(FIH->num_codepages==0)\r
{\r
sprintf(err,"117:No codepages");\r
return 114;\r
}\r
}\r
+ \r
fseek(CPI,CPEH[a]->cpih_offset,0);\r
CPIH[a] = new CodePageInfoHeader;\r
if(!CPIH[a])\r
deleteCPI(3,a);\r
return 115;\r
}\r
+ \r
for(b=0;b<CPIH[a]->num_fonts;++b)\r
{\r
SFH[a][b] = new ScreenFontHeader;\r
}\r
byo16[a]=1;\r
}\r
-\r
-\r
if(SFH[a][b]->height!=8&&SFH[a][b]->height!=14&&SFH[a][b]->height!=16)\r
{\r
sprintf(err,"110:Wrong height (%u) in SFH[%u][%u]",(short)(SFH[a][b]->height&0xff),a,b);\r
deleteCPI(4,a,b);\r
return 112;\r
}\r
-\r
if(SFH[a][b]->height==16)\r
{\r
SFB16[a] = new ScreenFontBitmap16;\r
offset();\r
return 0;\r
}\r
+void otw3()//\r
+{\r
+ setcolor(RED);\r
+ outtextxy(136,472,"load");\r
+ deleteCPI();\r
+ status=otw();\r
+ while(status!=0)\r
+ {\r
+ if (message("CPI file not loaded",err,2)==0)\r
+ status=otw();\r
+ else\r
+ break;\r
+ }\r
+ any=!status;\r
+ cp=0;\r
+ if(byo8[0])\r
+ wys=8;\r
+ else if(byo16[0])\r
+ wys=16;\r
+ else if(byo14[0])\r
+ wys=14;\r
+ redraw();\r
+}\r
+\r
+int zap()\r
+{\r
+ question("Filename",nazwap);\r
+ return zap2();\r
+}\r
int zap2()\r
{\r
int a;\r
int d;\r
\r
CPI=fopen(nazwap,"wb");\r
-\r
if(CPI==NULL)\r
{\r
sprintf(err,"200:Cannot create file at this path");\r
}\r
else\r
sprintf(err,"OK");\r
+ \r
fwrite(FFH,0x19,1,CPI);\r
+ \r
fseek(CPI,FFH->fih_offset,0);\r
fwrite(FIH,0x2,1,CPI);\r
+ \r
for(a=0; a<FIH->num_codepages;++a)\r
{\r
if (a!=0)\r
\r
fseek(CPI,CPEH[a]->cpih_offset,0);\r
fwrite(CPIH[a],0x6,1,CPI);\r
+ \r
for(b=0;b<CPIH[a]->num_fonts;++b)\r
{\r
fwrite(SFH[a][b],0x6,1,CPI);\r
}\r
}\r
\r
- fprintf(CPI,"\r\nTen plik zosta\88 wygenerowany za pomoc¥ Edytora napis¢w, wersja 1.2a\r\n autor programu: Balthasar Szczepaäski%c",0x1a);\r
-\r
+ fprintf(CPI,"\r\nThis file was created with the CPI editor version 1.2b",0x1a);\r
fclose(CPI);\r
return 0;\r
}\r
-\r
-int newF8(short CP)\r
+void zap3()//\r
{\r
- if(byo8[CP])\r
- {\r
- sprintf(err,"313:Height 8 already in cp%03u",CPEH[CP]->codepage);\r
- return 313;\r
- }\r
- if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
- {\r
- sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
- return 316;\r
- }\r
- if(!(SFB8[CP]=new ScreenFontBitmap8))\r
+ setcolor(RED);\r
+ outtextxy(72,472,"save");\r
+ status=zap();\r
+ while(status!=0)\r
{\r
- sprintf(err,"316:Not enough memory for SFB8[%d]",CP);\r
- delete SFH[CP][CPIH[CP]->num_fonts];\r
- SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
- return 316;\r
+ if (message("CPI file not saved",err,2)==0)\r
+ status=zap();\r
+ else\r
+ break;\r
}\r
- memset(SFB8[CP],0,0x800);\r
- byo8[CP]=1;\r
- SFH[CP][CPIH[CP]->num_fonts]->height=8;\r
- SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
- SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
- SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
- SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
- ++(CPIH[CP]->num_fonts);\r
- offset();\r
- sprintf(err,"0:OK");\r
- return 0;\r
+ redraw();\r
+ return;\r
}\r
\r
-int newF14(short CP)\r
+void use3()///\r
{\r
- if(byo14[CP])\r
- {\r
- sprintf(err,"313:Height 14 already in cp%03u",CPEH[CP]->codepage);\r
- return 313;\r
- }\r
- if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
+ setcolor(RED);\r
+ outtextxy(72,472,"save use");\r
+ status=zap();\r
+ while(status!=0)\r
{\r
- sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
- return 316;\r
+ if (message("CPI file not saved",err,2)==0)\r
+ status=zap();\r
+ else\r
+ break;\r
}\r
- if(!(SFB14[CP]=new ScreenFontBitmap14))\r
+ if(status==0)\r
{\r
- sprintf(err,"316:Not enough memory for SFB14[%d]",CP);\r
- delete SFH[CP][CPIH[CP]->num_fonts];\r
- SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
- return 316;\r
+ sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap);\r
+ puts(err);\r
+ system(err);\r
+ sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage);\r
+ puts(err);\r
+ system(err);\r
+ delay(5000);\r
+ closegraph();\r
+ initgraph(&kart16,&tryb16,"");\r
+\r
}\r
- memset(SFB14[CP],0,0xe00);\r
- byo14[CP]=1;\r
- SFH[CP][CPIH[CP]->num_fonts]->height=14;\r
- SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
- SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
- SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
- SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
- ++(CPIH[CP]->num_fonts);\r
- offset();\r
- sprintf(err,"0:OK");\r
- return 0;\r
+ redraw();\r
+ return;\r
}\r
\r
-int newF16(short CP)\r
+int zmn()\r
{\r
- if(byo16[CP])\r
- {\r
- sprintf(err,"313:Height 16 already in cp%03u",CPEH[CP]->codepage);\r
- return 313;\r
- }\r
- if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
- {\r
- sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
- return 316;\r
- }\r
- if(!(SFB16[CP]=new ScreenFontBitmap16))\r
+ short CP;\r
+ CP=question("Codepage number");\r
+ for(short i=0;i<FIH->num_codepages;++i)\r
{\r
- sprintf(err,"316:Not enough memory for SFB16[%d]",CP);\r
- delete SFH[CP][CPIH[CP]->num_fonts];\r
- SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
- return 316;\r
+ if(CP==CPEH[i]->codepage&&i!=cp)\r
+ {\r
+ sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
+ return 314;\r
+ }\r
}\r
- memset(SFB16[CP],0,0x1000);\r
- byo16[CP]=1;\r
- SFH[CP][CPIH[CP]->num_fonts]->height=16;\r
- SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
- SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
- SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
- SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
- ++(CPIH[CP]->num_fonts);\r
- sprintf(err,"0:OK");\r
- return 0;\r
+ CPEH[cp]->codepage=CP;\r
+ return 0;\r
+}\r
+void zmn3()//\r
+{\r
+ setcolor(RED);\r
+ outtextxy(256,472,"number");\r
+ status=zmn();\r
+ if(status!=0)\r
+ message("Number not changed",err);\r
+ redraw();\r
}\r
\r
-int newF2(short h)\r
+int newCPI()\r
{\r
- switch(h)\r
+ short CP,h;\r
+ char temp[51];\r
+ CP=question("First codepage number:");\r
+ h=question("Initial font height(8,14,16,all)");\r
+ if(h!=0&&h!=8&&h!=14&&h!=16)\r
{\r
- case 8:\r
- return newF8(cp);\r
- case 14:\r
- return newF14(cp);\r
- case 16:\r
- return newF16(cp);\r
- default:\r
sprintf(err,"310:Wrong height (%u)",h);\r
return 310;\r
}\r
+ return newCPI2(CP,h);\r
}\r
-int delF8(short h)\r
+int newCPI2(short CP, short h)\r
{\r
- short i;\r
- delete SFB8[cp];\r
- delete SFH[cp][h];\r
- byo8[cp]=0;\r
- --(CPIH[cp]->num_fonts);\r
- for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ int t;\r
+ FFH=new FontFileHeader;\r
+ if(!FFH)\r
{\r
- SFH[cp][i] = SFH[cp][i+1];\r
+ sprintf(err,"316:Not enough memory for FFH");\r
+ return 316;\r
}\r
- SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
- sprintf(err,"0:OK");\r
+ FFH->id0=0xFF;\r
+ strcpy(FFH->id,"FONT ");\r
+ strcpy(FFH->reserved,"\0\0\0\0\0\0\0");\r
+ FFH->pnum=1;\r
+ FFH->ptyp=1;\r
+ FIH=new FontInfoHeader;\r
+ if(!FIH)\r
+ {\r
+ sprintf(err,"316:Not enough memory for FIH");\r
+ deleteCPI(0);\r
+ return 316;\r
+ }\r
+ FIH->num_codepages=0;\r
+ t = newCP2(CP,h);\r
+ if (t!=0)\r
+ {\r
+ deleteCPI(1);\r
+ return t;\r
+ }\r
+ sprintf(err,"0:Ok");\r
return 0;\r
}\r
-int delF14(short h)\r
+void newCPI3()//\r
{\r
- short i;\r
- delete SFB14[cp];\r
- delete SFH[cp][h];\r
- byo14[cp]=0;\r
- --(CPIH[cp]->num_fonts);\r
- for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ setcolor(RED);\r
+ outtextxy(16,472,"new");\r
+ deleteCPI();\r
+ status=newCPI();\r
+ while(status!=0)\r
{\r
- SFH[cp][i] = SFH[cp][i+1];\r
+ if (message("CPI not created",err,2)==0)\r
+ status=newCPI();\r
+ else\r
+ break;\r
}\r
- SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
- sprintf(err,"0:OK");\r
- return 0;\r
+ any=!status;\r
+ if(any)\r
+ {\r
+ strcpy(nazwap,"new CPI");\r
+ cp=0;\r
+ if(byo8[0])\r
+ wys=8;\r
+ else if(byo16[0])\r
+ wys=16;\r
+ else if(byo14[0])\r
+ wys=14;\r
+ cury&=7;\r
+ }\r
+ redraw();\r
}\r
-int delF16(short h)\r
+\r
+void deleteCPI(short st,short a,short b)\r
{\r
- short i;\r
- delete SFB16[cp];\r
- delete SFH[cp][h];\r
- byo16[cp]=0;\r
- --(CPIH[cp]->num_fonts);\r
- for(i=h;i<CPIH[cp]->num_fonts;++i)\r
- {\r
- SFH[cp][i] = SFH[cp][i+1];\r
- }\r
- SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
- sprintf(err,"0:OK");\r
- return 0;\r
-}\r
-\r
-int delCP()\r
-{\r
- short i;\r
- if(FIH->num_codepages<=1)\r
- {\r
- sprintf(err,"317:Last codepage");\r
- return 317;\r
- }\r
- for(i=0;i<CPIH[cp]->num_fonts;++i)\r
+ short i,j;\r
+ switch(st)\r
{\r
- switch(SFH[cp][i]->height)\r
+ case 6:\r
+ if(FIH==NULL)\r
+ return;\r
+ a=FIH->num_codepages-1;\r
+ b=CPIH[a]->num_fonts-1;\r
+ case 5:\r
+ switch(SFH[a][b]->height)\r
{\r
- case 16:\r
- delete SFB16[cp];\r
+ case 8:\r
+ delete SFB8[a];\r
+ SFB8[a] = NULL;\r
+ byo8[a] = 0;\r
break;\r
case 14:\r
- delete SFB14[cp];\r
+ delete SFB14[a];\r
+ SFB14[a] = NULL;\r
+ byo14[a] = 0;\r
break;\r
- case 8:\r
- delete SFB8[cp];\r
+ case 16:\r
+ delete SFB16[a];\r
+ SFB16[a] = NULL;\r
+ byo16[a] = 0;\r
break;\r
- //unxh!\r
}\r
- delete SFH[cp][i];\r
- }\r
- delete CPIH[cp];\r
- delete CPEH[cp];\r
- \r
- --(FIH->num_codepages);\r
- for(i=cp;i<FIH->num_codepages;++i)\r
- {\r
- CPEH[i] = CPEH[i+1];\r
- CPIH[i] = CPIH[i+1];\r
- SFH[i][0] = SFH[i+1][0];\r
- SFH[i][1] = SFH[i+1][1];\r
- SFH[i][2] = SFH[i+1][2];\r
- SFB16[i] = SFB16[i+1];\r
- SFB14[i] = SFB14[i+1];\r
- SFB8[i] = SFB8[i+1];\r
- byo16[i] = byo16[i+1];\r
- byo14[i] = byo14[i+1];\r
- byo8[i] = byo8[i+1];\r
+ case 4:\r
+ delete SFH[a][b];\r
+ SFH[a][b] = NULL;\r
+ for(j=0;j<b;++j)\r
+ {\r
+ switch(SFH[a][j]->height)\r
+ {\r
+ case 8:\r
+ delete SFB8[a];\r
+ SFB8[a] = NULL;\r
+ byo8[a] = 0;\r
+ break;\r
+ case 14:\r
+ delete SFB14[a];\r
+ SFB14[a] = NULL;\r
+ byo14[a] = 0;\r
+ break;\r
+ case 16:\r
+ delete SFB16[a];\r
+ SFB16[a] = NULL;\r
+ byo16[a] = 0;\r
+ break;\r
+ }\r
+ delete SFH[a][j];\r
+ SFH[a][j] = NULL;\r
+ }\r
+ case 3:\r
+ delete CPIH[a];\r
+ CPIH[a] = NULL;\r
+ case 2:\r
+ delete CPEH[a];\r
+ CPEH[a] = NULL;\r
+ for(i=0;i<a;++i)\r
+ {\r
+ for(j=0;j<CPIH[i]->num_fonts;++j)\r
+ {\r
+ switch(SFH[i][j]->height)\r
+ {\r
+ case 8:\r
+ delete SFB8[i];\r
+ SFB8[i] = NULL;\r
+ byo8[i] = 0;\r
+ break;\r
+ case 14:\r
+ delete SFB14[i];\r
+ SFB14[i] = NULL;\r
+ byo14[i] = 0;\r
+ break;\r
+ case 16:\r
+ delete SFB16[i];\r
+ SFB16[i] = NULL;\r
+ byo16[i] = 0;\r
+ break;\r
+ }\r
+ delete SFH[i][j];\r
+ SFH[i][j] = NULL;\r
+ }\r
+ delete CPIH[i];\r
+ delete CPEH[i];\r
+ CPIH[i] = NULL;\r
+ CPEH[i] = NULL;\r
+ }\r
+ case 1:\r
+ delete FIH;\r
+ FIH = NULL;\r
+ case 0:\r
+ delete FFH;\r
+ FFH = NULL;\r
}\r
- CPEH[FIH->num_codepages] = NULL;\r
- CPIH[FIH->num_codepages] = NULL;\r
- SFH[FIH->num_codepages][0] = NULL;\r
- SFH[FIH->num_codepages][1] = NULL;\r
- SFH[FIH->num_codepages][2] = NULL;\r
- SFB16[FIH->num_codepages] = NULL;\r
- SFB14[FIH->num_codepages] = NULL;\r
- SFB8[FIH->num_codepages] = NULL;\r
- byo16[FIH->num_codepages] = 0;\r
- byo14[FIH->num_codepages] = 0;\r
- byo8[FIH->num_codepages] = 0;\r
-\r
- sprintf(err,"0:OK");\r
- return 0;\r
}\r
- \r
-int delF()\r
+\r
+int newCP()\r
{\r
- short h;\r
- if(CPIH[cp]->num_fonts<=1)\r
+ short CP,h;\r
+ char temp[51];\r
+ if(FIH->num_codepages>=16)\r
{\r
- sprintf(err,"315:Last font in CPIH[%u]",cp);\r
- return 315;\r
+ sprintf(err,"305:Already 16 codepages in CPI");\r
+ return 305;\r
}\r
- for(short i=0;i<CPIH[cp]->num_fonts;++i)\r
+ CP=question("Codepage number:");\r
+ for(short i=0;i<FIH->num_codepages;++i)\r
{\r
- if(SFH[cp][i]->height==wys)\r
+ if(CP==CPEH[i]->codepage)\r
{\r
- h=i;\r
- break;\r
+ sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
+ return 314;\r
}\r
}\r
- switch(wys)\r
+ h=question("Initial font height(8,14,16,all)");\r
+ if(h!=0&&h!=8&&h!=14&&h!=16)\r
{\r
- case 8:\r
- return delF8(h);\r
- case 14:\r
- return delF14(h);\r
- case 16:\r
- return delF16(h);\r
- default:\r
- sprintf(err,"510:%u WT*?",h);\r
- return 510;\r
+ sprintf(err,"310:Wrong height (%u)",h);\r
+ return 310;\r
}\r
+ return newCP2(CP,h);\r
}\r
int newCP2(short CP,short h)\r
{\r
sprintf(err,"0:OK");\r
return 0;\r
}\r
+void newCP3()//\r
+{\r
+ setcolor(RED);\r
+ outtextxy(400,472,"newCP");\r
+ status=newCP();\r
+ if(status!=0)\r
+ message("Codepage not created",err);\r
+ else\r
+ cp=FIH->num_codepages-1;\r
+ offset();\r
+ new8();\r
+ menu8();\r
\r
-int newCPI2(short CP, short h)\r
+ normCP();\r
+ return;\r
+}\r
+\r
+void normCP()//\r
{\r
- int t;\r
- FFH=new FontFileHeader;\r
- if(!FFH)\r
+ prex=curx;\r
+ prey=cury;\r
+ \r
+ if(wys==8&&byo8[cp]==0)\r
{\r
- sprintf(err,"316:Not enough memory for FFH");\r
- return 316;\r
+ if(byo14[cp]!=0)\r
+ wys=14;\r
+ else if(byo16[cp]!=0)\r
+ wys=16;\r
}\r
- FFH->id0=0xFF;\r
- strcpy(FFH->id,"FONT ");\r
- strcpy(FFH->reserved,"\0\0\0\0\0\0\0");\r
- FFH->pnum=1;\r
- FFH->ptyp=1;\r
- FIH=new FontInfoHeader;\r
- if(!FIH)\r
+ else if(wys==14&&byo14[cp]==0)\r
{\r
- sprintf(err,"316:Not enough memory for FIH");\r
- deleteCPI(0);\r
- return 316;\r
+ if(byo16[cp]!=0)\r
+ wys=16;\r
+ else if(byo8[cp]!=0)\r
+ wys=8;\r
}\r
- FIH->num_codepages=0;\r
- t = newCP2(CP,h);\r
- if (t!=0)\r
+ else if(wys==16&&byo16[cp]==0)\r
{\r
- deleteCPI(1);\r
- return t;\r
+ if(byo8[cp]!=0)\r
+ wys=8;\r
+ else if(byo14[cp]!=0)\r
+ wys=14;\r
}\r
- sprintf(err,"0:Ok");\r
+ cury&=0x7;\r
+ ramka8();\r
+ ramka14();\r
+ ramka16();\r
+ cpwys();\r
+ lin8();\r
+ lin14();\r
+ lin16();\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ \r
+ return;\r
+}\r
+void nextCP()//\r
+{\r
+ ++cp;\r
+ cp%=FIH->num_codepages;\r
+ normCP();\r
+ return;\r
+}\r
+void prevCP()//\r
+{\r
+ cp+=FIH->num_codepages-1;\r
+ cp%=FIH->num_codepages;\r
+ normCP(); \r
+ return;\r
+}\r
+\r
+int delCP()\r
+{\r
+ short i;\r
+ if(FIH->num_codepages<=1)\r
+ {\r
+ sprintf(err,"317:Last codepage");\r
+ return 317;\r
+ }\r
+ for(i=0;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ switch(SFH[cp][i]->height)\r
+ {\r
+ case 16:\r
+ delete SFB16[cp];\r
+ break;\r
+ case 14:\r
+ delete SFB14[cp];\r
+ break;\r
+ case 8:\r
+ delete SFB8[cp];\r
+ break;\r
+ }\r
+ delete SFH[cp][i];\r
+ }\r
+ delete CPIH[cp];\r
+ delete CPEH[cp];\r
+ \r
+ --(FIH->num_codepages);\r
+ for(i=cp;i<FIH->num_codepages;++i)\r
+ {\r
+ CPEH[i] = CPEH[i+1];\r
+ CPIH[i] = CPIH[i+1];\r
+ SFH[i][0] = SFH[i+1][0];\r
+ SFH[i][1] = SFH[i+1][1];\r
+ SFH[i][2] = SFH[i+1][2];\r
+ SFB16[i] = SFB16[i+1];\r
+ SFB14[i] = SFB14[i+1];\r
+ SFB8[i] = SFB8[i+1];\r
+ byo16[i] = byo16[i+1];\r
+ byo14[i] = byo14[i+1];\r
+ byo8[i] = byo8[i+1];\r
+ }\r
+ CPEH[FIH->num_codepages] = NULL;\r
+ CPIH[FIH->num_codepages] = NULL;\r
+ SFH[FIH->num_codepages][0] = NULL;\r
+ SFH[FIH->num_codepages][1] = NULL;\r
+ SFH[FIH->num_codepages][2] = NULL;\r
+ SFB16[FIH->num_codepages] = NULL;\r
+ SFB14[FIH->num_codepages] = NULL;\r
+ SFB8[FIH->num_codepages] = NULL;\r
+ byo16[FIH->num_codepages] = 0;\r
+ byo14[FIH->num_codepages] = 0;\r
+ byo8[FIH->num_codepages] = 0;\r
+\r
+ sprintf(err,"0:OK");\r
return 0;\r
}\r
+void delCP3()//\r
+{\r
+ setcolor(RED);\r
+ outtextxy(536,472,"delCP");\r
+ status=delCP();\r
+ if(status!=0)\r
+ message("Codepage not deleted",err);\r
+ offset();\r
+ cp%=FIH->num_codepages;\r
+ new8();\r
+ menu8();\r
+ normCP();\r
+ return;\r
+}\r
\r
-void displayDialog(int color,char *text,int type)\r
+int newF()\r
{\r
- gotoxy(21,13);\r
- char t1[43]="±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±";\r
- strcpy(t1+1,text);\r
- t1[strlen(t1)]='±';\r
- setcolor(BLACK);\r
- outtextxy(152,184,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");\r
- outtextxy(152,192,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");\r
- outtextxy(152,200,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");\r
- outtextxy(152,208,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ");\r
- setcolor(color);\r
- outtextxy(152,184,t1);\r
- outtextxy(152,192,"± ±");\r
- outtextxy(152,200,"± ±");\r
- switch(type)\r
+ short h;\r
+ if(CPIH[cp]->num_fonts>=3)\r
{\r
- case 2:\r
- outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±again?(y/n)±");\r
- break;\r
- case 1:\r
- outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±anykey±");\r
- break;\r
- case 0:\r
+ sprintf(err,"309:Already 3 fonts in CPIH[%u]",cp);\r
+ return 309;\r
+ }\r
+ h=question("Font height(8,14,16)");\r
+ return newF2(h);\r
+}\r
+int newF2(short h)\r
+{\r
+ switch(h)\r
+ {\r
+ case 8:\r
+ return newF8(cp);\r
+ case 14:\r
+ return newF14(cp);\r
+ case 16:\r
+ return newF16(cp);\r
default:\r
- outtextxy(152,208,"±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±");\r
- break;\r
+ sprintf(err,"310:Wrong height (%u)",h);\r
+ return 310;\r
}\r
}\r
-\r
-int message(char *text, char *value, int type)\r
+void newF3()//\r
{\r
- if (type!=2)\r
+ setcolor(RED);\r
+ outtextxy(336,472,"newF");\r
+ status=newF();\r
+ if(status!=0)\r
+ message("Font not created",err);\r
+ offset();\r
+ redraw();\r
+ return;\r
+}\r
+int newF8(short CP)\r
+{\r
+ if(byo8[CP])\r
{\r
- displayDialog(BROWN,text,1);\r
- printf("%s",value);\r
- bioskey(_KEYBRD_READ);\r
- return 0;\r
+ sprintf(err,"313:Height 8 already in cp%03u",CPEH[CP]->codepage);\r
+ return 313;\r
}\r
- else\r
+ if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
{\r
- displayDialog(BROWN,text,2);\r
- printf("%s",value);\r
- int a;\r
- for(;;)\r
- {\r
- a=bioskey(_KEYBRD_READ);\r
- if((a&0xFF)==0x59||(a&0xFF)==0x79)\r
- return 0;\r
- if((a&0xFF)==0x4e||(a&0xff)==0x6e)\r
- return 1;\r
- }\r
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
+ return 316;\r
}\r
+ if(!(SFB8[CP]=new ScreenFontBitmap8))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFB8[%d]",CP);\r
+ delete SFH[CP][CPIH[CP]->num_fonts];\r
+ SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
+ return 316;\r
+ }\r
+ memset(SFB8[CP],0,0x800);\r
+ byo8[CP]=1;\r
+ SFH[CP][CPIH[CP]->num_fonts]->height=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
+ ++(CPIH[CP]->num_fonts);\r
+ offset();\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
-\r
-inline void question(char *text, char *result)\r
+int newF14(short CP)\r
{\r
- displayDialog(GREEN,text);\r
- scanf("%s",result);\r
+ if(byo14[CP])\r
+ {\r
+ sprintf(err,"313:Height 14 already in cp%03u",CPEH[CP]->codepage);\r
+ return 313;\r
+ }\r
+ if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
+ return 316;\r
+ }\r
+ if(!(SFB14[CP]=new ScreenFontBitmap14))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFB14[%d]",CP);\r
+ delete SFH[CP][CPIH[CP]->num_fonts];\r
+ SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
+ return 316;\r
+ }\r
+ memset(SFB14[CP],0,0xe00);\r
+ byo14[CP]=1;\r
+ SFH[CP][CPIH[CP]->num_fonts]->height=14;\r
+ SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
+ ++(CPIH[CP]->num_fonts);\r
+ offset();\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
-\r
-inline unsigned question(char *text)\r
+int newF16(short CP)\r
{\r
- char temp[256];\r
- question(text,temp);\r
- return atoi(temp);\r
+ if(byo16[CP])\r
+ {\r
+ sprintf(err,"313:Height 16 already in cp%03u",CPEH[CP]->codepage);\r
+ return 313;\r
+ }\r
+ if(!(SFH[CP][CPIH[CP]->num_fonts]=new ScreenFontHeader))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFH[%d][%d]",CP,CPIH[CP]->num_fonts);\r
+ return 316;\r
+ }\r
+ if(!(SFB16[CP]=new ScreenFontBitmap16))\r
+ {\r
+ sprintf(err,"316:Not enough memory for SFB16[%d]",CP);\r
+ delete SFH[CP][CPIH[CP]->num_fonts];\r
+ SFH[CP][CPIH[CP]->num_fonts] = NULL;\r
+ return 316;\r
+ }\r
+ memset(SFB16[CP],0,0x1000);\r
+ byo16[CP]=1;\r
+ SFH[CP][CPIH[CP]->num_fonts]->height=16;\r
+ SFH[CP][CPIH[CP]->num_fonts]->width=8;\r
+ SFH[CP][CPIH[CP]->num_fonts]->yaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->xaspect=0;\r
+ SFH[CP][CPIH[CP]->num_fonts]->num_chars=256;\r
+ ++(CPIH[CP]->num_fonts);\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
\r
-int newCPI()\r
+void prevF()//\r
{\r
- short CP,h;\r
- char temp[51];\r
- CP=question("First codepage number:");\r
- h=question("Initial font height(8,14,16,all)");\r
- if(h!=0&&h!=8&&h!=14&&h!=16)\r
+ prex=curx;\r
+ prey=cury;\r
+ switch(wys)\r
+ {\r
+ case 8:\r
+ if (byo16[cp]!=0)\r
+ {\r
+ wys=16;\r
+ lin16(1);\r
+ lit16(1);\r
+ ramka16();\r
+ }\r
+ else if(byo14[cp]!=0)\r
+ {\r
+ wys=14;\r
+ lin14(1);\r
+ lit14(1);\r
+ ramka14();\r
+ }\r
+ lin8(1);\r
+ lit8(1);\r
+ ramka8();\r
+ break;\r
+ case 14:\r
+ if (byo8[cp]!=0)\r
+ {\r
+ wys=8;\r
+ cury%=8;\r
+ lin8(1);\r
+ lit8(2);\r
+ ramka8();\r
+ }\r
+ else if(byo16[cp]!=0)\r
+ {\r
+ wys=16;\r
+ lin16(1);\r
+ lit16(1);\r
+ ramka16();\r
+ }\r
+ lin14(1);\r
+ lit14(2);\r
+ ramka14();\r
+ break;\r
+ case 16:\r
+ if (byo14[cp]!=0)\r
+ {\r
+ wys=14;\r
+ cury%=14;\r
+ lin14(1);\r
+ lit14(2);\r
+ ramka14();\r
+ }\r
+ else if(byo8[cp]!=0)\r
+ {\r
+ wys=8;\r
+ cury%=8;\r
+ lin8(1);\r
+ lit8(2);\r
+ ramka8();\r
+ }\r
+ lin16(1);\r
+ lit16(2);\r
+ ramka16();\r
+ break;\r
+ }\r
+ cpwys();\r
+ return;\r
+}\r
+void nextF()//\r
+{\r
+ prex=curx;\r
+ prey=cury;\r
+ switch(wys)\r
{\r
- sprintf(err,"310:Wrong height (%u)",h);\r
- return 310;\r
+ case 8:\r
+ if(byo14[cp]!=0)\r
+ {\r
+ wys=14;\r
+ lin14(1);\r
+ lit14(1);\r
+ ramka14();\r
+ }\r
+ else if (byo16[cp]!=0)\r
+ {\r
+ wys=16;\r
+ lin16(1);\r
+ lit16(1);\r
+ ramka16();\r
+ }\r
+ lin8(1);\r
+ lit8(1);\r
+ ramka8();\r
+ break;\r
+ case 14:\r
+ if(byo16[cp]!=0)\r
+ {\r
+ wys=16;\r
+ lin16(1);\r
+ lit16(1);\r
+ ramka16();\r
+ }\r
+ else if (byo8[cp]!=0)\r
+ {\r
+ wys=8;\r
+ cury%=8;\r
+ lin8(1);\r
+ lit8(2);\r
+ ramka8();\r
+ }\r
+ lin14(1);\r
+ lit14(2);\r
+ ramka14();\r
+ break;\r
+ case 16:\r
+ if(byo8[cp]!=0)\r
+ {\r
+ wys=8;\r
+ cury%=8;\r
+ lin8(1);\r
+ lit8(2);\r
+ ramka8();\r
+ }\r
+ else if (byo14[cp]!=0)\r
+ {\r
+ wys=14;\r
+ cury%=14;\r
+ lin14(1);\r
+ lit14(2);\r
+ ramka14();\r
+ }\r
+ lin16(1);\r
+ lit16(2);\r
+ ramka16();\r
+ break;\r
}\r
- return newCPI2(CP,h);\r
+ cpwys();\r
+ return;\r
}\r
- \r
-int newCP()\r
+\r
+int delF()\r
{\r
- short CP,h;\r
- char temp[51];\r
- if(FIH->num_codepages>=16)\r
+ short h;\r
+ if(CPIH[cp]->num_fonts<=1)\r
{\r
- sprintf(err,"305:Already 16 codepages in CPI");\r
- return 305;\r
+ sprintf(err,"315:Last font in CPIH[%u]",cp);\r
+ return 315;\r
}\r
- CP=question("Codepage number:");\r
- for(short i=0;i<FIH->num_codepages;++i)\r
+ for(short i=0;i<CPIH[cp]->num_fonts;++i)\r
{\r
- if(CP==CPEH[i]->codepage)\r
+ if(SFH[cp][i]->height==wys)\r
{\r
- sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
- return 314;\r
+ h=i;\r
+ break;\r
}\r
}\r
- h=question("Initial font height(8,14,16,all)");\r
- if(h!=0&&h!=8&&h!=14&&h!=16)\r
+ switch(wys)\r
{\r
- sprintf(err,"310:Wrong height (%u)",h);\r
- return 310;\r
+ case 8:\r
+ return delF8(h);\r
+ case 14:\r
+ return delF14(h);\r
+ case 16:\r
+ return delF16(h);\r
+ default:\r
+ sprintf(err,"510:%u WT*?",h);\r
+ return 510;\r
}\r
- return newCP2(CP,h);\r
}\r
-int newF()\r
+void delF3()//\r
{\r
- short h;\r
- if(CPIH[cp]->num_fonts>=3)\r
- {\r
- sprintf(err,"309:Already 3 fonts in CPIH[%u]",cp);\r
- return 309;\r
- }\r
- h=question("Font height(8,14,16)");\r
- return newF2(h);\r
+ setcolor(RED);\r
+ outtextxy(472,472,"delF");\r
+ status=delF();\r
+ if(status!=0)\r
+ message("Font not deleted",err);\r
+ offset();\r
+ new8();\r
+ menu8();\r
+ normCP();\r
+ return;\r
}\r
-\r
-int otw()\r
+int delF8(short h)\r
{\r
- question("Filename",nazwap);\r
- return otw2();\r
+ short i;\r
+ delete SFB8[cp];\r
+ delete SFH[cp][h];\r
+ byo8[cp]=0;\r
+ --(CPIH[cp]->num_fonts);\r
+ for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ SFH[cp][i] = SFH[cp][i+1];\r
+ }\r
+ SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
-\r
-int zap()\r
+int delF14(short h)\r
{\r
- question("Filename",nazwap);\r
- return zap2();\r
+ short i;\r
+ delete SFB14[cp];\r
+ delete SFH[cp][h];\r
+ byo14[cp]=0;\r
+ --(CPIH[cp]->num_fonts);\r
+ for(i=h;i<CPIH[cp]->num_fonts;++i)\r
+ {\r
+ SFH[cp][i] = SFH[cp][i+1];\r
+ }\r
+ SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
-int zmn()\r
+int delF16(short h)\r
{\r
- short CP;\r
- CP=question("Codepage number");\r
- for(short i=0;i<FIH->num_codepages;++i)\r
+ short i;\r
+ delete SFB16[cp];\r
+ delete SFH[cp][h];\r
+ byo16[cp]=0;\r
+ --(CPIH[cp]->num_fonts);\r
+ for(i=h;i<CPIH[cp]->num_fonts;++i)\r
{\r
- if(CP==CPEH[i]->codepage&&i!=cp)\r
- {\r
- sprintf(err,"314:cp%03u already in CPEH[%u]",CP,i);\r
- return 314;\r
- }\r
+ SFH[cp][i] = SFH[cp][i+1];\r
}\r
- CPEH[cp]->codepage=CP;\r
- return 0;\r
+ SFH[cp][CPIH[cp]->num_fonts] = NULL;\r
+ sprintf(err,"0:OK");\r
+ return 0;\r
}\r
\r
+\r
int main(int argc,char* argv[])\r
{\r
nullpointers();\r
wys=16;\r
else if(byo14[0])\r
wys=14;\r
+ redraw();\r
\r
-\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- lin8();\r
- lin14();\r
- lin16();\r
-\r
- //iR.x.ax=0x1;\r
- //int86(0x33,&iR,&oR);\r
- //iR.x.cx=0x01;\r
- //iR.x.ax=0x0c;\r
- //iR.x.dx=FP_OFF(inth);\r
- //sR.es=FP_SEG(inth);\r
- //int86x(0x33,&iR,&oR,&sR);\r
maus=setMaus();\r
if(maus)\r
showMaus();\r
}\r
}\r
if((key&0xFF00)==0x4d00&&any)\r
- {\r
- //w prawo l\r
- pre=lit;\r
- ++lit;\r
- lit&=0xFF;\r
- lit8();\r
- lit14();\r
- lit16();\r
- switch(wys)\r
- {\r
- case 8:\r
- lin8(2);\r
- break;\r
- case 14:\r
- lin14(2);\r
- break;\r
- case 16:\r
- lin16(2);\r
- break;\r
- }\r
- }\r
- }\r
- if ((key&0xFF00)==0x0f00&&any)\r
- {\r
- //tab\r
- if(!tab)\r
- tab=1;\r
- else\r
- tab=0;\r
- switch(wys)\r
- {\r
- case 8:\r
- ramka8();\r
- break;\r
- case 14:\r
- ramka14();\r
- break;\r
- case 16:\r
- ramka16();\r
- break;\r
- }\r
- }\r
- if ((key&0xFF00)==0x5100&&any)\r
- {\r
- //cp++\r
- ++cp;\r
- cp%=FIH->num_codepages;\r
- prex=curx;\r
- prey=cury;\r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
- \r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- cpwys();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- \r
- }\r
- if ((key&0xFF00)==0x4900&&any)\r
- {\r
- //cp--\r
- cp+=FIH->num_codepages-1;\r
- cp%=FIH->num_codepages;\r
- \r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
-\r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- cpwys();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
-\r
- }\r
- if ((key&0xFF00)==0x4700&&any)\r
- {\r
- //wys--\r
- prex=curx;\r
- prey=cury;\r
- switch(wys)\r
- {\r
- case 8:\r
- if (byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- else if(byo14[cp]!=0)\r
- {\r
- wys=14;\r
- lin14(1);\r
- lit14(1);\r
- ramka14();\r
- }\r
- lin8(1);\r
- lit8(1);\r
- ramka8();\r
- break;\r
- case 14:\r
- if (byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- else if(byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- lin14(1);\r
- lit14(2);\r
- ramka14();\r
- break;\r
- case 16:\r
- if (byo14[cp]!=0)\r
- {\r
- wys=14;\r
- cury%=14;\r
- lin14(1);\r
- lit14(2);\r
- ramka14();\r
- }\r
- else if(byo8[cp]!=0)\r
+ {\r
+ //w prawo l\r
+ pre=lit;\r
+ ++lit;\r
+ lit&=0xFF;\r
+ lit8();\r
+ lit14();\r
+ lit16();\r
+ switch(wys)\r
{\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
+ case 8:\r
+ lin8(2);\r
+ break;\r
+ case 14:\r
+ lin14(2);\r
+ break;\r
+ case 16:\r
+ lin16(2);\r
+ break;\r
}\r
- lin16(1);\r
- lit16(2);\r
- ramka16();\r
- break;\r
}\r
- cpwys();\r
}\r
- if ((key&0xFF00)==0x4f00&&any)\r
+ if ((key&0xFF00)==0x0f00&&any)\r
{\r
- //wys++\r
- prex=curx;\r
- prey=cury;\r
+ //tab\r
+ if(!tab)\r
+ tab=1;\r
+ else\r
+ tab=0;\r
switch(wys)\r
{\r
case 8:\r
- if(byo14[cp]!=0)\r
- {\r
- wys=14;\r
- lin14(1);\r
- lit14(1);\r
- ramka14();\r
- }\r
- else if (byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- lin8(1);\r
- lit8(1);\r
ramka8();\r
break;\r
case 14:\r
- if(byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- else if (byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- lin14(1);\r
- lit14(2);\r
ramka14();\r
break;\r
case 16:\r
- if(byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- else if (byo14[cp]!=0)\r
- {\r
- wys=14;\r
- cury%=14;\r
- lin14(1);\r
- lit14(2);\r
- ramka14();\r
- }\r
- lin16(1);\r
- lit16(2);\r
ramka16();\r
break;\r
}\r
- cpwys();\r
}\r
- \r
+ if ((key&0xFF00)==0x5100&&any)\r
+ {\r
+ nextCP();\r
+ }\r
+ if ((key&0xFF00)==0x4900&&any)\r
+ {\r
+ prevCP();\r
+ }\r
+ if ((key&0xFF00)==0x4700&&any)\r
+ {\r
+ prevF();\r
+ }\r
+ if ((key&0xFF00)==0x4f00&&any)\r
+ {\r
+ nextF();\r
+ }\r
if ((key&0xFF00)==0x3b00)\r
{\r
- //new CPI\r
- setcolor(RED);\r
- outtextxy(16,472,"new");\r
- deleteCPI();\r
- status=newCPI();\r
- while(status!=0)\r
- {\r
- if (message("CPI not created",err,2)==0)\r
- status=newCPI();\r
- else\r
- {\r
- break;\r
- //closegraph();\r
- //deleteCPI();\r
- //return status;\r
- }\r
- }\r
- any=!status;\r
- if(any)\r
- {\r
- strcpy(nazwap,"new CPI");\r
- cp=0;\r
- if(byo8[0])\r
- wys=8;\r
- else if(byo16[0])\r
- wys=16;\r
- else if(byo14[0])\r
- wys=14;\r
- cury%=8;\r
- }\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- \r
+ newCPI3(); \r
}\r
if ((key&0xFF00)==0x3c00&&any)\r
{\r
- //zapisz\r
- setcolor(RED);\r
- outtextxy(72,472,"save");\r
- status=zap();\r
- while(status!=0)\r
- {\r
- if (message("CPI file not saved",err,2)==0)\r
- status=zap();\r
- else\r
- break;\r
- }\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- cury%=8;\r
-\r
-\r
+ zap3();\r
}\r
-\r
-\r
if ((key&0xFF00)==0x3d00)\r
{\r
- //wczytaj\r
- setcolor(RED);\r
- outtextxy(136,472,"load");\r
- deleteCPI();\r
- status=otw();\r
- while(status!=0)\r
- {\r
- if (message("CPI file not loaded",err,2)==0)\r
- status=otw();\r
- else\r
- break;\r
- }\r
- any=!status;\r
- cp=0;\r
- if(byo8[0])\r
- wys=8;\r
- else if(byo16[0])\r
- wys=16;\r
- else if(byo14[0])\r
- wys=14;\r
- cury%=8;\r
-\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
-\r
+ otw3();\r
}\r
if((key&0xFF00)==0x3e00&&any)\r
{\r
- \r
- //zapisz+system\r
- setcolor(RED);\r
- outtextxy(72,472,"save use");\r
- status=zap();\r
- while(status!=0)\r
- {\r
- if (message("CPI file not saved",err,2)==0)\r
- status=zap();\r
- else\r
- break;\r
- }\r
- if(status==0)\r
- {\r
- sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap);\r
- puts(err);\r
- system(err);\r
- sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage);\r
- puts(err);\r
- system(err);\r
- delay(5000);\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
-\r
- }\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- cury%=8;\r
-\r
+ use3();\r
}\r
if ((key&0xFF00)==0x3f00&&any)\r
{\r
- //zmiana numeru\r
- setcolor(RED);\r
- outtextxy(256,472,"number");\r
- status=zmn();\r
- if(status!=0)\r
- message("Number not changed",err);\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ zmn3();\r
}\r
if ((key&0xFF00)==0x4000&&any)\r
{\r
- //new font\r
- setcolor(RED);\r
- outtextxy(336,472,"newF");\r
- status=newF();\r
- if(status!=0)\r
- message("Fonr not created",err);\r
- offset();\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- \r
+ newF3();\r
}\r
if ((key&0xFF00)==0x4100&&any)\r
{\r
- //new CP\r
- setcolor(RED);\r
- outtextxy(400,472,"newCP");\r
- status=newCP();\r
- if(status!=0)\r
- message("Codepage not created",err);\r
- else\r
- cp=FIH->num_codepages-1;\r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
- \r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- offset();\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- \r
+ newCP3();\r
}\r
if ((key&0xFF00)==0x4200&&any)\r
{\r
- //delete font\r
- setcolor(RED);\r
- outtextxy(472,472,"delF");\r
- status=delF();\r
- if(status!=0)\r
- message("Font not deleted",err);\r
- offset();\r
-\r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
- \r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
- \r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- \r
+ delF3();\r
}\r
if ((key&0xFF00)==0x4300&&any)\r
{\r
- //delete CP\r
- setcolor(RED);\r
- outtextxy(536,472,"delCP");\r
- status=delCP();\r
- if(status!=0)\r
- message("Codepage not deleted",err);\r
- offset();\r
- \r
- cp%=FIH->num_codepages;\r
- \r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
-\r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
-\r
+ delCP3();\r
}\r
if ((key&0xFF00)==0x4400)\r
{\r
lit8(1);\r
lit16(1);\r
lin8(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(1);\r
lit8(1);\r
lit14(1);\r
lin8(1);\r
+ cpwys();\r
break;\r
}\r
if(klik)\r
lit8(1);\r
lit16(2);\r
lin8(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(2);\r
lit8(1);\r
lit14(2);\r
lin8(1);\r
+ cpwys();\r
break;\r
case 8:\r
lit8(2);\r
}\r
}\r
\r
- else if(any&&mausx>=16&&mausx<144&&mausy>=223&&mausy<447&&byo14[cp])\r
+ else if(any&&mausx>=16&&mausx<144&&mausy>=224&&mausy<448&&byo14[cp])\r
{\r
hideMaus();\r
mausv=0;\r
prex=curx;\r
prey=cury;\r
curx=(mausx-16)/16;\r
- cury=(mausy-223)/16;\r
+ cury=(mausy-224)/16;\r
wys=14;\r
tab=0;\r
if(klik)\r
lit14(1);\r
lit16(1);\r
lin14(1);\r
+ cpwys();\r
break;\r
case 8:\r
lin8(1);\r
lit14(1);\r
lit8(1);\r
lin14(1);\r
+ cpwys();\r
break;\r
}\r
if(klik)\r
lit14(1);\r
lit16(2);\r
lin14(1);\r
+ cpwys();\r
break;\r
case 8:\r
lin8(2);\r
lit14(1);\r
lit8(2);\r
lin14(1);\r
+ cpwys();\r
break;\r
case 14:\r
lit14(2);\r
}\r
}\r
\r
- else if(any&&mausx>=336&&mausx<464&&mausy>=111&&mausy<367&&byo16[cp])\r
+ else if(any&&mausx>=336&&mausx<464&&mausy>=112&&mausy<368&&byo16[cp])\r
{\r
hideMaus();\r
mausv=0;\r
prex=curx;\r
prey=cury;\r
curx=(mausx-336)/16;\r
- cury=(mausy-111)/16;\r
+ cury=(mausy-112)/16;\r
wys=16;\r
tab=0;\r
if(klik)\r
lit16(1);\r
lit8(1);\r
lin16(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(1);\r
lit16(1);\r
lit14(1);\r
lin16(1);\r
+ cpwys();\r
break;\r
}\r
if(klik)\r
lit16(1);\r
lit8(2);\r
lin16(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(2);\r
lit16(1);\r
lit14(2);\r
lin16(1);\r
+ cpwys();\r
break;\r
case 16:\r
lit16(2);\r
pre=lit;\r
pret=tab;\r
wys=8;\r
+ cury&=0x7;\r
tab=1;\r
lit=((mausy-32)/8)*16+((mausx-176)/8);\r
if (pre==lit)\r
lit16(1);\r
lin8(1);\r
lit8(1);\r
+ cpwys();\r
break;\r
case 14:\r
ramka14();\r
lit14(1);\r
lin8(1);\r
lit8(1);\r
+ cpwys();\r
break;\r
case 8:\r
if(!pret)\r
ramka16();\r
ramka8();\r
lin8(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(2);\r
ramka14();\r
ramka8();\r
lin8(1);\r
+ cpwys();\r
break;\r
case 8:\r
lin8(2);\r
}\r
}\r
\r
- else if(any&&klik&&mausx>=176&&mausx<304&&mausy>=223&&mausy<447&&byo14[cp])\r
+ else if(any&&klik&&mausx>=176&&mausx<304&&mausy>=224&&mausy<448&&byo14[cp])\r
{\r
hideMaus();\r
mausv=0;\r
pre=lit;\r
pret=tab;\r
wys=14;\r
+ cury%=14;\r
tab=1;\r
- lit=((mausy-223)/14)*16+((mausx-176)/8);\r
+ lit=((mausy-224)/14)*16+((mausx-176)/8);\r
if (pre==lit)\r
{\r
switch(prew)\r
lit16(1);\r
lin14(1);\r
lit14(1);\r
+ cpwys();\r
break;\r
case 8:\r
ramka8();\r
lit8(1);\r
lin14(1);\r
lit14(1);\r
+ cpwys();\r
break;\r
case 14:\r
if(!pret)\r
ramka16();\r
ramka14();\r
lin14(1);\r
+ cpwys();\r
break;\r
case 8:\r
lin8(2);\r
ramka8();\r
ramka14();\r
lin14(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(2);\r
}\r
}\r
\r
- else if(any&&klik&&mausx>=496&&mausx<624&&mausy>=111&&mausy<367&&byo16[cp])\r
+ else if(any&&klik&&mausx>=496&&mausx<624&&mausy>=112&&mausy<368&&byo16[cp])\r
{\r
hideMaus();\r
mausv=0;\r
pre=lit;\r
pret=tab;\r
wys=16;\r
+ cury&=0xf;\r
tab=1;\r
lit=((mausy-111)/16)*16+((mausx-496)/8);\r
if (pre==lit)\r
lit8(1);\r
lin16(1);\r
lit16(1);\r
+ cpwys();\r
break;\r
case 14:\r
ramka14();\r
lit14(1);\r
lin16(1);\r
lit16(1);\r
+ cpwys();\r
break;\r
case 16:\r
if(!pret)\r
ramka8();\r
ramka16();\r
lin16(1);\r
+ cpwys();\r
break;\r
case 14:\r
lin14(2);\r
ramka14();\r
ramka16();\r
lin16(1);\r
+ cpwys();\r
break;\r
case 16:\r
lin16(2);\r
{\r
hideMaus();\r
mausv=0;\r
- //cp+-\r
if(klik&0x01)\r
- ++cp;\r
+ nextCP();\r
else\r
- cp+=FIH->num_codepages-1;\r
- cp%=FIH->num_codepages;\r
- prex=curx;\r
- prey=cury;\r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
- \r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- cpwys();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ prevCP();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=192&&mausx<224&&mausy<8)\r
{\r
hideMaus();\r
mausv=0;\r
- //wys+-\r
- prex=curx;\r
- prey=cury;\r
- switch(wys)\r
- {\r
- case 8:\r
- if(klik&0x1)\r
- {\r
- if(byo14[cp]!=0)\r
- { \r
- wys=14;\r
- lin14(1);\r
- lit14(1);\r
- ramka14();\r
- }\r
- else if (byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- }\r
- else\r
- {\r
- if (byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- else if(byo14[cp]!=0)\r
- { \r
- wys=14;\r
- lin14(1);\r
- lit14(1);\r
- ramka14();\r
- }\r
- }\r
- lin8(1);\r
- lit8(1);\r
- ramka8();\r
- break;\r
- case 14:\r
- if(klik&0x1)\r
- {\r
- if(byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- else if (byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- }\r
- else\r
- {\r
- if (byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- else if(byo16[cp]!=0)\r
- {\r
- wys=16;\r
- lin16(1);\r
- lit16(1);\r
- ramka16();\r
- }\r
- }\r
- lin14(1);\r
- lit14(2);\r
- ramka14();\r
- break;\r
- case 16:\r
- if(klik&0x1)\r
- {\r
- if(byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- else if (byo14[cp]!=0)\r
- {\r
- wys=14;\r
- cury%=14;\r
- lin14(1);\r
- lit14(2);\r
- ramka14();\r
- }\r
- }\r
- else\r
- {\r
- if (byo14[cp]!=0)\r
- {\r
- wys=14;\r
- cury%=14;\r
- lin14(1);\r
- lit14(2);\r
- ramka14();\r
- }\r
- else if(byo8[cp]!=0)\r
- {\r
- wys=8;\r
- cury%=8;\r
- lin8(1);\r
- lit8(2);\r
- ramka8();\r
- }\r
- }\r
- lin16(1);\r
- lit16(2);\r
- ramka16();\r
- break;\r
- }\r
- cpwys();\r
+ if(klik&0x01)\r
+ nextF();\r
+ else\r
+ prevF();\r
}\r
\r
else if(klik&&!prek&&mausx<40&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //new CPI\r
- setcolor(RED);\r
- outtextxy(16,472,"new");\r
- deleteCPI();\r
- status=newCPI();\r
- while(status!=0)\r
- {\r
- if (message("CPI not created",err,2)==0)\r
- status=newCPI();\r
- else\r
- break;\r
- }\r
- any=!status;\r
- if(any)\r
- {\r
- strcpy(nazwap,"new CPI");\r
- cp=0;\r
- if(byo8[0])\r
- wys=8;\r
- else if(byo16[0])\r
- wys=16;\r
- else if(byo14[0])\r
- wys=14;\r
- cury%=8;\r
- }\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ newCPI3();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=56&&mausx<104&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //save CPI\r
- setcolor(RED);\r
- outtextxy(72,472,"save");\r
- status=zap();\r
- while(status!=0)\r
- {\r
- if (message("CPI file not saved",err,2)==0)\r
- status=zap();\r
- else\r
- break;\r
- }\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- cury%=8;\r
+ zap3();\r
}\r
\r
else if(klik&&!prek&&mausx>=120&&mausx<168&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //load CPI\r
- setcolor(RED);\r
- outtextxy(136,472,"load");\r
- deleteCPI();\r
- status=otw();\r
- while(status!=0)\r
- {\r
- if (message("CPI file not loaded",err,2)==0)\r
- status=otw();\r
- else\r
- break;\r
- }\r
- any=!status;\r
- cp=0;\r
- if(byo8[0])\r
- wys=8;\r
- else if(byo16[0])\r
- wys=16;\r
- else if(byo14[0])\r
- wys=14;\r
- cury%=8;\r
-\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ otw3();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=184&&mausx<224&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //save & use CPI\r
- setcolor(RED);\r
- outtextxy(72,472,"save use");\r
- status=zap();\r
- while(status!=0)\r
- {\r
- if (message("CPI file not saved",err,2)==0)\r
- status=zap();\r
- else\r
- break;\r
- }\r
- if(status==0)\r
- {\r
- sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap);\r
- puts(err);\r
- system(err);\r
- sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage);\r
- puts(err);\r
- system(err);\r
- delay(5000);\r
- closegraph();\r
- initgraph(&kart16,&tryb16,"");\r
-\r
- }\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
- cury%=8;\r
-\r
+ use3();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=240&&mausx<304&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //change CP #\r
- setcolor(RED);\r
- outtextxy(256,472,"number");\r
- status=zmn();\r
- if(status!=0)\r
- message("Number not changed",err);\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ zmn3();\r
}\r
\r
\r
{\r
hideMaus();\r
mausv=0;\r
- //new font\r
- setcolor(RED);\r
- outtextxy(336,472,"newF");\r
- status=newF();\r
- if(status!=0)\r
- message("Fonr not created",err);\r
- offset();\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ newF3();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=384&&mausx<440&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //new CP\r
- setcolor(RED);\r
- outtextxy(400,472,"newCP");\r
- status=newCP();\r
- if(status!=0)\r
- message("Codepage not created",err);\r
- else\r
- cp=FIH->num_codepages-1;\r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
- \r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- offset();\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ newCP3();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=456&&mausx<504&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //delete font\r
- setcolor(RED);\r
- outtextxy(472,472,"delF");\r
- status=delF();\r
- if(status!=0)\r
- message("Font not deleted",err);\r
- offset();\r
-\r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
- \r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
- \r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ delF3();\r
}\r
\r
else if(any&&klik&&!prek&&mausx>=520&&mausx<576&&mausy>=472)\r
{\r
hideMaus();\r
mausv=0;\r
- //delete CP\r
- setcolor(RED);\r
- outtextxy(536,472,"delCP");\r
- status=delCP();\r
- if(status!=0)\r
- message("Codepage not deleted",err);\r
- offset();\r
- \r
- cp%=FIH->num_codepages;\r
- \r
- if(wys==8&&byo8[cp]==0)\r
- {\r
- if(byo14[cp]!=0)\r
- wys=14;\r
- else if(byo16[cp]!=0)\r
- wys=16;\r
- }\r
-\r
- else if(wys==14&&byo14[cp]==0)\r
- {\r
- if(byo16[cp]!=0)\r
- wys=16;\r
- else if(byo8[cp]!=0)\r
- wys=8;\r
- }\r
-\r
- else if(wys==16&&byo16[cp]==0)\r
- {\r
- if(byo8[cp]!=0)\r
- wys=8;\r
- else if(byo14[cp]!=0)\r
- wys=14;\r
- }\r
- cury&=0x7;\r
- new8();\r
- menu8();\r
- cpwys();\r
- ramka8();\r
- ramka14();\r
- ramka16();\r
- lin8();\r
- lin14();\r
- lin16();\r
- lit8();\r
- lit14();\r
- lit16();\r
+ delCP3();\r
}\r
\r
else if(klik&&!prek&&mausx>=592&&mausy>=472)\r