1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-03-12 16:42:08 +00:00

14 Commits
v2.1 ... ver-1

Author SHA1 Message Date
David Schmenk
7aaba1f9ef Update notes to 1.2 2018-05-11 06:17:28 -07:00
David Schmenk
a61da48e5d Update README.md 2018-05-11 06:16:07 -07:00
David Schmenk
45489b3ab8 Update image 2018-05-07 12:41:06 -07:00
David Schmenk
81e40c4c7f Fix unhandled IRQ on IIGS 2018-05-07 10:23:31 -07:00
David Schmenk
6ff3cc2673 Update images 2018-05-02 18:26:37 -07:00
David Schmenk
f964099c24 Stop continuous events when mouse button pressed 2018-05-02 13:27:58 -07:00
David Schmenk
54ecb3eec7 Generate mouse event on button state change 2018-05-02 13:18:00 -07:00
David Schmenk
bb97fe6353 Fix infunc for asm defs 2018-05-01 07:39:51 -07:00
David Schmenk
9e441de1c2 Version 1.2 with IRQ fixes and mouse module 2018-04-29 19:13:03 -07:00
David Schmenk
3d337f4fa8 Change TFTPD text file EOL strategy 2018-04-29 14:50:39 -07:00
David Schmenk
15e4013f97 Fix tftp xlte bug when writing text files. Bunp version 2018-04-29 07:25:43 -07:00
David Schmenk
5f1656b6a1 Backport some fixes from V2 2018-04-27 14:10:26 -07:00
David Schmenk
9809c2b5b2 Add TFTPD to release 1 2018-04-23 13:47:42 -07:00
David Schmenk
c0ddb5d197 Add TFTPD to release 1 2018-04-23 13:46:08 -07:00
206 changed files with 8014 additions and 34823 deletions

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2010-2022 David Schmenk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

674
LICENSE.txt Executable file
View File

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

BIN
PLASMA-BLD1.PO Normal file

Binary file not shown.

BIN
PLASMA-SYS1.PO Normal file

Binary file not shown.

268
README.md
View File

@@ -1,19 +1,3 @@
# 2/15/2024 PLASMA 2.1 Available!
[Download and read the Release Notes](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.1.md)
[Change List](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.1.md#changes-in-plasma-for-21-release)
[Get single boot floppy for FORTH for PLASMA 2.1](https://github.com/dschmenk/PLASMA/blob/master/doc/PLFORTH.md)
# 3/24/2023 PLASMA 2.0 Available!
Only 5 years in the making!
[Download and read the Release Notes](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.0.md)
[Change List](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%202.0.md#changes-in-plasma-for-20-release)
# 4/29/2018 PLASMA 1.2 Available!
[Download and read the Release Notes](https://github.com/dschmenk/PLASMA/blob/master/doc/Version%201.2.md)
@@ -22,7 +6,7 @@ Only 5 years in the making!
![Luc Viatour](https://upload.wikimedia.org/wikipedia/commons/thumb/2/26/Plasma-lamp_2.jpg/1200px-Plasma-lamp_2.jpg)
image credit: Luc Viatour / www.Lucnix.be
PLASMA: **P**roto **L**anguage **A**s**S**e**M**bler for **A**ll
PLASMA: **P**roto **L**anguage **A**s**S**e**M**bler for **A**pple
PLASMA is a medium level programming language targeting the 8-bit 6502 processor. Historically, there were simple languages developed in the early years of computers that improved on the tedium of assembly language programming while still being low level enough for system coding. Languages like B, FORTH, and PLASMA fall into this category.
@@ -34,90 +18,86 @@ Different projects have led to the architecture of PLASMA, most notably Apple Pa
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
- [3/24/2023 PLASMA 2.0 Available!](#3242023-plasma-20-available)
- [4/29/2018 PLASMA 1.2 Available!](#4292018-plasma-12-available)
- [The PLASMA Programming Language](#the-plasma-programming-language)
- [Contents](#contents)
- [Build Environment](#build-environment)
- [PLASMA Cross-Compiler](#plasma-cross-compiler)
- [acme Cross-Assembler](#acme-cross-assembler)
- [PLASMA Source](#plasma-source)
- [Portable VM](#portable-vm)
- [Target VM](#target-vm)
- [PLASMA Target Hosted Compiler](#plasma-target-hosted-compiler)
- [Portable VM](#portable-vm)
- [Target VM](#target-vm)
- [Tutorial](#tutorial)
- [PLASMA Compiler/Assembler](#plasma-compilerassembler)
- [PLASMA Modules](#plasma-modules)
- [Data Types](#data-types)
- [Obligatory 'Hello World'](#obligatory-hello-world)
- [Character Case](#character-case)
- [Comments](#comments)
- [Numbers](#numbers)
- [Characters](#characters)
- [Strings](#strings)
- [Organization of a PLASMA Source File](#organization-of-a-plasma-source-file)
- [Module Dependencies](#module-dependencies)
- [File Inclusion](#file-inclusion)
- [Predefined Functions](#predefined-functions)
- [Constant Declarations](#constant-declarations)
- [Structure Declarations](#structure-declarations)
- [Global Data \& Variables Declarations](#global-data--variables-declarations)
- [Function Definitions](#function-definitions)
- [Statements and Expressions](#statements-and-expressions)
- [Exported Declarations](#exported-declarations)
- [Module Main Initialization Function](#module-main-initialization-function)
- [Module Done](#module-done)
- [Runtime](#runtime)
- [PLASMA Compiler/Assembler](#plasma-compilerassembler)
- [PLASMA Modules](#plasma-modules)
- [Data Types](#data-types)
- [Obligatory 'Hello World'](#obligatory-hello-world)
- [Character Case](#character-case)
- [Comments](#comments)
- [Numbers](#numbers)
- [Characters](#characters)
- [Strings](#strings)
- [Organization of a PLASMA Source File](#organization-of-a-plasma-source-file)
- [Module Dependencies](#module-dependencies)
- [File Inclusion](#file-inclusion)
- [Predefined Functions](#predefined-functions)
- [Constant Declarations](#constant-declarations)
- [Structure Declarations](#structure-declarations)
- [Global Data & Variables Declarations](#global-data-variables-declarations)
- [Function Definitions](#function-definitions)
- [Statements and Expressions](#statements-and-expressions)
- [Exported Declarations](#exported-declarations)
- [Module Main Initialization Function](#module-main-initialization-function)
- [Module Done](#module-done)
- [Runtime](#runtime)
- [Reference](#reference)
- [Decimal and Hexadecimal Numbers](#decimal-and-hexadecimal-numbers)
- [Character and String Literals](#character-and-string-literals)
- [In-line String Literals](#in-line-string-literals)
- [Words](#words)
- [Bytes](#bytes)
- [Addresses](#addresses)
- [Arrays](#arrays)
- [Type Overrides](#type-overrides)
- [Multi-Dimensional Arrays](#multi-dimensional-arrays)
- [Offsets (Structure Elements)](#offsets-structure-elements)
- [Defining Structures](#defining-structures)
- [Pointers](#pointers)
- [Pointer Dereferencing](#pointer-dereferencing)
- [Addresses of Data/Code](#addresses-of-datacode)
- [Function Pointers](#function-pointers)
- [Function Definitions](#function-definitions-1)
- [Expressions and Statements](#expressions-and-statements)
- [Address Operators](#address-operators)
- [Arithmetic, Bitwise, and Logical Operators](#arithmetic-bitwise-and-logical-operators)
- [Assignment](#assignment)
- [Empty Assignments](#empty-assignments)
- [Increment and Decrement](#increment-and-decrement)
- [Lambda Functions](#lambda-functions)
- [Control Flow](#control-flow)
- [CALL](#call)
- [RETURN](#return)
- [IF/\[ELSIF\]/\[ELSE\]/FIN](#ifelsifelsefin)
- [WHEN/IS/\[OTHERWISE\]/WEND](#whenisotherwisewend)
- [FOR \<TO,DOWNTO\> \[STEP\]/NEXT](#for-todownto-stepnext)
- [WHILE/LOOP](#whileloop)
- [REPEAT/UNTIL](#repeatuntil)
- [CONTINUE](#continue)
- [BREAK](#break)
- [Decimal and Hexadecimal Numbers](#decimal-and-hexadecimal-numbers)
- [Character and String Literals](#character-and-string-literals)
- [In-line String Literals](#in-line-string-literals)
- [Words](#words)
- [Bytes](#bytes)
- [Addresses](#addresses)
- [Arrays](#arrays)
- [Type Overrides](#type-overrides)
- [Multi-Dimensional Arrays](#multi-dimensional-arrays)
- [Offsets (Structure Elements)](#offsets-structure-elements)
- [Defining Structures](#defining-structures)
- [Pointers](#pointers)
- [Pointer Dereferencing](#pointer-dereferencing)
- [Addresses of Data/Code](#addresses-of-datacode)
- [Function Pointers](#function-pointers)
- [Function Definitions](#function-definitions)
- [Expressions and Statements](#expressions-and-statements)
- [Address Operators](#address-operators)
- [Arithmetic, Bitwise, and Logical Operators](#arithmetic-bitwise-and-logical-operators)
- [Assignment](#assignment)
- [Empty Assignments](#empty-assignments)
- [Increment and Decrement](#increment-and-decrement)
- [Lambda (Anonymous) Functions](#lambda-functions)
- [Control Flow](#control-flow)
- [CALL](#call)
- [RETURN](#return)
- [IF/[ELSIF]/[ELSE]/FIN](#ifelsifelsefin)
- [WHEN/IS/[OTHERWISE]/WEND](#whenisotherwisewend)
- [FOR \<TO,DOWNTO\> [STEP]/NEXT](#for-todownto-stepnext)
- [WHILE/LOOP](#whileloop)
- [REPEAT/UNTIL](#repeatuntil)
- [CONTINUE](#continue)
- [BREAK](#break)
- [Advanced Topics](#advanced-topics)
- [Code Optimizations](#code-optimizations)
- [Functions Without Parameters Or Local Variables](#functions-without-parameters-or-local-variables)
- [Return Values](#return-values)
- [Native Assembly Functions](#native-assembly-functions)
- [Code Optimizations](#code-optimizations)
- [Functions Without Parameters Or Local Variables](#functions-without-parameters-or-local-variables)
- [Return Values](#return-values)
- [Native Assembly Functions](#native-assembly-functions)
- [Libraries and Sample Code](https://github.com/dschmenk/PLASMA/wiki)
- [Implementation](#implementation)
- [A New Approach](#a-new-approach)
- [The Virtual Machine](#the-virtual-machine)
- [The Stacks](#the-stacks)
- [Evaluation Stack](#evaluation-stack)
- [Call Stack](#call-stack)
- [Local Frame Stack](#local-frame-stack)
- [Local String Pool](#local-string-pool)
- [Apple 1 PLASMA](#apple-1-plasma)
- [Apple II PLASMA](#apple-ii-plasma)
- [Apple /// PLASMA](#apple--plasma)
- [A New Approach](#a-new-approach)
- [The Virtual Machine](#the-virtual-machine)
- [The Stacks](#the-stacks)
- [Evaluation Stack](#evaluation-stack)
- [Call Stack](#call-stack)
- [Local Frame Stack](#local-frame-stack)
- [Local String Pool](#local-string-pool)
- [The Bytecodes](#the-bytecodes)
- [Apple 1 PLASMA](#apple-1-plasma)
- [Apple II PLASMA](#apple-ii-plasma)
- [Apple /// PLASMA](#apple--plasma)
- [Links](#links)
<!-- /TOC -->
@@ -126,7 +106,7 @@ Different projects have led to the architecture of PLASMA, most notably Apple Pa
## PLASMA Cross-Compiler
The first step in writing PLASMA code is to get a build environment working. If you have Unix-like environment, then this is a fairly easy exercise. Windows users may want to install the [Linux Subsystem for Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10) or the [Cygwin](https://www.cygwin.com/) environment to replicate a Unix-like environment under Windows. When installing Cygwin, make sure **gcc-core**, **make**, and **git** are installed under the **Devel** packages. Mac OS X users may have to install the **Xcode** from the App Store. Linux users should make sure the development packages are installed.
The first step in writing PLASMA code is to get a build environment working. If you have Unix-like environment, then this is a fairly easy exercise. Windows users may want to install the [Cygwin](https://www.cygwin.com/) environment to replicate a Unix-like environment under Windows. When installing Cygwin, make sure **gcc-core**, **make**, and **git** are installed under the **Devel** packages. Mac OS X users may have to install the **Xcode** from the App Store.
Launch the command-line/terminal application for your environment to download and build PLASMA. Create a source code directory and change the working directory to it, something like:
@@ -538,7 +518,7 @@ else
fin
```
The `when`/`is`/`otherwise`/`wend` statement is similar to the `if`/`elsif`/`else`/`fin` construct except that it is more efficient. It selects one path based on the evaluated expressions, then merges the code path back together at the end. Only the `when` value is compared against a list of constant. Just as in C programs, a `break` statement is required to keep one clause from falling through to the next. Falling through from one clause to the next can have its uses, so this behavior has been added to PLASMA.
The `when`/`is`/`otherwise`/`wend` statement is similar to the `if`/`elsif`/`else`/`fin` construct except that it is more efficient. It selects one path based on the evaluated expressions, then merges the code path back together at the end. Only the `when` value is compared against a list of expressions. The expressions do not need to be constants, they can be any valid expression. The list of expressions is evaluated in order, so for efficiency sake, place the most common cases earlier in the list. Just as in C programs, a `break` statement is required to keep one clause from falling through to the next. Falling through from one clause to the next can have its uses, so this behavior has been added to PLASMA.
```
when keypressed
@@ -1159,7 +1139,7 @@ The common `if` test can have optional `elsif` and/or `else` clauses. Any expres
#### WHEN/IS/[OTHERWISE]/WEND
The complex test case is handled with `when`. Basically an `if`, `elsif`, `else` list of comparisons, it is generally more efficient. The `is` value must be a constant.
The complex test case is handled with `when`. Basically an `if`, `elsif`, `else` list of comparisons, it is generally more efficient. The `is` value can be any expression. It is evaluated and tested for equality to the `when` value.
```
when key
@@ -1182,6 +1162,26 @@ when key
wend
```
With a little "Yoda-Speak", some fairly complex test can be made:
```
const FALSE = 0
const TRUE = NOT FALSE
byte a
when TRUE
is (a <= 10)
// 10 or less
break
is (a > 10) AND (a < 20)
// between 10 and 20
break
is (a >= 20)
// 20 or greater
wend
```
A `when` clause can fall-through to the following clause, just like C `switch` statements by leaving out the `break`.
#### FOR \<TO,DOWNTO\> [STEP]/NEXT
@@ -1313,6 +1313,80 @@ One of the biggest problems to overcome with the 6502 is its very small hardware
Any function that uses in-line strings may have those strings copied to the local string pool for usage. This allows string literals to exist in the same memory as the bytecode and only copied to main memory when used. The string pool is deallocated along with the local frame stack when the function exits.
### The Opcodes
The compact code representation comes through the use of opcodes closely matched to the PLASMA compiler. They are:
| OPCODE | Name | Description
|:------:|:------:|-----------------------------------
| $00 | ZERO | push zero on the stack
| $02 | ADD | add top two values, leave result on top
| $04 | SUB | subtract next from top from top, leave result on top
| $06 | MUL | multiply two topmost stack values, leave result on top
| $08 | DIV | divide next from top by top, leave result on top
| $0A | MOD | divide next from top by top, leave remainder on top
| $0C | INCR | increment top of stack
| $0E | DECR | decrement top of stack
| $10 | NEG | negate top of stack
| $12 | COMP | compliment top of stack
| $14 | AND | bit wise AND top two values, leave result on top
| $16 | IOR | bit wise inclusive OR top two values, leave result on top
| $18 | XOR | bit wise exclusive OR top two values, leave result on top
| $1A | SHL | shift left next from top by top, leave result on top
| $1C | SHR | shift right next from top by top, leave result on top
| $02 | IDXB | add top of stack to next from top, leave result on top (ADD)
| $1E | IDXW | add 2X top of stack to next from top, leave result on top
| $20 | NOT | logical NOT of top of stack
| $22 | LOR | logical OR top two values, leave result on top
| $24 | LAND | logical AND top two values, leave result on top
| $26 | LA | load address
| $28 | LLA | load local address from frame offset
| $2A | CB | constant byte
| $2C | CW | constant word
| $2E | CS | constant string
| $30 | DROP | drop top stack value
| $32 | DUP | duplicate top stack value
| $34 | NOP |
| $36 | DIVMOD | divide next from to by top, leave result and remainder on stack
| $38 | BRGT | branch next from top greater than top
| $3A | BRLT | branch next from top less than top
| $3C | BREQ | branch next from top equal to top
| $3E | BRNE | branch next from top not equal to top
| $40 | ISEQ | if next from top is equal to top, set top true
| $42 | ISNE | if next from top is not equal to top, set top true
| $44 | ISGT | if next from top is greater than top, set top true
| $46 | ISLT | if next from top is less than top, set top true
| $48 | ISGE | if next from top is greater than or equal to top, set top true
| $4A | ISLE | if next from top is less than or equal to top, set top true
| $4C | BRFLS | branch if top of stack is zero
| $4E | BRTRU | branch if top of stack is non-zero
| $50 | BRNCH | branch to address
| $52 | IBRNCH | branch to address on stack top
| $54 | CALL | sub routine call with stack parameters
| $56 | ICAL | sub routine call to address on stack top with stack parameters
| $58 | ENTER | allocate frame size and copy stack parameters to local frame
| $5A | LEAVE | deallocate frame and return from sub routine call
| $5C | RET | return from sub routine call
| $5E | CFFB | constant with $FF MSB
| $60 | LB | load byte from top of stack address
| $62 | LW | load word from top of stack address
| $64 | LLB | load byte from frame offset
| $66 | LLW | load word from frame offset
| $68 | LAB | load byte from absolute address
| $6A | LAW | load word from absolute address
| $6C | DLB | duplicate top of stack into local byte at frame offset
| $6E | DLW | duplicate top of stack into local word at frame offset
| $70 | SB | store next from top of stack byte into top address
| $72 | SW | store next from top of stack word into top address
| $74 | SLB | store top of stack into local byte at frame offset
| $76 | SLW | store top of stack into local word at frame offset
| $78 | SAB | store top of stack into byte at absolute address
| $7A | SAW | store top of stack into word at absolute address
| $7C | DAB | duplicate top of stack into byte at absolute address
| $7E | DAW | duplicate top of stack into word at absolute address
The opcodes were developed over time by starting with a very basic set of operations and slowly adding opcodes when the PLASMA compiler could improve code density or performance.
## Apple 1 PLASMA
Obviously the Apple 1 is a little more constrained than most machines PLASMA is targeting. But, with the required addition of the CFFA1 (http://dreher.net/?s=projects/CFforApple1&c=projects/CFforApple1/main.php), the Apple 1 gets 32K of RAM and a mass storage device. Enough to run PLASMA and load/execute modules.

BIN
SANDBOX.PO Executable file

Binary file not shown.

View File

@@ -2,8 +2,8 @@ WELCOME TO THE PLASMA EDITOR!
=============================
FIRST THINGS FIRST:
TO NAVIGATE, USE THE ARROW KEYS. ON
THE APPLE ][:
TO NAVIGATE, USE THE ARROW KEYS. ON THE
APPLE ][:
CTRL-K = UP
CTRL-J = DOWN.
@@ -18,23 +18,22 @@ TO JUMP AROUND THE TEXT FILE USE:
CTRL-Q = JUMP BEGINNING
CTRL-E = JUMP END
THE 'ESCAPE' KEY WILL PUT YOU IN
COMMAND MODE. FROM THERE YOU CAN
EXIT BY ENTERING 'Q' AND 'RETURN'.
YOU CAN ALSO RETURN TO THE EDITOR BY
JUST PRESSING 'RETURN'.
THE 'ESCAPE' KEY WILL PUT YOU IN COMMAND
MODE. FROM THERE YOU CAN EXIT BY
ENTERING 'Q' AND 'RETURN'. YOU CAN ALSO
RETURN TO THE EDITOR BY JUST PRESSING
'RETURN'.
-------
THE PLASMA EDITOR IS A SIMPLE TEXT
EDITOR FOR ENTERING AND MANIPULATING
TEXT AND SOURCE CODE FILES. THE
EDITOR ONLY SUPPORTS 40 COLUMN TEXT
ALTHOUGH LINES CAN BE UP TO 79
CHARACTERS LONG. THE SCREEN WILL
SCROLL HORIZONTALLY AS THE CURSOR
MOVES. THERE IS 16K OF MEMORY FOR
THE TEXT BUFFER.
TEXT AND SOURCE CODE FILES. THE EDITOR
ONLY SUPPORTS 40 COLUMN TEXT ALTHOUGH
LINES CAN BE UP TO 79 CHARACTERS LONG.
THE SCREEN WILL SCROLL HORIZONTALLY
AS THE CURSOR MOVES. THERE IS 16K OF
MEMORY FOR THE TEXT BUFFER.
IT HAS TWO MODES, COMMAND AND EDIT.
@@ -53,17 +52,13 @@ EDIT COMMANDS:
CTRL-Q = JUMP BEGIN
CTRL-E = JUMP END
CTRL-D = DELETE CHAR
CTRL-B = BEGIN SELECTION
CTRL-C = COPY SELECTION INTO CLIPBOARD
CTRL-X = CUT SELECTION INTO CLIPBOARD
CTRL-V = PASTE CLIPBOARD
CTRL-X = DELETE/CUT LINE
CTRL-V = COPY DELETED LINE
CTRL-O = OPEN NEW LINE
CTRL-F = OPEN A FOLLOWING NEW LINE
CTRL-T = JOIN LINES
CTRL-Y = TOGGLE INSERT/OVERWRITE
CTRL-B = TOGGLE INSERT/OVERWRITE
TAB/CTRL-I = INSERT SPACES TO NEXT TAB
= INDENT SELECTION IF INSERT MODE
= UNDENT SELECTION IF OVERWITE MODE
ESCAPE = SWITCH TO COMMAND MODE
DELETE = DELETE CHAR LEFT
@@ -83,7 +78,7 @@ EDIT COMMANDS:
APPLE ][, UPPER AND LOWER CASE
ENTRY WORKS AS EXPECTED.
ESC T C = FORCE LOWER-CASE CHARS
CTRL-C = FORCE LOWER-CASE CHARS
If you have a lower-case character
generator installed, you can force
@@ -98,12 +93,11 @@ EDIT COMMANDS:
The 'SOLID-APPLE' key will modify
theese keys:
SA-RETURN = OPEN FOLLOWING LINE
SA-RETURN = OPEN LINE
SA-LEFT ARROW = JUMP LEFT
SA-RIGHT ARROW = JUMP RIGHT
SA-UP ARROR = JUMP UP
SA-DOWN ARROW = JUMP DOWN
SA-TAB = DETAB
Apple /// FEATURES:
-------------------
@@ -112,12 +106,11 @@ EDIT COMMANDS:
these keys:
OA-\ = DELETE CHAR LEFT
OA-RETURN = OPEN FOLLOWING LINE
OA-RETURN = OPEN LINE
OA-LEFT ARROW = JUMP LEFT
OA-RIGHT ARROW = JUMP RIGHT
OA-UP ARROR = JUMP UP
OA-DOWN ARROW = JUMP DOWN
OA-TAB = DETAB
On the keypad, 'OPEN-APPLE' allows
the keys for navigation and misc:
@@ -131,9 +124,9 @@ EDIT COMMANDS:
OA-7 = JUMP BEGIN
OA-1 = JUMP END
OA-5 = DELETE CHAR
OA-- = CUT SELECTION INTO CLIPBOARD
OA-0 = PASTE CLIPBOARD
OA-ENTER = OPEN FOLLOWING LINE
OA-- = DELETE/CUT LINE
OA-0 = COPY DELETED LINE
OA-ENTER = OPEN NEW LINE
OA-. = TOGGLE INSERT/OVERWRITE
COMMAND MODE:
@@ -149,9 +142,5 @@ COMMAND MODE:
P <PREFIX> = SET PREFIX
H [SLOT] = HARDCOPY TO DEVICE IN SLOT (DEFAULT 1)
N = CLEAR TEXT IN MEMORY
T G = TOGGLE GUTTER VIEW
T C = TOGGLE LOWER-CASE SUPPORT (APPLE ][)
G <LINE> = GO TO LINE #
F [STRING] = FIND STRING
E = EDIT MODE
'RETURN' = EDIT MODE

View File

@@ -1,123 +0,0 @@
# FORTH PLASMA + PLFORTH !
PLFORTH represents a REPL and scripting language for the PLASMA environment. Or, what I did over the Holiday break.
The goals of PLFORTH are pretty straight forward:
**Interactivity** and **debugging**.
PLFORTH is a PLASMA module written in PLASMA itself. As a first class citizen of the PLASMA environment, it has instant access to all the PLASMA modules, from floating point to high-res graphics libraries and everything in between.
## Missing words in PLFORTH
There are quite a few missing word that a standard FORTH would have. Mostly due to deliberately keeping PLFORTH as minimal as possible to reduce the memory footpring and load time. Most of the missing words can be synthesized using existing PLASMA modules and some glue words. The double word have mostly been made avialable through PLASMA's 32 bit integer module, `INT32` by way of the `int32.4th` script. You can always petition to get your favorite FORTH word included in the default vocabulary. Speaking of `VOCABULARY`, PLFORTH only has one.
## PLFORTH built-in words
![WORDS](forthwords.png)
## PLFORTH specific words
### Words for looking at internal structures:
`.RS`: Displays the return stack. Note: PLFORTH uses a software defined return stack, this is not the hardware stack
### Words for tracing and single stepping execution:
`TRON`: Turn tracing on
`TROFF`: Turn tracing off (will also turn off single stepping if enabled)
`STEPON`: Turn single stepping on
`STEPOFF`: Turn single stepping off
While running code, `<CTRL-T>` will toggle tracing on and off as well
### Words for breakpoints:
`BRK`: Used inside compiled word to effect a runtime break
`BRKON xxxx`: Enable breakpoint whenever word `xxxx` is executed
`BRKOFF`: Disable the breakpoint. Note: only one breakpoint is currently supported
While running code, `<CTRL-C>` will break out and return to the interpreter.
`CONT`: Continue running from the last break point
### Words for PLASMA linkage:
`LOOKUP yyyy`: Lookup symbol `yyyy` in PLASMA symbol table and return its address
`PLASMA zzzz`: Create word `zzzz` with code address from `LOOKUP`
### Words to run a script:
`SRC`: Source filename on stack as input. Can be nested
`SRC" ssss"`: Source file `ssss` as input. Can be nested
`?ENDSRC`: End sourcing file as input if stack flag non-zero
`ENDSRC`: End sourcing file as input
### Words for compiler modes:
`PBC`: Compile into PLASMA Byte Code
`ITC`: Compile into Indirect Threaded Code
### Word for converting string to number:
`NUM?`: Convert string and length to number, returning number and valid flag
Numbers entered with a preceeding `$` will be interpreted as hex values
### Words for displaying hex numbers
`$.`: Display TOS word in hex with leading `$`
`C$.`: Display TOS byte in hex with leading `$`
## Debugging vs Performance
PLFORTH defaults to compiling using ITC (Indirect Threaded Code). This supports a list of inspection and debugging features while developing programs and scripts. However, the compiler can easily switch to PBC (PLASMA Byte Code) to greatly improve performance, but most of the debugging tools are lost. ITC compiled words and PBC compiled words can be intermingled and call each other seemlessly. PLASMA Byte Code is a direct match to many low-level FORTH constructs.
## Graphics
Due to the way the Apple II implements Hi-Res, Lo-Res and Double Lo-Res graphics, a stub loader is required to reserve the pages used.
`HRFORTH`: Reserve HGR page 1 before launching PLFORTH
`HR2FORTH`: Reserve HGR pages 1 and 2 before launching PLFORTH
`TX2FORTH`: Reserve GR and DGR pages 1 and 2 before launching PLFORTH
## Scripts
There are a few useful scripts located in the `scripts` directory. By far the most useful is `plasma.4th`
### plasma.4th useful words
`CAT`: Display files in current ProDOS directory
`CAT" pppp"`: Display files in `pppp` ProDOS directory
`PFX" pppp"`: Set current ProDOS prefix to `pppp`
`PFX.`: Display current ProDOS prefix
`EDIT" ssss"`: Edit file `ssss`
## Command line options
`-F`: Fast flag (like `PCB` as first command)
`-T`: Trace flag (like `TRON` as first command)
`SCRIPT NAME`: Soure filename to execute
## Links
Here is a (worse than usual) video running through some examples. This was a preliminary release so the final is a bit different: https://youtu.be/picPyXAk77I?si=Td2En5Z3oxVTzh0z
A pre-configured ProDOS floppy image able to run and a few utilities is available here: https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLFORTH.PO

Binary file not shown.

View File

@@ -1,94 +0,0 @@
PLASMA goes ROGUE
=================
Introduction
------------
This version of ROGUE is somewhat different than others. It is very simple in most ways, but I have developed a (I think) unique visibility algorithm that runs extremely fast. Fast enough to run interpreted by the PLASMA VM on a 1 MHz 6502, and space efficient enough to allow for large (in the future) dungeons. The unique feature of this ROGUE is that lighting becomes critical and strategic. You are in dark catacombs, after all. You enter with a lit lamp, throwing off a circle of light. There are also torches throughout the catacombs that light up a small surrounding circle of light. Other items in the catacombs are mana (health+energy increase), a key, a raft, and gold. You will also encounter a number of enemies that will track you down to try and kill you. You will also encounter doors, locked doors, windows, water, and crevasses.
Strategy
--------
As you travel through the catacombs, you must watch your health, energy, and lamp oil levels. Once health reaches zero, you are dead. As energy reaches zero, your vision will narrow and you will no longer be able to run. When the lamp oil runs out, you will be cast into darkness. If you see any torches in your field of vision, you can navigate to them. Taking the torch will extinguish the torch and replenish some of your lamp oil. Note that as you travel through the catacombs, your map of what you have seen will automatically fill in. But, if you are in the dark, you cannot read your map. You must turn on your lamp or get next to a torch before you can read the map again. If you are in the dark and cant see any torches in your field of vision, you are in complete darkness. It is easy to lose your bearings. As such, the absolute direction movements no longer work (NSEW) - you will end up in a random direction if you try. However, the relative turns, left/right and forward/backward controls continue to work (that you can do in the dark).
Being in the dark can be advantageous, however. All the enemies in the catacombs can see you if you are in light, just as you can see them. If you are in darkness, they can't see you, and you can move around without being tracked. Don't run into them! Also, don't fall off a crevasse. You will hear certain noises giving you feedback on what is going on. A simple beep when you run into walls. A groan when an enemy moves towards you. A bleep when you pick an item up. Other noises when you fall over an edge or win a battle. These can be used strategically when moving in the dark.
Health will slowly improve as you move around. However, energy is depleted as you move. Mana will increase both health and energy. If health is already at 100, it wont go any higher. Same for energy, but it is important to keep both high. When energy goes low, you can no longer move quickly and your field-of-vision narrows. When health goes to zero, you are dead.
Tile Description
----------------
As ROGUE uses the text screen for display, a little creativity is required to interpret the map. These are the characters you will see and what the represent. Once you get the hang of it, it will be just like looking at the unencoded Matrix.
Screen Character Represents
# Wall
. Floor
: Window (barred opening)
+ Door
% Locked Door (need key to open)
' ' space Crevasse (pit - don't fall in)
= Exit
- Entrance
*,X Torch
& Mana
, Key (yep, hard to spot)
@ Raft (need to cross water)
((( Water
))) Water (you will drown without raft)
$ Gold
Flashing Entity
T Thief
O Ogre
Z Zombie
R Rogue
Player Facing Direction
^ North
\ NE
> East
/ SE
v South
\ SW
< West
/ NW
Tiles in light are inverse. Entities are displayed only when lit and in field of view. The map is only visible when lit, i.e lamp is on or standing next to a torch.
Interaction
-----------
Keyboard commands Action
Q Run (Quick)
W up-arrow Forward
S down-arrow Backward
A left-arrow Turn left
D right-arrow Turn right
I Move N
J Move W
K Move E
M Move S
< , Turn lamp down
> . Turn lamp up/on
O Turn lamp off
Space-bar Open door
Return Pick up item
X Exit (die)
Whenever you and an enemy end up on the same tile, battle commences. As you win fights, your skill increases, improving your attack effectiveness. As you advance through the catacombs, the enemies become more powerful. You will need to replenish health and energy with mana. Don't forget, the alternative to fighting is stealth in the darkness. During battle, you have the option to run. If you have low energy, you won't get very far. Also, when fighting, you get turned around so you can't depend on the direction you were facing before fighting. Running ('Q'uick) will get you away from enemies but will use much more energy.
If you should die, restart the game by typing:
+rogue
Map Levels
----------
Level maps are up to 62x62 in size (plus a wall boundary for an effective 64x64 map size). They can be smaller than this. The game will end when it tries to load an non-existent level. Levels start at file name “LEVEL0“ and can go all the way to “LEVEL9“, but must be sequential.
There are two levels included on the disk, and an empty level for you to use as a template. You can edit the map levels, and add your own. They are simple ASCII text files. The included editor can edit the maps right on the disk. type:
+ed level.empty
after exiting from ROGUE. Make your changes and save it as LEVEL0" to "LEVEL9". The next free level is currently "LEVEL2". You may also edit an existing level:
+ed level0
for instance.

View File

@@ -81,13 +81,13 @@ If you should die, restart the game by typing:
Level maps are up to 62x62 in size (plus a wall boundary for an effective 64x64 map size). They can be smaller than this. The game will end when it tries to load an non-existent level. Levels start at file name “LEVEL0“ and can go all the way to “LEVEL9“, but must be sequential.
There are two levels included on the disk, and an empty level for you to use as a template. You can edit the map levels, and add your own. They are simple ASCII text files. The included editor can edit the maps right on the disk. type:
There are two levels included on the disk, and an empty level for you to use as a template. You can edit the map levels, and add your own. They are simple ASCII text files. The included sandbox editor can edit the maps right on the disk. type:
```
+ed level.empty
-sandbox level.empty
```
after exiting from ROGUE. Make your changes and save it as LEVEL0" to "LEVEL9". The next free level is currently "LEVEL2". You may also edit an existing level:
```
+ed level0
-sandbox level0
```
for instance.

View File

@@ -1,310 +0,0 @@
# PLASMA Version 2.1
Welcome to PLASMA: the Grand Unifying Platform for the Apple 1, ][, and ///.
Download the five disk images:
[PLASMA 2.1 800K Full System](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1.2mg?raw=true)
[PLASMA 2.1 ProDOS Boot & Install](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INST.po?raw=true)
[PLASMA 2.1 System Libraries](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-SYS.po?raw=true)
[PLASMA 2.1 Build Tools](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-BLD.po?raw=true)
[PLASMA 2.1 Demos](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-DEMOS.po?raw=true)
[PLASMA 2.1 TCP/IP network modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INET.po?raw=true)
[PLASMA 2.1 Apple /// SOS Mame Boot and SANE floating point modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-FPSOS.po?raw=true)
[PLASMA 2.1 Apple /// SOS Mame Boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA2-A3MAME.PO?raw=true)
[PLASMA 2.1 Apple /// Mame hard disk image](https://github.com/dschmenk/PLASMA/blob/master/images/apple/apple3.hd?raw=true)
[PLASMA 2.1 PLFORTH stand-alone boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLFORTH.PO?raw=true)
PLASMA now has a ProDOS hard disk install script. Mass storage is the recommended installation that looks like (replacing HARDISK with your volume name of choice) if you want to copy files yourself:
Boot & System Files => /HARDISK/PLASMA/
Build Files => /HARDISK/PLASMA/BLD/
Demo Files => /HARDISK/PLASMA/DEMOS/
Floating Point SANE Files => /HARDISK/PLASMA/SYS
INET Files => /HARDDISK/PLASMA/SYS
Use the System Utilities to copy the floppy images into the above mentioned directories.
## Apple 1
The Apple 1 is a very constrained system compared to the ][ and ///. It is required to have the CFFA1 disk adapter installed to provide file storage and a full 32K od RAM. To get the files onto the CF card required the use of [CiderPress](http://a2ciderpress.com) and they must be placed in one directory. Most PLASMA programs won't work on the Apple 1 due to limited filesystem support, video/graphics capabilities, and lack of audio output. It does, however, make a good place to start when porting PLASMA to a new platform.
## Apple ][
To boot directly into PLASMA, you will need to put the system files in the root prefix of the boot device and make sure PLASMA.SYSTEM is the first SYSTEM file in the directory. Otherwise, start PLASMA.SYSTEM from your program launcher of choice. All Apple ][ models with 64K and two floppy drives are supported up to a maxed out IIGS with accelerator and hard drive.
#### 65802/65816 Support
PLASMA can utilize the 16 bit features of the 65802 and 65816 processors to improve performance of the PLASMA VM operation. This is transparent to the programmer/user and doesn't make any additional memory or capabilities available to PLASMA. PLASMA will automatically run the most optimal VM for your configuration.
## Apple ///
The Apple /// gets the environment it always wanted: The ability to navigate the filesystem with a command line interface. The Apple /// always boots from the floppy drive, even if a hard disk is installed. `PLASMA2-A3MAME.PO` is an Apple 3 bootable disk containing the SOS.DRIVER configured for the [Apple 3 Ready-To-Run Mame environment](https://github.com/datajerk/apple3rtr). `apple3.hd` is the pre-installed PLASMA hard disk image set up for [Apple 3 Ready-to-Run](https://github.com/datajerk/apple3rtr). For a physical Apple 3, the PLASMA2-FPSOS.PO floppy should be updated with the SOS.DRIVER configured for the machine. Once booted, type `S /HARDISK/PLASMA` (or your install directory of choice) to change to, and set, the system directory. This can be automated by creating an `AUTORUN` file on the boot floppy with the above command in it.
## PLASMA Command Line Shell
PLASMA incorporates a very basic command line shell to facilitate navigating the filesystem and executing both SYSTEM/SOS programs and PLASMA modules. It has a few built-in commands:
| Command | Operation |
|:----------------------------:|-------------------------|
| C [PREFIX] | Catalog prefix
| P \<PREFIX\> | change to Prefix
| / | change to parent prefix
| V | show online Volumes
| S \<PREFIX\> | set System prefix*
| +SOS \<SOS.INTERP\> [PREFIX] | launch SOS interpreter*
| -\<SYSTEM PROGRAM\> [PARAMS] | launch SYSTEM program**
| +\<PLASMA MODULE\> [PARAMS] | exec PLASMA module
```
[Optional parameters]
<Required parameters>
* Apple /// only
** Apple ][ only
```
The shell is very brief with error messages. It is meant solely as a way to run programs that accept command line parameters and take up as little memory as possible. It does, however, provide a rich runtime for PLASMA modules.
## Included Modules
PLASMA comes with many library modules used by the tools, demos and sample code. The PLASMA system volume must remain in place for the duration of PLASMAs run otherwise it won't be able to find CMD or the system libraries. Probably the most useful included module is the editor. It is used for editing PLASMA source file, assembly source files, or any text file. Execute it with:
```
+ED [TEXT FILE] [GOTO LINE NUMBER]
```
The file manipulation utilities to copy, delete, rename, create directories, and change file type and aux type remove the need for external programs to do the same. PLASMA can now be installed with the tools included on the PLASMA2-SYS boot floppy. They are:
```
+COPY [-R] <SRCPATH>+ <DSTPATH>
+DEL [-R] <FILEPATH>
+REN <FILENAME> <NEWNAME>
+NEWDIR <NEWDIRECTORY>
+TYPE <FILENAME> [NEWTYPE [NEWAUX]]
+CAT [-R] <FILEPATH]
```
The ```-R``` option will operate on the directories recursively. Wildcard filenames can be specified with ```'*'``` matching zero or more characters, and ```'?'``` matching any character. When copying files to the current directory, ```=``` can be used as a shortcut.
## Compiler Modules
The build disk includes sample source, include files for the system modules, and the PLASMA compiler+optimizer modules. The compiler is invoked with:
```
+PLASM [-[W][O[2]] <SOURCE FILE> [OUTPUT FILE]
```
Compiler warnings are enabled with `-W`. The optional optimizer is enabled with `-O` and extra optimizations are enabled with `-O2`. The source code for a few sample programs are included. The big one, `RPNCALC.PLA`, is the sample RPN calculator that uses many of PLASMA's advanced features. The self-hosted compiler is the same compiler as the cross-compiler, just transcribed from C to PLASMA (yes, the self-hosted PLASMA compiler is written in PLASMA). It requires patience when compiling: it is a fairly large and extensive program.
## Demos
There are some demo programs included for your perusal. Check out `ROGUE` for some diversion. You can find the documentation here: https://github.com/dschmenk/PLASMA/blob/master/doc/Rogue%20Instructions.md. A music sequencer to play through a MockingBoard if it is detected, or the built-in speaker if not. A minimal Web server if you have an Uthernet2 card (required). Try `SPIDERS`for some hires shoot'em-up action. Bug reports appreciated.
## Source Code
Most sample source code is included from the project. They build without alteration and should be a good starting point for further explorations. The header files for the included library modules are in the INC directory.
## Video Playlist
There is a [YouTube playlist](https://www.youtube.com/playlist?list=PLlPKgUMQbJ79VJvZRfv1CJQf4SP2Gw3yU) created for learning PLASMA. It is a WIP, with updates every week or so
## Issues
- All the modules and runtime are written mostly in PLASMA; the compiler and editor as well. This means that there may be some startup delay as the PLASMA module loader reads in the module dependencies and performs dynamic linking. But a 1 MHz, 8 bit CPU interpreting bytecodes is never going to match a modern computer. As noted earlier, an accelerator and mass storage are your (and PLASMA's) friend.
- All the project modules are included. They have been lightly tested.
- The Apple /// may not always report errors properly or at all.
- The documentation is sparse and incomplete. Yep, could use your help...
# Changes in PLASMA for 2.0 Release
1. Fix command line buffer overflow
2. Use VBlank to blink editor cursor so not CPU speed dependent
3. Add ```=``` for ```+COPY``` current destination
4. Add //c support for DGRLIB and GRLIB wait-for-VBlank routines
# Changes in PLASMA for 2.0 Beta
1. Compilers allows for including self imported defines
2. Compilers fixed for local constants
3. Floating point string formatting fixes and improvements
4. Fiber library exports number of active fibers
# Changes in PLASMA for 2.0 Alpha 2
1. Self hosted compiler fixes for invalid array size constants
2. Ensure IDs in self hosted compiler are 31 characters significant
3. Fix bug COPY file parsing and move common routine into MATCHFILES
# Changes in PLASMA for 2.0 Alpha 1
1. Improved entry/exit for 128K Apple IIe //c
2. Improved entry for Apple ///
3. Improved entry and function calls for 16 bit VM
# Changes in PLASMA for 2.0 DP 4
1. Improved editor auto-indenting
2. Compiler fix for terneray operator precedence
3. Machine check for HGR library
# Changes in PLASMA for 2.0 DP 3
1. File manipulation utilities fixed for Apple /// SOS vs ProDOS differences
2. More optimizations for HiRes graphics libraries
3. Spiders From Mars hires demo game
# Changes in PLASMA for 2.0 DP 2
1. Many file manipulaition utilities (COPY, REName, NEWDIRectory, DELete, CATalog, TYPE)
2. New and updated libraries for lo-res. double lo-res and hi-res graphics w/ sprites
3. 32 bit integer library for those times when 16 bits just isn't enough
4. Apple /// improvements to other SOS.INTERP launching with SOS utility
5. Apple /// JIT VM for speed and non JIT version to free up global memory
6. Editor improvements
7. A couple small compiler optimizations
8. Needed to break out TCP/IP modules into seperate floppy image
9. Library changes require full install
# Changes in PLASMA for 2.0 DP 1z
1. Many fixes for the value zero - especially in 65802/65816 divide routine
# Changes in PLASMA for 2.0 DP 1 E+C
1. Greatly improved code editor and additional compiler stats
# Changes in PLASMA for 2.0 DP 1a
1. Fix interaction with JIT compiler and module load/unload
# Changes in PLASMA for 2.0 DP 1
1. Expanded bytecode for more efficient size/performance of programs
2. Just-In-Time Compiler for native code performance (6502 and 65816) for frequently called routines
3. Automatically identify and run most optimal VM for configuration
# Changes in PLASMA for 1.2
1. Add TFTPD TFTP server
2. Fix Uthernet 1 driver
3. Add mouse module
4. Fix IRQ issues for interrupt driven mouse driver
# Changes in PLASMA for 1.1
1. All known bugs are fixed
2. PLASM compiler received a little performance boost with an assembly language helper for ID/keyword lexical scanner
# Changes in PLASMA for 1.0
If you have been programming in PLASMA before, the 1.0 version has some major and minor changes that you should be aware of:
1. Case is no longer significant. Imported symbols were always upper case. Now, all symbols are treated as if they were upper case. You may find that some symbols clash with previously defined symbols of different case. Hey, we didn't need lower case in 1977 and we don't need it now. You kids, get off my lawn!
2. Modules are now first class citizens. Translation: importing a module adds a symbol with the module name. You can simply refer to a module's address with it's name. This is how a module's API table is accessed (instead of adding a variable of the same name in the IMPORT section).
3. Bytecode changes means previously compiled modules will crash. Rebuild.
4. `BYTE` and `WORD` have aliases that may improve readability of the code. `CHAR` (character) and `RES` (reserve) are synonyms for `BYTE`. `VAR` (variable) is a synonym for `WORD`. These aliases add no functionality. They are simply syntactic sugar to add context to the source code, but may cause problems if you've previously used the same names for identifiers.
5. When declaring variables, a base size can come after the type, and an array size can folllow the identifier. For instance:
```
res[10] a, b, c
```
will reserve three variables of 10 bytes each. Additionally:
```
res[10] v[5], w[3]
```
will reserve a total of 80 bytes (10 * 5 + 10 * 3). This would be useful when combined with a structure definition. One could:
```
res[t_record] patients[20]
```
to reserve an array of 20 patient records.
6. Ternary operator. Just like C and descendants, `??` and `::` allow for an if-then-else inside an expression:
```
puts(truth == TRUE ?? "TRUE" :: "FALSE")
```
7. Multiple value assignements. Multiple values can be returned from functions and listed on variable assignments:
```
def func#3 // Return 3 values
return 10, 20, 30
end
a, b, c = 1, 2, 3
c, d, f = func()
x, y = y, x // Swap x and y
```
8. `DROP` allows for explicit dropping of values. In the above `func()` example, if the middle value was the only one desired, the others can be ignored with:
```
drop, h, drop = func()
```
9. The compiler tracks parameter and return counts for functions. If the above `func()` were used without assigning all the return values, they would be dropped:
```
a = func() // Two values silently dropped
```
To generate compiler warning for this issue, and a few others, use the `-W` option when compiling.
10. Lambda (Anonymous) Functions. The ability to code a quick function in-line can be very powerful when used properly. Look here, https://en.wikipedia.org/wiki/Anonymous_function, for more information.
11. SANE (Standard Apple Numerics Environment) Floating Point Library. An extensive library (two, actually) of extended floating point (80 bit IEEE precision) functionality is suported. A wrapper library has been written to greatly simplify the interface to SANE. Look at the `RPNCALC.PLA` source code as an example.
12. Library Documentation. Preliminary documentation is available on the Wiki: https://github.com/dschmenk/PLASMA/wiki
13. Significant effort has gone into VM tuning and speeding up module loading/dynamic linking.
14. The VM zero page usage has changed. If you write assembly language routines, you will need to rebuild.
# Thanks
I wish to thank the people who have contributed the the PLASMA project. They have greatly improved the development of the language and documentation:
- Martin Haye: PLASMA programmer extraordinaire. Mr. Lawless Legends has requested many of the crucial features that set PLASMA apart.
- Steve F (ZornsLemma): Has taken the optimizer to new levels and his work on porting PLASMA to the Beeb are amazing: http://stardot.org.uk/forums/viewtopic.php?f=55&t=12306&sid=5a503c593f0698ebc31e590ac61b09fc
- Peter Ferrie: Assembly optimizer extraordinaire. He has made significant improvements into the code footprint in PLASMA so all the functionality can exist in just a few bytes.
- David Schmidt (DaveX): His help in documentation have made it much more accessible and professional. Of course any errors are all his. Just kidding, they're mine ;-)
- Andy Werner (6502.org): Catching the grammatical errors that I ain't no good at.
- John Brooks: Apple II Guru par excellence. His insights got 10% performance increase out of the VM.
Dave Schmenk
http://schmenk.is-a-geek.com

View File

@@ -1,330 +0,0 @@
# PLASMA Version 2.1
Welcome to PLASMA: the Grand Unifying Platform for the Apple 1, ][, and ///.
Download the five disk images:
[PLASMA 2.1 800K Full System](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1.2mg?raw=true)
[PLASMA 2.1 ProDOS Boot & Install](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INST.po?raw=true)
[PLASMA 2.1 System Libraries](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-SYS.po?raw=true)
[PLASMA 2.1 Build Tools](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-BLD.po?raw=true)
[PLASMA 2.1 Demos](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-DEMOS.po?raw=true)
[PLASMA 2.1 TCP/IP network modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-INET.po?raw=true)
[PLASMA 2.1 Apple /// SOS and SANE floating point modules](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA-2.1-FPSOS.po?raw=true)
[PLASMA 2.1 Apple /// SOS Mame Boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLASMA2-A3MAME.PO?raw=true)
[PLASMA 2.1 Apple /// Mame hard disk image](https://github.com/dschmenk/PLASMA/blob/master/images/apple/apple3.hd?raw=true)
[PLASMA 2.1 PLFORTH stand-alone boot](https://github.com/dschmenk/PLASMA/blob/master/images/apple/PLFORTH.PO?raw=true)
PLASMA now has a ProDOS hard disk install script. Mass storage is the recommended installation that looks like (replacing HARDISK with your volume name of choice) if you want to copy files yourself:
Boot & System Files => /HARDISK/PLASMA/
Build Files => /HARDISK/PLASMA/BLD/
Demo Files => /HARDISK/PLASMA/DEMOS/
Floating Point SANE Files => /HARDISK/PLASMA/SYS
INET Files => /HARDDISK/PLASMA/SYS
Use the System Utilities to copy the floppy images into the above mentioned directories.
## Apple 1
The Apple 1 is a very constrained system compared to the ][ and ///. It is required to have the CFFA1 disk adapter installed to provide file storage and a full 32K od RAM. To get the files onto the CF card required the use of [CiderPress](http://a2ciderpress.com) and they must be placed in one directory. Most PLASMA programs won't work on the Apple 1 due to limited filesystem support, video/graphics capabilities, and lack of audio output. It does, however, make a good place to start when porting PLASMA to a new platform.
## Apple ][
To boot directly into PLASMA, you will need to put the system files in the root prefix of the boot device and make sure PLASMA.SYSTEM is the first SYSTEM file in the directory. Otherwise, start PLASMA.SYSTEM from your program launcher of choice. All Apple ][ models with 64K and two floppy drives are supported up to a maxed out IIGS with accelerator and hard drive.
#### 65802/65816 Support
PLASMA can utilize the 16 bit features of the 65802 and 65816 processors to improve performance of the PLASMA VM operation. This is transparent to the programmer/user and doesn't make any additional memory or capabilities available to PLASMA. PLASMA will automatically run the most optimal VM for your configuration.
## Apple ///
The Apple /// gets the environment it always wanted: The ability to navigate the filesystem with a command line interface. The Apple /// always boots from the floppy drive, even if a hard disk is installed. `PLASMA2-A3MAME.PO` is an Apple 3 bootable disk containing the SOS.DRIVER configured for the [Apple 3 Ready-To-Run Mame environment](https://github.com/datajerk/apple3rtr). `apple3.hd` is the pre-installed PLASMA hard disk image set up for [Apple 3 Ready-to-Run](https://github.com/datajerk/apple3rtr). For a physical Apple 3, the PLASMA2-FPSOS.PO floppy should be updated with the SOS.DRIVER configured for the machine. Once booted, type `S /HARDISK/PLASMA` (or your install directory of choice) to change to, and set, the system directory. This can be automated by creating an `AUTORUN` file on the boot floppy with the above command in it.
## PLASMA Command Line Shell
PLASMA incorporates a very basic command line shell to facilitate navigating the filesystem and executing both SYSTEM/SOS programs and PLASMA modules. It has a few built-in commands:
| Command | Operation |
|:----------------------------:|-------------------------|
| C [PREFIX] | Catalog prefix
| P \<PREFIX\> | change to Prefix
| / | change to parent prefix
| V | show online Volumes
| S \<PREFIX\> | set System prefix*
| +SOS \<SOS.INTERP\> [PREFIX] | launch SOS interpreter*
| -\<SYSTEM PROGRAM\> [PARAMS] | launch SYSTEM program**
| +\<PLASMA MODULE\> [PARAMS] | exec PLASMA module
```
[Optional parameters]
<Required parameters>
* Apple /// only
** Apple ][ only
```
The shell is very brief with error messages. It is meant solely as a way to run programs that accept command line parameters and take up as little memory as possible. It does, however, provide a rich runtime for PLASMA modules.
## Included Modules
PLASMA comes with many library modules used by the tools, demos and sample code. The PLASMA system volume must remain in place for the duration of PLASMAs run otherwise it won't be able to find CMD or the system libraries. Probably the most useful included module is the editor. It is used for editing PLASMA source file, assembly source files, or any text file. Execute it with:
```
+ED [TEXT FILE] [GOTO LINE NUMBER]
```
The file manipulation utilities to copy, delete, rename, create directories, and change file type and aux type remove the need for external programs to do the same. PLASMA can now be installed with the tools included on the PLASMA2-SYS boot floppy. They are:
```
+COPY [-R] <SRCPATH>+ <DSTPATH>
+DEL [-R] <FILEPATH>
+REN <FILENAME> <NEWNAME>
+NEWDIR <NEWDIRECTORY>
+TYPE <FILENAME> [NEWTYPE [NEWAUX]]
+CAT [-R] <FILEPATH]
```
The ```-R``` option will operate on the directories recursively. Wildcard filenames can be specified with ```'*'``` matching zero or more characters, and ```'?'``` matching any character. When copying files to the current directory, ```=``` can be used as a shortcut.
## Compiler Modules
The build disk includes sample source, include files for the system modules, and the PLASMA compiler+optimizer modules. The compiler is invoked with:
```
+PLASM [-[W][O[2]] <SOURCE FILE> [OUTPUT FILE]
```
Compiler warnings are enabled with `-W`. The optional optimizer is enabled with `-O` and extra optimizations are enabled with `-O2`. The source code for a few sample programs are included. The big one, `RPNCALC.PLA`, is the sample RPN calculator that uses many of PLASMA's advanced features. The self-hosted compiler is the same compiler as the cross-compiler, just transcribed from C to PLASMA (yes, the self-hosted PLASMA compiler is written in PLASMA). It requires patience when compiling: it is a fairly large and extensive program.
## FORTH Module
New for version 2.1 is a FORTH language module capable of interpreting script files and interactive programming. Further documentation here: https://github.com/dschmenk/PLASMA/blob/master/doc/PLFORTH.md. Samples scripts are in /HARDISK/BLD/SCRIPTS
## Demos
There are some demo programs included for your perusal. Check out `ROGUE` for some diversion. You can find the documentation here: https://github.com/dschmenk/PLASMA/blob/master/doc/Rogue%20Instructions.md. A music sequencer to play through a MockingBoard if it is detected, or the built-in speaker if not. A minimal Web server if you have an Uthernet2 card (required). Try `SPIDERS`for some hires shoot'em-up action. Bug reports appreciated.
## Source Code
Most sample source code is included from the project. They build without alteration and should be a good starting point for further explorations. The header files for the included library modules are in the INC directory.
## Video Playlist
There is a [YouTube playlist](https://www.youtube.com/playlist?list=PLlPKgUMQbJ79VJvZRfv1CJQf4SP2Gw3yU) created for learning PLASMA.
## Issues
- All the modules and runtime are written mostly in PLASMA; the compiler and editor as well. This means that there may be some startup delay as the PLASMA module loader reads in the module dependencies and performs dynamic linking. But a 1 MHz, 8 bit CPU interpreting bytecodes is never going to match a modern computer. As noted earlier, an accelerator and mass storage are your (and PLASMA's) friend.
- All the project modules are included. They have been lightly tested.
- The Apple /// may not always report errors properly or at all.
- The documentation is sparse and incomplete. Yep, could use your help...
# Changes in PLASMA for 2.1 Release
1. Lots of small bug fixes in floating point, file copy and graphics libraries
2. MULT opcode speedup improvements
3. Overhaul 65802/65814 VM for better speed and compatibility with PLFORTH compilation
4. Many Apple /// improvements and bug fixes
5. Low memory fixes and tests
6. FORTH language support as a PLASMA module. Full accessabilit to PLASMA modules and libraries
7. Install script for ProDOS mass storage
# Changes in PLASMA for 2.0 Release
1. Fix command line buffer overflow
2. Use VBlank to blink editor cursor so not CPU speed dependent
3. Add ```=``` for ```+COPY``` current destination
4. Add //c support for DGRLIB and GRLIB wait-for-VBlank routines
# Changes in PLASMA for 2.0 Beta
1. Compilers allows for including self imported defines
2. Compilers fixed for local constants
3. Floating point string formatting fixes and improvements
4. Fiber library exports number of active fibers
# Changes in PLASMA for 2.0 Alpha 2
1. Self hosted compiler fixes for invalid array size constants
2. Ensure IDs in self hosted compiler are 31 characters significant
3. Fix bug COPY file parsing and move common routine into MATCHFILES
# Changes in PLASMA for 2.0 Alpha 1
1. Improved entry/exit for 128K Apple IIe //c
2. Improved entry for Apple ///
3. Improved entry and function calls for 16 bit VM
# Changes in PLASMA for 2.0 DP 4
1. Improved editor auto-indenting
2. Compiler fix for terneray operator precedence
3. Machine check for HGR library
# Changes in PLASMA for 2.0 DP 3
1. File manipulation utilities fixed for Apple /// SOS vs ProDOS differences
2. More optimizations for HiRes graphics libraries
3. Spiders From Mars hires demo game
# Changes in PLASMA for 2.0 DP 2
1. Many file manipulaition utilities (COPY, REName, NEWDIRectory, DELete, CATalog, TYPE)
2. New and updated libraries for lo-res. double lo-res and hi-res graphics w/ sprites
3. 32 bit integer library for those times when 16 bits just isn't enough
4. Apple /// improvements to other SOS.INTERP launching with SOS utility
5. Apple /// JIT VM for speed and non JIT version to free up global memory
6. Editor improvements
7. A couple small compiler optimizations
8. Needed to break out TCP/IP modules into seperate floppy image
9. Library changes require full install
# Changes in PLASMA for 2.0 DP 1z
1. Many fixes for the value zero - especially in 65802/65816 divide routine
# Changes in PLASMA for 2.0 DP 1 E+C
1. Greatly improved code editor and additional compiler stats
# Changes in PLASMA for 2.0 DP 1a
1. Fix interaction with JIT compiler and module load/unload
# Changes in PLASMA for 2.0 DP 1
1. Expanded bytecode for more efficient size/performance of programs
2. Just-In-Time Compiler for native code performance (6502 and 65816) for frequently called routines
3. Automatically identify and run most optimal VM for configuration
# Changes in PLASMA for 1.2
1. Add TFTPD TFTP server
2. Fix Uthernet 1 driver
3. Add mouse module
4. Fix IRQ issues for interrupt driven mouse driver
# Changes in PLASMA for 1.1
1. All known bugs are fixed
2. PLASM compiler received a little performance boost with an assembly language helper for ID/keyword lexical scanner
# Changes in PLASMA for 1.0
If you have been programming in PLASMA before, the 1.0 version has some major and minor changes that you should be aware of:
1. Case is no longer significant. Imported symbols were always upper case. Now, all symbols are treated as if they were upper case. You may find that some symbols clash with previously defined symbols of different case. Hey, we didn't need lower case in 1977 and we don't need it now. You kids, get off my lawn!
2. Modules are now first class citizens. Translation: importing a module adds a symbol with the module name. You can simply refer to a module's address with it's name. This is how a module's API table is accessed (instead of adding a variable of the same name in the IMPORT section).
3. Bytecode changes means previously compiled modules will crash. Rebuild.
4. `BYTE` and `WORD` have aliases that may improve readability of the code. `CHAR` (character) and `RES` (reserve) are synonyms for `BYTE`. `VAR` (variable) is a synonym for `WORD`. These aliases add no functionality. They are simply syntactic sugar to add context to the source code, but may cause problems if you've previously used the same names for identifiers.
5. When declaring variables, a base size can come after the type, and an array size can folllow the identifier. For instance:
```
res[10] a, b, c
```
will reserve three variables of 10 bytes each. Additionally:
```
res[10] v[5], w[3]
```
will reserve a total of 80 bytes (10 * 5 + 10 * 3). This would be useful when combined with a structure definition. One could:
```
res[t_record] patients[20]
```
to reserve an array of 20 patient records.
6. Ternary operator. Just like C and descendants, `??` and `::` allow for an if-then-else inside an expression:
```
puts(truth == TRUE ?? "TRUE" :: "FALSE")
```
7. Multiple value assignements. Multiple values can be returned from functions and listed on variable assignments:
```
def func#3 // Return 3 values
return 10, 20, 30
end
a, b, c = 1, 2, 3
c, d, f = func()
x, y = y, x // Swap x and y
```
8. `DROP` allows for explicit dropping of values. In the above `func()` example, if the middle value was the only one desired, the others can be ignored with:
```
drop, h, drop = func()
```
9. The compiler tracks parameter and return counts for functions. If the above `func()` were used without assigning all the return values, they would be dropped:
```
a = func() // Two values silently dropped
```
To generate compiler warning for this issue, and a few others, use the `-W` option when compiling.
10. Lambda (Anonymous) Functions. The ability to code a quick function in-line can be very powerful when used properly. Look here, https://en.wikipedia.org/wiki/Anonymous_function, for more information.
11. SANE (Standard Apple Numerics Environment) Floating Point Library. An extensive library (two, actually) of extended floating point (80 bit IEEE precision) functionality is suported. A wrapper library has been written to greatly simplify the interface to SANE. Look at the `RPNCALC.PLA` source code as an example.
12. Library Documentation. Preliminary documentation is available on the Wiki: https://github.com/dschmenk/PLASMA/wiki
13. Significant effort has gone into VM tuning and speeding up module loading/dynamic linking.
14. The VM zero page usage has changed. If you write assembly language routines, you will need to rebuild.
# Thanks
I wish to thank the people who have contributed the the PLASMA project. They have greatly improved the development of the language and documentation:
- Martin Haye: PLASMA programmer extraordinaire. Mr. Lawless Legends has requested many of the crucial features that set PLASMA apart.
- Steve F (ZornsLemma): Has taken the optimizer to new levels and his work on porting PLASMA to the Beeb are amazing: http://stardot.org.uk/forums/viewtopic.php?f=55&t=12306&sid=5a503c593f0698ebc31e590ac61b09fc
- Peter Ferrie: Assembly optimizer extraordinaire. He has made significant improvements into the code footprint in PLASMA so all the functionality can exist in just a few bytes.
- David Schmidt (DaveX): His help in documentation have made it much more accessible and professional. Of course any errors are all his. Just kidding, they're mine ;-)
- Andy Werner (6502.org): Catching the grammatical errors that I ain't no good at.
- John Brooks: Apple II Guru par excellence. His insights got 10% performance increase out of the VM.
Dave Schmenk
http://schmenk.is-a-geek.com

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,7 +2,7 @@ import cmdsys
//
// Useful values for everyone
//
const _SYSVER_ = $0210 // Version built against
const _SYSVER_ = $0100 // Version built against
const FALSE = 0
const TRUE = not FALSE
const NULL = 0
@@ -11,7 +11,7 @@ import cmdsys
//
const MACHID_CLOCK = $01
const MACHID_80COL = $02
const MACHID_MEM = $30
const MACHID_MEM = $03
const MACHID_64K = $20
const MACHID_128K = $30
const MACHID_MODEL = $C8
@@ -33,7 +33,6 @@ import cmdsys
const reshgr2 = $0020
const resxhgr1 = $0040
const resxhgr2 = $0080
const nojitc = $0100
//
// Module don't free memory
//
@@ -47,17 +46,8 @@ import cmdsys
word syspath
word cmdline
word modexec
word sysopen
word sysclose
word sysread
word syswrite
byte syserr
byte jitcount
byte jitsize
word sysexec[] // Apple II specific
byte refcons // Apple /// specific
byte devcons // Apple /// specific
word lookupsym
byte refcons
byte devcons
end
//
// CMD exported functions

16
src/inc/dgr.plh Normal file
View File

@@ -0,0 +1,16 @@
import dgr
word[] dgrbuff
predef dgrPlot(buff, x, y)#0
predef dgrHLin(buff, x1, x2, y)#0
predef dgrVLin(buff, x, y1, y2)#0
predef dgrBLT(buff, x, y, width, height, src)#0
predef dgrTile(buff, x, y, src)#0
predef dgrTileStr(buff, x, y, tilestr, strlen, tilebuff)#0
predef dgrFill(buff, x, y, tile)#0
predef dgrMode#1
predef txtMode#0
predef dgrShow(page)#1
predef dgrColor(clr)#0
predef dgrLine(buff, x1, y1, x2, y2)#0
predef dgrClear(buff, clr)#0
end

View File

@@ -1,19 +0,0 @@
import dgrlib
predef dgrPlot(x, y)#0
predef dgrHLin(x1, x2, y)#0
predef dgrVLin(y1, y2, x)#0
predef dgrBLT(x, y, width, height, src)#0
predef dgrTile(x, y, src)#0
predef dgrTileStr(x, y, tilestr, strlen, tilebuff)#0
predef dgrFill(x, y, tile)#0
predef dgrVLB#0
predef dgrClear(clr)#0
predef dgrMode(mode)#1
predef dgrShow(page)#1
predef dgrSwap#0
predef dgrDrawBuf(page)#0
predef dgrColor(clr)#0
const dgrPage1 = 0
const dgrPage2 = 1
const dgrOff = -1
end

View File

@@ -1,5 +1,4 @@
import fiber
predef fbrInit(numPool), fbrStop(fid)#0, fbrExit#0, fbrStart(defaddr, param)
predef fbrYield#0, fbrHalt#0, fbrResume(fid)#0
byte fbrCount
end

View File

@@ -18,27 +18,7 @@ import fileio
const FILE_ERR_INT_TBL_FULL = $25
const FILE_ERR_IO = $27
//
// File entry struc
//
struc t_fileentry
byte store_namelen
byte entry_name[15]
byte entry_type
word entry_keyptr
word entry_blocks
word entry_EOFL
byte entry_EOFH
word entry_create[2]
byte entry_version
byte entry_minver
byte entry_access
word entry_aux
word entry_mod[2]
word entry_headptr
end
//
// File info struc
//
struc t_fileinfo
byte file_access
byte file_type
@@ -57,9 +37,7 @@ import fileio
word getpfx
word setpfx
word getfileinfo
word setfileinfo
word geteof
word seteof
word iobufalloc
word open
word close
@@ -67,9 +45,7 @@ import fileio
word write
word create
word destroy
word rename
word newline
word online
word readblock
word writeblock
end

View File

@@ -6,7 +6,6 @@ const FPSTR_FIXED = 1 // Fixed count of fractional digits
const FPSTR_FLOAT = 0 // Floating count of fractional digits
const FPSTR_STRIP = 2 // Strip trailing fractional zeros
const FPSTR_EXP = 4 // Force exponential format
const FPSTR_FLEX = 8 // Flexible switch to EXP format if over/underflow
//
// Parse string into decrecord, return SANE conversion output
//

View File

@@ -1,19 +0,0 @@
import grlib
predef grPlot(x, y)#0
predef grHLin(x1, x2, y)#0
predef grVLin(y1, y2, x)#0
predef grBLT(x, y, width, height, src)#0
predef grTile(x, y, src)#0
predef grTileStr(x, y, tilestr, strlen, tilebuff)#0
predef grFill(x, y, tile)#0
predef dgrVLB#0
predef grClear(clr)#0
predef grMode(mode)#1
predef grShow(page)#1
predef grSwap#0
predef grDrawBuf(page)#0
predef grColor(clr)#0
const grPage1 = 0
const grPage2 = 1
const grOff = -1
end

View File

@@ -1,3 +0,0 @@
import hgrfont
predef hgrPutStr(x, y, strptr)#0
end

View File

@@ -1,27 +0,0 @@
import hgrlib
predef divmod7(x)#2
predef hgrPlot(x, y)#0
predef hgrOrPlot(x, y)#0
predef hgrXorPlot(x, y)#0
predef hgrHLin(x1, x2, y)#0
predef hgrVLin(y1, y2, x)#0
predef hgrXorHLin(x1, x2, y)#0
predef hgrXorVLin(y1, y2, x)#0
predef hgrRect(x1, y1, x2, y2)#0
predef hgrXorRect(x1, y1, x2, y2)#0
predef hgrBLT(x, y, width, height, srcptr)#0
predef hgrCopySrc(ofst, y, w, h, srcptr)#0
predef hgrAndSrc(ofst, y, w, h, srcptr)#0
predef hgrXorSrc(ofst, y, w, h, srcptr)#0
predef hgrOrSrc(ofst, y, w, h, srcptr)#0
predef hgrCopyDst(ofst, y, w, h, dstptr)#0
predef hgrMode(mode)#1
predef hgrClear#0
predef hgrShow(page)#1
predef hgrSwap#1
predef hgrDrawBuf(page)#1
predef hgrColor(clr)#0
const hgrPage1 = 0
const hgrPage2 = 1
const hgrOff = -1
end

View File

@@ -1,19 +0,0 @@
import hgrsprite
predef spriteCompile(w, h, xcenter, ycenter, srcptr)#1
predef spriteDup(sprtsrc)#1
predef spriteRead(filestr)#1
predef spriteSave(filestr, sprtptr)#1
predef spriteDraw(sprtptr)#0
predef spriteDrawXor(sprtptr)#0
predef spriteUnDraw(sprtptr)#0
predef spriteUnDrawXor(sprtptr)#0
predef spritePos(x, y, sprtptr)#0
predef spritePosIndex(x, y, i)#0
predef spriteUnDrawList#0
predef spriteUnDrawXorList#0
predef spriteDrawList#0
predef spriteDrawXorList#0
predef spriteAdd(i, sprtptr)#1
predef spriteDel(i)#1
predef spriteDrawBuf(page)#1
end

View File

@@ -1,9 +0,0 @@
import hgrtile
predef tileDraw(x, y, tileptr)#0
predef tileXorDraw(x, y, tileptr)#0
predef tileOrDraw(x, y, tileptr)#0
predef tileAndDraw(x, y, tileptr)#0
predef tileDrawStr(x, y, strptr, strlen, tileset)#0
predef tileFromText(txtpage, tileset)#0
predef tileDrawBuf(page)#1
end

View File

@@ -1,32 +0,0 @@
import int32
const t_i32 = 4
predef zero32#0
predef zext16to32#0
predef neg32#0
predef load32(i32ptr)#0
predef loadi16(imm16)#0
predef store32(i32ptr)#0
predef add32(i32ptr)#0
predef addi16(imm16)#0
predef sub32(i32ptr)#0
predef subi16(imm16)#0
predef shl32(imm8)#0
predef shr32(imm8)#0
predef mul32(i32ptr)#0
predef muli16(imm16)#0
predef div32(i32ptr)#2
predef divi16(imm16)#2
predef iseq32(i32ptr)#1
predef iseqi16(imm16)#1
predef isge32(i32ptr)#1
predef isgei16(imm16)#1
predef isle32(i32ptr)#1
predef islei16(imm16)#1
predef isgt32(i32ptr)#1
predef isgti16(imm16)#1
predef islt32(i32ptr)#1
predef islti16(imm16)#1
predef i32tos(i32ptr, strptr)#1
predef puti32(i32ptr)#0
end

View File

@@ -1,6 +0,0 @@
import lines
predef setlinespans(h, v)#0
predef linespans(x1, y1, x2, y2)#0
predef setlineplot(p)#0
predef line(x1, y1, x2, y2)#0
end

View File

@@ -1,3 +0,0 @@
import lz4
predef lz4Unpack(seq, seqend, buff, buffend)
end

View File

@@ -1,6 +0,0 @@
import matchfiles
predef matchName(src, exp)#1
predef matchList(pathptr, exp)#2
predef isWildName(exp)#1
predef fileFromPath(filestr, pathstr)#0
end

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,4 @@
include "inc/cmdsys.plh"
include "inc/conio.plh"
sysflags nojitc // Keep tone() from compiling and sounding different
//
// Handy constants.
//
@@ -35,6 +33,24 @@ const page2 = 1
//
const ENV_REG = $FFDF
//
// External interface.
//
struc t_conio
word keypressed
word getkey
word echo
word home
word gotoxy
word viewport
word texttype
word textmode
word grmode
word grcolor
word grplot
word tone
word rnd
end
//
// Predefined functions.
//
predef a2keypressed,a2home,a12echo(state),a2gotoxy(x,y),a2viewport(left, top, width, height),a2texttype(type)
@@ -80,7 +96,6 @@ word = $0850,$08D0,$0950,$09D0,$0A50,$0AD0,$0B50,$0BD0
byte textbwmode[] = 2, 16, 0
byte textclrmode[] = 2, 16, 1
byte grcharset[] = 1, 0, $7F, $7F, $7F, $7F, $00, $00, $00, $00
byte a3keyqueue = 0
//
// Random number for Apple 1 and III.
//
@@ -152,13 +167,7 @@ end
// Apple 1 routines.
//
def a1keypressed
return ^$D011 >= 128 ?? ^$D011 :: 0
end
def a1getkey
while not a1keypressed
randnum = randnum + 123
loop
return getc()
return ^$D011 >= 128
end
def a12echo(state)
return 0
@@ -205,7 +214,7 @@ end
// Apple II routines.
//
def a2keypressed
return ^keyboard >= 128 ?? ^keyboard :: 0
return ^keyboard >= 128
end
def a2home
//curshpos = 0
@@ -228,7 +237,7 @@ def a2viewport(left, top, width, height)
^$20 = left
^$21 = width
^$22 = top
^$23 = height + top
^$23 = height + top - 1
return a2gotoxy(0, 0)
end
def a2texttype(type)
@@ -285,22 +294,8 @@ def dev_status(devnum, code, list)
end
def a3keypressed
byte count
dev_status(cmdsys.devcons, 5, @count)
if count
a3keyqueue = getc
fin
return a3keyqueue ?? a3keyqueue | $80 :: 0
end
def a3getkey
byte keycode
repeat
randnum = randnum + 123
a3keypressed
keycode = a3keyqueue
until keycode
a3keyqueue = 0
return keycode
return count
end
def a3echo(state)
return dev_control(cmdsys.devcons, 11, @state)
@@ -383,6 +378,12 @@ end
//
// Apple 1 and III combined routines.
//
def a13getkey
while not conio:keypressed()
randnum = randnum + 123
loop
return getc()
end
def a13rnd
randnum = (randnum << 1) + randnum + 123
return randnum & $7FFF
@@ -393,7 +394,7 @@ end
when MACHID & MACHID_MODEL
is MACHID_III
conio:keypressed = @a3keypressed
conio:getkey = @a3getkey
conio:getkey = @a13getkey
conio:echo = @a3echo
conio:home = @a3home
conio:gotoxy = @a3gotoxy
@@ -406,7 +407,7 @@ when MACHID & MACHID_MODEL
break
is MACHID_I
conio:keypressed = @a1keypressed
conio:getkey = @a1getkey
conio:getkey = @a13getkey
conio:home = @a1home
conio:gotoxy = @a1gotoxy
conio:viewport = @a1viewport
@@ -418,8 +419,4 @@ when MACHID & MACHID_MODEL
break
otherwise // MACHID_II puts("Found MACHID_MODEL = $"); putb(MACHID & MACHID_MODEL); putln
wend
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,4 +1,5 @@
include "inc/cmdsys.plh"
sysflags restxt1|restxt2|resxtxt1|resxtxt2 // Reserve all text pages
//
// Apple II hardware constants.
//
@@ -23,15 +24,13 @@ const page2 = 1
//
// Screen row address arrays.
//
word[] dgr1row = $0400,$0480,$0500,$0580,$0600,$0680,$0700,$0780
word = $0428,$04A8,$0528,$05A8,$0628,$06A8,$0728,$07A8
word = $0450,$04D0,$0550,$05D0,$0650,$06D0,$0750,$07D0
word[] dgr2row = $0800,$0880,$0900,$0980,$0A00,$0A80,$0B00,$0B80
word = $0828,$08A8,$0928,$09A8,$0A28,$0AA8,$0B28,$0BA8
word = $0850,$08D0,$0950,$09D0,$0A50,$0AD0,$0B50,$0BD0
word[] dgrbuff = @dgr1row, @dgr2row
word drawbuff
byte drawpage
word[] dgr1rows = $0400,$0480,$0500,$0580,$0600,$0680,$0700,$0780
word = $0428,$04A8,$0528,$05A8,$0628,$06A8,$0728,$07A8
word = $0450,$04D0,$0550,$05D0,$0650,$06D0,$0750,$07D0
word[] dgr2rows = $0800,$0880,$0900,$0980,$0A00,$0A80,$0B00,$0B80
word = $0828,$08A8,$0928,$09A8,$0A28,$0AA8,$0B28,$0BA8
word = $0850,$08D0,$0950,$09D0,$0A50,$0AD0,$0B50,$0BD0
export word[] dgrbuff = @dgr1rows, @dgr2rows
//
// Color mapping.
//
@@ -50,13 +49,13 @@ end
//
// Plot pixel
//
export asm dgrPlot(x, y)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA SRCL
LDA $3001
STA SRCH
export asm dgrPlot(buff, x, y)#0
; GET BUFFER ADDRESS
STX ESP
LDA ESTKL+2,X
STA SRCL
LDA ESTKH+2,X
STA SRCH
LDA ESTKL,X ; Y COORD
AND #$FE
TAY
@@ -77,21 +76,22 @@ asm _dgrPlotPix
LDX ESP
INX
INX
INX
RTS
end
//
// Plot horizontal row of pixels
//
export asm dgrHLin(x1, x2, y)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA SRCL
LDA $3001
STA SRCH
export asm dgrHLin(buff, x1, x2, y)#0
; GET BUFFER ADDRESS
STX ESP
LDA ESTKL+3,X
STA SRCL
LDA ESTKH+3,X
STA SRCH
LDA ESTKL+1,X ; X2 COORD
STA TMPH
LDA ESTKL+0,X ; Y COORD
LDA ESTKL,X ; Y COORD
AND #$FE
TAY
LDA (SRC),Y
@@ -102,7 +102,7 @@ export asm dgrHLin(x1, x2, y)#0
LDY ESTKL+2,X ; X1 COORD
PHP
SEI
- LDA ESTKL+0,X ; Y COORD
- LDA ESTKL,X
LSR
TYA
LDX GCLR ; COLOR
@@ -119,19 +119,20 @@ asm _dgrHLinPix
INX
INX
INX
INX
RTS
end
//
// Plot horizontal row of pixels
//
export asm dgrVLin(y1, y2, x)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA SRCL
LDA $3001
STA SRCH
export asm dgrVLin(buff, x, y1, y2)#0
; GET BUFFER ADDRESS
STX ESP
LDA ESTKL+2,X ; Y1 COORD
LDA ESTKL+3,X
STA SRCL
LDA ESTKH+3,X
STA SRCH
LDA ESTKL+1,X ; Y1 COORD
PHP
SEI
- AND #$FE
@@ -141,38 +142,38 @@ export asm dgrVLin(y1, y2, x)#0
INY
LDA (SRC),Y
STA GBASH
LDA ESTKL+2,X
LDA ESTKL+1,X
LSR
LDA ESTKL+0,X ; X COORD
LDA ESTKL+2,X ; X COORD
LDX GCLR ; COLOR
end
asm _dgrVLinPix
JSR $3000 ; _dgrSetPix
LDX ESP
INC ESTKL+2,X ; Y1 COORD
LDA ESTKL+2,X
CMP ESTKL+1,X ; Y2 COORD
INC ESTKL+1,X ; Y1 COORD
LDA ESTKL+1,X
CMP ESTKL,X ; Y2 COORD
BCC -
BEQ -
PLP
INX
INX
INX
INX
RTS
end
//
// Draw sprite
//
export asm dgrBLT(x, y, width, height, src)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA DSTL
LDA $3001
STA DSTH
export asm dgrBLT(buff, x, y, width, height, src)#0
LDA ESTKL,X ; SPRITE
STA SRCL
LDA ESTKH,X
STA SRCH
LDA ESTKL+5,X
STA DSTL
LDA ESTKH+5,X
STA DSTH
LDA ESTKL+4,X ; X1 COORD
CMP #80
BPL ++++
@@ -196,8 +197,9 @@ export asm dgrBLT(x, y, width, height, src)#0
CLC
ADC ESTKL+2,X ; WIDTH
STA SRCL
BCC +++
INC SRCH
LDA SRCH
ADC #$00
STA SRCH
BNE +++
+ AND #$FE
TAY
@@ -243,6 +245,7 @@ asm _dgrBLTPix
INX
INX
INX
INX
RTS
end
//
@@ -323,17 +326,16 @@ end
//
// Draw 8x8 tile (forced to 2x2 block address)
//
export asm dgrTile(x, y, src)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA DSTL
LDA $3001
STA DSTH
export asm dgrTile(buff, x, y, src)#0
STX ESP
LDA ESTKL,X ; TILE
STA SRCL
LDA ESTKH,X
STA SRCH
LDA ESTKL+3,X
STA DSTL
LDA ESTKH+3,X
STA DSTH
LDA ESTKL+2,X ; X1 COORD
CMP #80
BPL ++++
@@ -355,8 +357,9 @@ export asm dgrTile(x, y, src)#0
LDA SRCL ; SKIP TO NEXT ROW
ADC #$07 ; CARRY = 1
STA SRCL
BCC +++
INC SRCH
LDA SRCH
ADC #$00
STA SRCH
BNE +++
+ AND #$FE
TAY
@@ -389,9 +392,9 @@ export asm dgrTile(x, y, src)#0
STA (GBASE),Y
++ INC TMPH ; X COORD
INC TMPH ; X COORD
LDX ESP
LDA TMPH
BMI --
LDX ESP
CMP ESTKH+2,X ; X2 COORD
BCC --
PLP
@@ -402,6 +405,7 @@ export asm dgrTile(x, y, src)#0
CMP ESTKH+1,X ; Y2 COORD
BCC -
++++ INX
INX
INX
INX
RTS
@@ -409,17 +413,22 @@ end
//
// Draw a string of tiles
//
export asm dgrTileStr(x, y, tilestr, strlen, tilebuff)#0
export asm dgrTileStr(buff, x, y, tilestr, strlen, tilebuff)#0
- DEX
DEX
DEX
LDA ESTKL+7,X ; X COORD
DEX
LDA ESTKL+9,X ; BUFF
STA ESTKL+3,X
LDA ESTKH+9,X
STA ESTKH+3,X
LDA ESTKL+8,X ; X COORD
STA ESTKL+2,X
LDA ESTKL+6,X ; Y COORD
LDA ESTKL+7,X ; Y COORD
STA ESTKL+1,X
LDA ESTKL+3,X ; TILE
LDA ESTKL+4,X ; TILE
STA ESTKL,X
LDA ESTKH+3,X ; TILE
LDA ESTKH+4,X ; TILE
STA ESTKH,X
end
asm _dgrTileTile
@@ -432,17 +441,16 @@ asm _dgrTileTile
STA ESTKL+4,X
DEC ESTKL+1,X ; DEC STRLEN
BNE -
+ INX
INX
INX
INX
INX
+ TXA
CLC
ADC #6
TAX
RTS
end
//
// Fill a buffer with tiles
//
export asm dgrFill(x, y, tile)#0
export asm dgrFill(buff, x, y, tile)#0
LDA ESTKL+2,X
AND #$0F
STA ESTKL+2,X
@@ -461,13 +469,18 @@ export asm dgrFill(x, y, tile)#0
- DEX
DEX
DEX
LDA ESTKL+5,X ; X COORD
DEX
LDA ESTKL+7,X ; BUFF
STA ESTKL+3,X
LDA ESTKH+7,X
STA ESTKH+3,X
LDA ESTKL+6,X ; X COORD
STA ESTKL+2,X
LDA ESTKL+4,X ; Y COORD
LDA ESTKL+5,X ; Y COORD
STA ESTKL+1,X
LDA ESTKL+3,X ; TILE
LDA ESTKL+4,X ; TILE
STA ESTKL,X
LDA ESTKH+3,X ; TILE
LDA ESTKH+4,X ; TILE
STA ESTKH,X
end
asm _dgrFillTile
@@ -489,79 +502,43 @@ asm _dgrFillTile
INX
INX
INX
INX
RTS
end
//
// Wait for VLB
// Wait for VLB - Shouldn't work on //c, but seems to.
//
export asm dgrVLB#0
PHP
SEI
STA $C079 ; Enable IOU access and reset VBL int on //c
STA $C05B ; Enable VBL int
asm vlbWait#0
- LDA $C019
STA $C079 ; Reset VBL int on //c
BMI -
- LDA $C019
BPL -
STA $C05A ; Disable VBL int on //c
STA $C078 ; Disable IOU access on //c
PLP
RTS
end
//
// Clear the buffer
// Set double lores graphics, return draw buffer
//
export def dgrClear(clr)#0
byte[32] clrtile
clr = evnclr[clr&$0F] | (oddclr[clr&$0F] << 8)
memset(@clrtile, clr, 32)
dgrFill(0, 0, @clrtile)
export def dgrMode#1
^showlores
^showfull
^showgraphics
^showpage1
^ena80 = 0
^show80 = 0
^an3on
return 1
end
export def dgrMode(mode)#1
when mode
is page1
//
// Set double lores graphics, return draw buffer
//
^showlores
^showfull
^showgraphics
^showpage1
^ena80 = 0
^show80 = 0
^an3on
drawpage = page2
drawbuff = dgrbuff[page2]
break
is page2
//
// Set double lores graphics, return draw buffer
//
^showlores
^showfull
^showgraphics
^showpage1
^ena80 = 0
^show80 = 0
^an3on
drawpage = page1
drawbuff = dgrbuff[page1]
break
otherwise
//
// Set text mode
//
^showtext
^showpage1
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3off
call($FC58, 0, 0, 0, 0) // home()
wend
return mode
//
// Set text mode
//
export def txtMode#0
^showtext
^showpage1
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3off
call($FC58, 0, 0, 0, 0) // home()
end
//
// Set display page, return other page
@@ -571,15 +548,6 @@ export def dgrShow(page)#1
^(showpage1 + page)
return page ^ 1
end
export def dgrSwap#0
^(showpage1 + drawpage)
drawpage = drawpage ^ 1
drawbuff = dgrbuff[drawpage]
end
export def dgrDrawBuf(page)#0
drawpage = page
drawbuff = dgrbuff[drawpage]
end
//
// Set color for clear & plot routines
//
@@ -587,6 +555,91 @@ export def dgrColor(clr)#0
^$30 = clr & $0F
end
//
// Draw line
//
export def dgrLine(buff, x1, y1, x2, y2)#0
byte dx, dy, dx2, dy2, pp
word sx, sy, err, dd2
if x1 < x2
sx = 1
dx = x2 - x1
else
sx = -1
dx = x1 - x2
fin
if y1 < y2
sy = 1
dy = y2 - y1
else
sy = -1
dy = y1 - y2
fin
dx2 = dx << 1
dy2 = dy << 1
if dx >= dy // Horizontal line
if sx < 0
x1, x2 = x2, x1
y1, y2 = y2, y1
sy = -sy
fin
dd2 = dx2 - dy2
err = dx - dy2
sx = 1
while dy
if err < 0
dgrHLin(buff, x1, x1 + sx - 1, y1)
x1 = x1 + sx
y1 = y1 + sy
sx = 1
dy--
err = err + dd2
else
sx++
err = err - dy2
fin
loop
if y2 == y1
dgrHLin(buff, x1, x2, y1)
fin
else // Vertical line
if sy < 0
x1, x2 = x2, x1
y1, y2 = y2, y1
sx = -sx
fin
dd2 = dy2 - dx2
err = dy - dx2
sy = 1
while dx
if err < 0
dgrVLin(buff, x1, y1, y1 + sy - 1)
x1 = x1 + sx
y1 = y1 + sy
sy = 1
dx--
err = err + dd2
else
sy++
err = err - dx2
fin
loop
if x2 == x1
dgrVLin(buff, x1, y1, y2)
fin
fin
end
//
// Clear the buffer
//
export def dgrClear(buff, clr)#0
byte[32] clrtile
clr = evnclr[clr&$0F] | (oddclr[clr&$0F] << 8)
memset(@clrtile, clr, 32)
dgrFill(buff, 0, 0, @clrtile)
end
//
// Make sure we are a 128K //e or //c
//
if MACHID & $F0 <> $B0
@@ -608,23 +661,6 @@ _dgrSetEvnEvn:1 = @evnclr
_dgrSetEvnOdd:1 = @oddclr
_dgrSetOddEvn:1 = @evnclr
_dgrSetOddOdd:1 = @oddclr
//
// Fixups for drawbuff
//
dgrPlot:1 = @drawbuff
dgrPlot:6 = @drawbuff+1
dgrHLin:1 = @drawbuff
dgrHLin:6 = @drawbuff+1
dgrVLin:1 = @drawbuff
dgrVLin:6 = @drawbuff+1
dgrBLT:1 = @drawbuff
dgrBLT:6 = @drawbuff+1
dgrTile:1 = @drawbuff
dgrTile:6 = @drawbuff+1
// Put read AUX mem routine in scary location
memcpy($0100, @auxRead, 9)
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,5 +1,4 @@
include "inc/cmdsys.plh"
include "inc/fileio.plh"
//
// CFFA1 addresses.
//
@@ -23,16 +22,32 @@ const sysbuf = $0800
//
// External interface
//
predef a2getpfx(path), a2setpfx(path), a2getfileinfo(path, fileinfo), a2setfileinfo(path, fileinfo), a23geteof(refnum)#2, a23seteof(refnum, eofl, eofh), a2iobufs(iobufs), a2open(path), a2close(refnum)
predef a23read(refnum, buf, len), a2write(refnum, buf, len), a2create(path, type, aux), a23destroy(path), a23rename(path, newpath)
predef a2newline(refnum, emask, nlchar), a2online(unit, buf), a2readblock(unit, buf, block), a2writeblock(unit, buf, block)
struc t_fileio
word getpfx
word setpfx
word getfileinfo
word geteof
word iobufalloc
word open
word close
word read
word write
word create
word destroy
word newline
word readblock
word writeblock
end
predef a2getpfx(path), a23setpfx(path), a2getfileinfo(path, fileinfo), a23geteof(refnum), a2iobufs(iobufs), a2open(path), a2close(refnum)
predef a23read(refnum, buf, len), a2write(refnum, buf, len), a2create(path, type, aux), a23destroy(path)
predef a2newline(refnum, emask, nlchar), a2readblock(unit, buf, block), a2writeblock(unit, buf, block)
//
// Exported function table.
//
word fileio[]
word = @a2getpfx, @a2setpfx, @a2getfileinfo, @a2setfileinfo, @a23geteof, @a23seteof, @a2iobufs, @a2open, @a2close
word = @a23read, @a2write, @a2create, @a23destroy, @a23rename
word = @a2newline, @a2online, @a2readblock, @a2writeblock
word = @a2getpfx, @a23setpfx, @a2getfileinfo, @a23geteof, @a2iobufs, @a2open, @a2close
word = @a23read, @a2write, @a2create, @a23destroy
word = @a2newline, @a2readblock, @a2writeblock
//
// SOS/ProDOS error code
//
@@ -60,7 +75,7 @@ def a2getpfx(path)
return path
end
def a3getpfx(path)
byte params[4]
byte params[3]
params.0 = 2
params:1 = path
@@ -71,7 +86,7 @@ end
def a1setpfx(path)
return path
end
def a2setpfx(path)
def a23setpfx(path)
byte params[3]
params.0 = 1
@@ -79,29 +94,6 @@ def a2setpfx(path)
perr = syscall($C6, @params)
return path
end
def a3setpfx(path)
byte params[6]
byte fileinfo[2]
char fullpath[65]
if ^path and ^(path + 1) <> '/' and ^(path + 1) <> '.'
a3getpfx(@fullpath)
strcat(@fullpath, path)
path = @fullpath
fin
params.0 = 3
params:1 = path
params:3 = @fileinfo
params.5 = 2
if not syscall($C4, @params) and (fileinfo.1 == $00 or fileinfo.1 == $0F) // Make sure it's a directory
params.0 = 1
params:1 = path
syscall($C6, @params)
else
a3getpfx(path) // Get current path
fin
return path
end
def a1getfileinfo(path, fileinfo)
perr = $01
return perr
@@ -125,53 +117,17 @@ def a3getfileinfo(path, fileinfo)
perr = syscall($C4, @params)
return perr
end
def a1setfileinfo(path, fileinfo)
perr = $01
return perr
def a1geteof(refnum)
return 0
end
def a2setfileinfo(path, fileinfo)
byte params[14]
params.0 = 7
params:1 = path
memcpy(@params + 3, fileinfo, 11)
perr = syscall($C3, @params)
return perr
end
def a3setfileinfo(path, fileinfo)
def a23geteof(refnum)
byte params[6]
params.0 = 3
params:1 = path
params:3 = fileinfo
params.5 = 15
perr = syscall($C3, @params)
return perr
end
def a1geteof(refnum)#2
return 0, 0
end
def a23geteof(refnum)#2
byte params[5]
params.0 = 2
params.1 = refnum
params:2 = 0
params.4 = 0
params:4 = 0
syscall($D1, @params)
return params:2, params.4
end
def a1seteof(refnum, eofl, eofh)
return 0
end
def a23seteof(refnum, eofl, eofh)
byte params[5]
params.0 = 2
params.1 = refnum
params:2 = eofl
params.4 = eofh
syscall($D0, @params)
return params:2
end
def a1open(path)
@@ -213,9 +169,9 @@ def a13iobufs(iobufs)
end
def a2open(path)
byte i, params[6]
for i = MAX_IOBUFS-1 downto 0
if iobuf_addr[i] and not iobuf_ref[i]
for i = 0 to MAX_IOBUFS-1
if iobuf_addr[i] and not iobuf_ref[i]
params.0 = 3
params:1 = path
params:3 = iobuf_addr[i]
@@ -244,7 +200,7 @@ end
def a2close(refnum)
byte i, params[2]
for i = MAX_IOBUFS-1 downto 0
for i = 0 to MAX_IOBUFS-1
if refnum == iobuf_ref[i]
iobuf_ref[i] = 0
params.0 = 1
@@ -302,7 +258,7 @@ def a3write(refnum, buff, len)
params:2 = buff
params:4 = len
perr = syscall($CB, @params)
return perr ?? 0 :: len
return perr
end
def a1create(path, type, aux)
return perr
@@ -315,7 +271,7 @@ def a2create(path, type, aux)
params.3 = $C3
params.4 = type
params:5 = aux
params.7 = type == $0F ?? $0D :: $01
params.7 = $1
params:8 = 0
params:10 = 0
perr = syscall($C0, @params)
@@ -328,15 +284,13 @@ def a3create(path, type, aux)
params.0 = 3
params:1 = path
params:3 = @options
params.5 = 4
params.5 = 3
options.0 = type
options:1 = aux
options.3 = type == $0F ?? $0D :: $01
perr = syscall($C0, @params)
return perr
end
def a1destroy(path)
perr = $01
return perr
end
def a23destroy(path)
@@ -347,19 +301,6 @@ def a23destroy(path)
perr = syscall($C1, @params)
return perr
end
def a1rename(oldpath, newpath)
perr = $01
return perr
end
def a23rename(path, newpath)
byte params[5]
params.0 = 2
params:1 = path
params:3 = newpath
perr = syscall($C2, @params)
return perr
end
def a1newline(refnum, emask, nlchar)
return perr
end
@@ -383,57 +324,6 @@ def a3newline(refnum, emask, nlchar)
perr = syscall($C9, @params)
return perr
end
def a1online(unit, buf)
perr = $27 // IOERR
return perr
end
def a2online(unit, buf)
byte params[4]
params.0 = 2
params.1 = unit
params:2 = buf
perr = syscall($C5, @params)
return perr
end
def a3volume(unit, volname)
byte devname[17]
byte info[11]
byte params[9]
^volname = 0
params.0 = 4
params.1 = unit
params:2 = @devname
params:4 = @info
params.6 = 11
if syscall($85, @params) == 0
params.0 = 4
params:1 = @devname
params:3 = volname
params:5 = 0
params:7 = 0
return syscall($C5, @params)
fin
return -1
end
def a3online(unit, buf)
byte info[11]
byte volname[17]
byte i
if unit == 0
for i = $01 to $0F
if a3volume(i, buf) == 0
^buf = ^buf | (i << 4)
fin
buf = buf + 16
next
else
return a3volume(unit, buf)
fin
return 0
end
def a13readblock(unit, buf, block)
perr = $27 // IOERR
return perr
@@ -468,16 +358,13 @@ end
when MACHID & MACHID_MODEL
is MACHID_III
fileio:getpfx = @a3getpfx
fileio:setpfx = @a3setpfx
fileio:getfileinfo = @a3getfileinfo
fileio:setfileinfo = @a3setfileinfo
fileio:iobufalloc = @a13iobufs
fileio:open = @a3open
fileio:close = @a3close
fileio:write = @a3write
fileio:create = @a3create
fileio:newline = @a3newline
fileio:online = @a3online
fileio:readblock = @a13readblock
fileio:writeblock = @a13writeblock
break
@@ -485,9 +372,7 @@ when MACHID & MACHID_MODEL
fileio:getpfx = @a1getpfx
fileio:setpfx = @a1setpfx
fileio:getfileinfo = @a1getfileinfo
fileio:setfileinfo = @a1setfileinfo
fileio:geteof = @a1geteof
fileio:seteof = @a1seteof
fileio:iobufalloc = @a13iobufs
fileio:open = @a1open
fileio:close = @a1close
@@ -495,16 +380,10 @@ when MACHID & MACHID_MODEL
fileio:write = @a1write
fileio:create = @a1create
fileio:destroy = @a1destroy
fileio:rename = @a1rename
fileio:newline = @a1newline
fileio:online = @a1online
fileio:readblock = @a13readblock
fileio:writeblock = @a13writeblock
break
otherwise // Apple ][
wend
//
// Keep module in memory
//
return modkeep
done

View File

@@ -2,7 +2,6 @@ include "inc/cmdsys.plh"
byte gfxref, gfxseg
byte params[8], cmd[16]
byte textmode[] = 16, 0, 15
export def pencolor(clr)#0
params:4 = 2
@@ -113,31 +112,6 @@ export def drawmode(mode)#0
syscall($CB, @params)
end
def gfxopen#1
//
// Allocate bank 0
//
params.0 = 4
params:1 = $2000
params:3 = $9F00
params.5 = $10
params.6 = $00
syscall($40, @params)
gfxseg = params.6
^$1907 = $80 // Set graphics pages allocated
//
// Open graphics driver
//
params.0 = 4
params:1 = ".GRAFIX"
params.3 = 0
params:4 = 0
params.6 = 0
syscall($C8, @params)
gfxref = params.3
return gfxref <> 0
end
export def setmode(mode)#0
if mode < 0
//
@@ -148,19 +122,15 @@ export def setmode(mode)#0
syscall($CC, @params)
gfxref = 0
//
// Deallocate bank 0
// Deaalocate bank 0
//
params.0 = 1
params.1 = gfxseg
syscall($45, @params)
^$1907 = $00 // Unset graphics pages allocated
//
// Reset textmode
//
cmdsys:syswrite(cmdsys.refcons, @textmode, 3)
fin
if not gfxref
return
elsif not gfxref
gfxopen
fin
params.0 = 3
params.1 = gfxref
@@ -181,7 +151,24 @@ if MACHID <> $F2
return -1
fin
//
// Keep module in memory
// Allocate bank 0
//
return gfxopen ?? modkeep :: -1
params.0 = 4
params:1 = $2000
params:3 = $9F00
params.5 = $10
params.6 = $00
syscall($40, @params)
gfxseg = params.6
^$1907 = $80 // Set graphics pages allocated
//
// Open graphics driver
//
params.0 = 4
params:1 = ".GRAFIX"
params.3 = 0
params:4 = 0
params.6 = 0
syscall($C8, @params)
gfxref = params.3
done

View File

@@ -1,537 +0,0 @@
include "inc/cmdsys.plh"
//
// Apple II hardware constants.
//
const showgraphics = $C050
const showtext = $C051
const showfull = $C052
const showmix = $C053
const showpage1 = $C054
const showpage2 = $C055
const showlores = $C056
const showhires = $C057
const show40 = $C00C
const show80 = $C00D
const mapmain = $C000
const mapaux = $C001
const an3on = $C05E
const an3off = $C05F
const ena80 = $C07E
const dis80 = $C07F
const page1 = 0
const page2 = 1
//
// Screen row address arrays.
//
word[] gr1row = $0400,$0480,$0500,$0580,$0600,$0680,$0700,$0780
word = $0428,$04A8,$0528,$05A8,$0628,$06A8,$0728,$07A8
word = $0450,$04D0,$0550,$05D0,$0650,$06D0,$0750,$07D0
word[] gr2row = $0800,$0880,$0900,$0980,$0A00,$0A80,$0B00,$0B80
word = $0828,$08A8,$0928,$09A8,$0A28,$0AA8,$0B28,$0BA8
word = $0850,$08D0,$0950,$09D0,$0A50,$0AD0,$0B50,$0BD0
word[] grbuff = @gr1row, @gr2row
word drawbuff
byte drawpage
asm grInc(buff)
!SOURCE "vmsrc/plvmzp.inc"
GBASL = $26
GBASH = $27
GBASE = GBASL
GCLR = $30
end
//
// Plot pixel
//
export asm grPlot(x, y)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA SRCL
LDA $3001
STA SRCH
LDA ESTKL,X ; Y COORD
AND #$FE
TAY
LDA (SRC),Y
STA GBASL
INY
LDA (SRC),Y
STA GBASH
LDY ESTKL+1,X ; X COORD
LSR ESTKL,X
LDA GCLR ; COLOR
EOR (GBASE),Y
BCS +
; EVEN ROW
AND #$0F
BCC ++
; ODD ROW
+ AND #$F0
++ EOR (GBASE),Y
STA (GBASE),Y
INX
INX
RTS
end
//
// Plot horizontal row of pixels
//
export asm grHLin(x1, x2, y)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA SRCL
LDA $3001
STA SRCH
LDA ESTKL+1,X ; X2 COORD
STA TMPH
LDA ESTKL+0,X ; Y COORD
AND #$FE
TAY
LDA (SRC),Y
STA GBASL
INY
LDA (SRC),Y
STA GBASH
LDY ESTKL+2,X ; X1 COORD
- LDA ESTKL+0,X ; Y COORD
LSR
LDA GCLR ; COLOR
; EVEN ROW
EOR (GBASE),Y
BCS +
AND #$0F
BCC ++
; ODD ROW
+ AND #$F0
++ EOR (GBASE),Y
STA (GBASE),Y
INC ESTKL+2,X ; X1 COORD
LDY ESTKL+2,X
CPY TMPH ; X2 COORD
BCC -
BEQ -
INX
INX
INX
RTS
end
//
// Plot horizontal row of pixels
//
export asm grVLin(y1, y2, x)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA SRCL
LDA $3001
STA SRCH
LDA ESTKL+2,X ; Y1 COORD
- AND #$FE
TAY
LDA (SRC),Y
STA GBASL
INY
LDA (SRC),Y
STA GBASH
LDA ESTKL+2,X
LSR
LDY ESTKL+0,X ; X COORD
LDA GCLR ; COLOR
; EVEN ROW
EOR (GBASE),Y
BCS +
AND #$0F
BCC ++
; ODD ROW
+ AND #$F0
++ EOR (GBASE),Y
STA (GBASE),Y
INC ESTKL+2,X ; Y1 COORD
LDA ESTKL+2,X
CMP ESTKL+1,X ; Y2 COORD
BCC -
BEQ -
INX
INX
INX
RTS
end
//
// Draw sprite
//
export asm grBLT(x, y, width, height, src)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA DSTL
LDA $3001
STA DSTH
LDA ESTKL,X ; SPRITE
STA SRCL
LDA ESTKH,X
STA SRCH
LDA ESTKL+4,X ; X1 COORD
CMP #40
BPL ++++
CLC
ADC ESTKL+2,X
BMI ++++
STA ESTKH+2,X ; X2 COORD
LDA ESTKL+3,X ; Y1 COORD
CMP #48
BPL ++++
STA ESTKH+3,X ; Y COORD
CLC
ADC ESTKL+1,X
BMI ++++
STA ESTKH+1,X ; Y2 COORD
STX ESP
LDA ESTKH+3,X
- CMP #48
BCC +
LDA SRCL ; SKIP TO NEXT ROW
CLC
ADC ESTKL+2,X ; WIDTH
STA SRCL
LDA SRCH
ADC #$00
STA SRCH
BNE +++
+ AND #$FE
TAY
LDA (DST),Y
STA GBASL
INY
LDA (DST),Y
STA GBASH
LDA ESTKL+4,X ; X1 COORD
STA ESTKH+4,X ; X COORD
-- CMP #40
BCS ++
STA TMP
LDA ESTKH+3,X ; Y COORD
LSR
LDY #$00
LDA (SRC),Y
BMI ++
LDY TMP
BCS oddBLT
; EVEN ROW
EOR (GBASE),Y
AND #$0F
BCC evnBLT
; ODD ROW
oddBLT ASL
ASL
ASL
ASL
EOR (GBASE),Y
AND #$F0
evnBLT EOR (GBASE),Y
STA (GBASE),Y
++ INC SRCL
BNE +
INC SRCH
+ INC ESTKH+4,X ; X COORD
LDA ESTKH+4,X
BMI --
CMP ESTKH+2,X ; X2 COORD
BCC --
+++ INC ESTKH+3,X ; Y COORD
LDA ESTKH+3,X
BMI -
CMP ESTKH+1,X ; Y2 COORD
BCC -
++++ INX
INX
INX
INX
INX
RTS
end
//
// Draw 8x8 tile (forced to 1x2 block address)
//
export asm grTile(x, y, src)#0
; GET ROW BUFFER ADDRESSES
LDA $3000
STA DSTL
LDA $3001
STA DSTH
STX ESP
LDA ESTKL,X ; TILE
STA SRCL
LDA ESTKH,X
STA SRCH
LDA ESTKL+2,X ; X1 COORD
CMP #40
BPL ++++
CLC
ADC #$08
BMI ++++
STA ESTKH+2,X ; X2 COORD
LDA ESTKL+1,X ; Y1 COORD
CMP #48
BPL ++++
STA TMPL ; Y COORD
CLC
ADC #$08
BMI ++++
STA ESTKH+1,X ; Y2 COORD
LDA TMPL ; Y COORD
- CMP #48
BCC +
LDA SRCL ; SKIP TO NEXT ROW
ADC #$07 ; CARRY = 1
STA SRCL
LDA SRCH
ADC #$00
STA SRCH
BNE +++
+ AND #$FE
TAY
LDA (DST),Y
STA GBASL
INY
LDA (DST),Y
STA GBASH
LDA ESTKL+2,X ; X1 COORD
STA TMPH ; X COORD
-- TAY
CMP #40
LDX #$00
LDA (SRC,X)
INC SRCL
BNE +
INC SRCH
+ BCS ++
STA (GBASE),Y
++ INC TMPH ; X COORD
LDA TMPH
BMI --
LDX ESP
CMP ESTKH+2,X ; X2 COORD
BCC --
+++ INC TMPL ; Y COORD
INC TMPL ; Y COORD
LDA TMPL
BMI -
CMP ESTKH+1,X ; Y2 COORD
BCC -
++++ INX
INX
INX
RTS
end
//
// Draw a string of tiles
//
export asm grTileStr(x, y, tilestr, strlen, tilebuff)#0
- DEX
DEX
DEX
LDA ESTKL+7,X ; X COORD
STA ESTKL+2,X
LDA ESTKL+6,X ; Y COORD
STA ESTKL+1,X
LDA ESTKL+3,X ; TILE
STA ESTKL,X
LDA ESTKH+3,X ; TILE
STA ESTKH,X
end
asm _grTileTile
JSR $5000
LDA ESTKL+4,X ; UPDATE X COORD
CLC
ADC #$08
CMP #40 ; OFF RIGHT SIDE
BPL +
STA ESTKL+4,X
DEC ESTKL+1,X ; DEC STRLEN
BNE -
+ INX
INX
INX
INX
INX
RTS
end
//
// Fill a buffer with tiles
//
export asm grFill(x, y, tile)#0
LDA ESTKL+2,X
AND #$0F
STA ESTKL+2,X
LDA ESTKL+1,X
AND #$0F
STA ESTKL+1,X
LDA #$00
SEC
SBC ESTKL+2,X ; ORIGINAL X
STA ESTKL+2,X
STA ESTKH+2,X
LDA #$00
SEC
SBC ESTKL+1,X
STA ESTKL+1,X
- DEX
DEX
DEX
LDA ESTKL+5,X ; X COORD
STA ESTKL+2,X
LDA ESTKL+4,X ; Y COORD
STA ESTKL+1,X
LDA ESTKL+3,X ; TILE
STA ESTKL,X
LDA ESTKH+3,X ; TILE
STA ESTKH,X
end
asm _grFillTile
JSR $5000
LDA ESTKL+2,X ; UPDATE X COORD
CLC
ADC #$08
STA ESTKL+2,X
CMP #40 ; OFF RIGHT SIDE?
BMI -
LDA ESTKH+2,X ; RESTORE X COORD
STA ESTKL+2,X
LDA ESTKL+1,X ; UPDATE Y COORD
CLC
ADC #$08
STA ESTKL+1,X
CMP #48 ; OFF BOTTOM?
BMI -
INX
INX
INX
RTS
end
//
// Wait for VLB
//
export asm grVLB#0
LDA $BF98
AND #$C0
CMP #$80
BNE +
PHP
SEI
STA $C079 ; Enable IOU access and reset VBL int on //c
STA $C05B ; Enable VBL int
- LDA $C019
STA $C079 ; Reset VBL int on //c
BMI -
- LDA $C019
BPL -
STA $C05A ; Disable VBL int on //c
STA $C078 ; Disable IOU access on //c
PLP
+ RTS
end
//
// Clear the buffer
//
export def grClear(clr)#0
byte[32] clrtile
clr = (clr & $0F) | (clr << 4)
clr = (clr & $FF) | (clr << 8)
memset(@clrtile, clr, 32)
grFill(0, 0, @clrtile)
end
//
// Set lores graphics, return draw buffer
//
export def grMode(mode)#1
when mode
is page1
//
// Set GR mode
//
^showlores
^showfull
^showgraphics
^showpage1
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3off
drawpage = page2
drawbuff = grbuff[page2]
break
is page2
//
// Set GR mode
//
^showlores
^showfull
^showgraphics
^showpage2
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3off
drawpage = page1
drawbuff = grbuff[page1]
break
otherwise
//
// Set text mode
//
^showtext
^showpage1
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3off
call($FC58, 0, 0, 0, 0) // home()
wend
return mode
end
//
// Set display page, return other page
//
export def grShow(page)#1
page = page & 1
^(showpage1 + page)
return page ^ 1
end
export def grSwap#0
//vlbWait
^(showpage1 + drawpage)
drawpage = drawpage ^ 1
drawbuff = grbuff[drawpage]
end
export def grDrawBuf(page)#0
drawpage = page
drawbuff = grbuff[drawpage]
end
//
// Set color for clear & plot routines
//
export def grColor(clr)#0
^$30 = (clr & $0F) | (clr << 4)
end
//
// Assembly fixups
//
_grTileTile:1 = @grTile
_grFillTile:1 = @grTile
//
// Fixups for drawbuff
//
grPlot:1 = @drawbuff
grPlot:6 = @drawbuff+1
grHLin:1 = @drawbuff
grHLin:6 = @drawbuff+1
grVLin:1 = @drawbuff
grVLin:6 = @drawbuff+1
grBLT:1 = @drawbuff
grBLT:6 = @drawbuff+1
grTile:1 = @drawbuff
grTile:6 = @drawbuff+1
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,145 +0,0 @@
include "inc/cmdsys.plh"
include "inc/hgrtile.plh"
//
// Apple //e hires character font
//
byte hgrFont[]
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$00,$08,$00
byte = $14,$14,$14,$00,$00,$00,$00,$00,$14,$14,$3E,$14,$3E,$14,$14,$00
byte = $08,$3C,$0A,$1C,$28,$1E,$08,$00,$06,$26,$10,$08,$04,$32,$30,$00
byte = $04,$0A,$0A,$04,$2A,$12,$2C,$00,$08,$08,$08,$00,$00,$00,$00,$00
byte = $08,$04,$02,$02,$02,$04,$08,$00,$08,$10,$20,$20,$20,$10,$08,$00
byte = $08,$2A,$1C,$08,$1C,$2A,$08,$00,$00,$08,$08,$3E,$08,$08,$00,$00
byte = $00,$00,$00,$00,$08,$08,$04,$00,$00,$00,$00,$3E,$00,$00,$00,$00
byte = $00,$00,$00,$00,$00,$00,$08,$00,$00,$20,$10,$08,$04,$02,$00,$00
byte = $1C,$22,$32,$2A,$26,$22,$1C,$00,$08,$0C,$08,$08,$08,$08,$1C,$00
byte = $1C,$22,$20,$18,$04,$02,$3E,$00,$3E,$20,$10,$18,$20,$22,$1C,$00
byte = $10,$18,$14,$12,$3E,$10,$10,$00,$3E,$02,$1E,$20,$20,$22,$1C,$00
byte = $38,$04,$02,$1E,$22,$22,$1C,$00,$3E,$20,$10,$08,$04,$04,$04,$00
byte = $1C,$22,$22,$1C,$22,$22,$1C,$00,$1C,$22,$22,$3C,$20,$10,$0E,$00
byte = $00,$00,$08,$00,$08,$00,$00,$00,$00,$00,$08,$00,$08,$08,$04,$00
byte = $10,$08,$04,$02,$04,$08,$10,$00,$00,$00,$3E,$00,$3E,$00,$00,$00
byte = $04,$08,$10,$20,$10,$08,$04,$00,$1C,$22,$10,$08,$08,$00,$08,$00
byte = $1C,$22,$2A,$3A,$1A,$02,$3C,$00,$08,$14,$22,$22,$3E,$22,$22,$00
byte = $1E,$22,$22,$1E,$22,$22,$1E,$00,$1C,$22,$02,$02,$02,$22,$1C,$00
byte = $1E,$22,$22,$22,$22,$22,$1E,$00,$3E,$02,$02,$1E,$02,$02,$3E,$00
byte = $3E,$02,$02,$1E,$02,$02,$02,$00,$3C,$02,$02,$02,$32,$22,$3C,$00
byte = $22,$22,$22,$3E,$22,$22,$22,$00,$1C,$08,$08,$08,$08,$08,$1C,$00
byte = $20,$20,$20,$20,$20,$22,$1C,$00,$22,$12,$0A,$06,$0A,$12,$22,$00
byte = $02,$02,$02,$02,$02,$02,$3E,$00,$22,$36,$2A,$2A,$22,$22,$22,$00
byte = $22,$22,$26,$2A,$32,$22,$22,$00,$1C,$22,$22,$22,$22,$22,$1C,$00
byte = $1E,$22,$22,$1E,$02,$02,$02,$00,$1C,$22,$22,$22,$2A,$12,$2C,$00
byte = $1E,$22,$22,$1E,$0A,$12,$22,$00,$1C,$22,$02,$1C,$20,$22,$1C,$00
byte = $3E,$08,$08,$08,$08,$08,$08,$00,$22,$22,$22,$22,$22,$22,$1C,$00
byte = $22,$22,$22,$22,$22,$14,$08,$00,$22,$22,$22,$2A,$2A,$36,$22,$00
byte = $22,$22,$14,$08,$14,$22,$22,$00,$22,$22,$14,$08,$08,$08,$08,$00
byte = $3E,$20,$10,$08,$04,$02,$3E,$00,$3E,$06,$06,$06,$06,$06,$3E,$00
byte = $00,$02,$04,$08,$10,$20,$00,$00,$3E,$30,$30,$30,$30,$30,$3E,$00
byte = $00,$00,$08,$14,$22,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7F
byte = $04,$08,$10,$00,$00,$00,$00,$00,$00,$00,$1C,$20,$3C,$22,$3C,$00
byte = $02,$02,$1E,$22,$22,$22,$1E,$00,$00,$00,$3C,$02,$02,$02,$3C,$00
byte = $20,$20,$3C,$22,$22,$22,$3C,$00,$00,$00,$1C,$22,$3E,$02,$3C,$00
byte = $18,$24,$04,$1E,$04,$04,$04,$00,$00,$00,$1C,$22,$22,$3C,$20,$1C
byte = $02,$02,$1E,$22,$22,$22,$22,$00,$08,$00,$0C,$08,$08,$08,$1C,$00
byte = $10,$00,$18,$10,$10,$10,$12,$0C,$02,$02,$22,$12,$0E,$12,$22,$00
byte = $0C,$08,$08,$08,$08,$08,$1C,$00,$00,$00,$36,$2A,$2A,$22,$22,$00
byte = $00,$00,$1E,$22,$22,$22,$22,$00,$00,$00,$1C,$22,$22,$22,$1C,$00
byte = $00,$00,$1E,$22,$22,$1E,$02,$02,$00,$00,$3C,$22,$22,$3C,$20,$20
byte = $00,$00,$3A,$06,$02,$02,$02,$00,$00,$00,$3C,$02,$1C,$20,$1E,$00
byte = $04,$04,$1E,$04,$04,$24,$18,$00,$00,$00,$22,$22,$22,$32,$2C,$00
byte = $00,$00,$22,$22,$22,$14,$08,$00,$00,$00,$22,$22,$2A,$2A,$36,$00
byte = $00,$00,$22,$14,$08,$14,$22,$00,$00,$00,$22,$22,$22,$3C,$20,$1C
byte = $00,$00,$3E,$10,$08,$04,$3E,$00,$38,$0C,$0C,$06,$0C,$0C,$38,$00
byte = $08,$08,$08,$08,$08,$08,$08,$08,$0E,$18,$18,$30,$18,$18,$0E,$00
byte = $00,$2C,$1A,$00,$00,$00,$00,$00,$00,$2A,$14,$2A,$14,$2A,$00,$00
//
// Print string with HGR tile library
//
export def hgrPutStr(x, y, strptr)#0
tileDrawStr(x, y, strptr + 1, ^strptr, @hgrFont + 1024) // Offset into regular char
end
//
// Keep module in memory
//
return modkeep
done

File diff suppressed because it is too large Load Diff

View File

@@ -1,369 +0,0 @@
include "inc/cmdsys.plh"
include "inc/hgrlib.plh"
include "inc/fileio.plh"
struc t_sprite
var s_xpos
var s_ypos
var s_undery[2]
var s_underofst[2]
byte s_undermap[2]
byte s_xcenter
byte s_ycenter
byte s_pitch
byte s_height
var s_size
var s_mask[14]
var s_map[14]
var s_under[14]
end
var drawList[16]
var undrawList0[16]
var undrawList1[16]
var undrawList[2] = @undrawList0, @undrawList1
byte drawpage
//
// Sprite routines
//
asm scanMask(x, y, w, srcptr)#0
!SOURCE "vmsrc/plvmzp.inc"
LDA ESTKL+0,X ; SRC PTR
STA SRCL
LDA ESTKH+0,X
STA SRCH
LDA #$00
- PHA
LSR
TAY
LDA (SRC),Y
AND #$80
BEQ +
LDA #$03
+ DEX
STA ESTKL+0,X
end
asm _scanMaskA
JSR $C000 ; HCOLOR
DEX
DEX
LDA ESTKL+5,X ; X COORDL
STA ESTKL+1,X
LDA ESTKH+5,X ; X COORDH
STA ESTKH+1,X
LDA ESTKL+4,X ; Y COORDL
STA ESTKL+0,X
LDA ESTKH+4,X ; Y COORDH
STA ESTKH+0,X
end
asm _scanMaskB
JSR $D000 ; HPLOT
INC ESTKL+3,X ; X COORDL
BNE +
INC ESTKH+3,X ; X COORDH
+ PLA
CLC
ADC #$01
CMP ESTKL+1,X ; WIDTH
BEQ BLTDONE
PHA
LSR
TAY
LDA (SRC),Y
AND #$08
BEQ +
LDA #$03
+ DEX
STA ESTKL+0,X
end
asm _scanMaskC
JSR $C000 ; HCOLOR
DEX
DEX
LDA ESTKL+5,X ; X COORDL
STA ESTKL+1,X
LDA ESTKH+5,X ; X COORDH
STA ESTKH+1,X
LDA ESTKL+4,X ; Y COORDL
STA ESTKL+0,X
LDA ESTKH+4,X ; Y COORDH
STA ESTKH+0,X
end
asm _scanMaskD
JSR $D000 ; HPLOT
INC ESTKL+3,X ; X COORDL
BNE +
INC ESTKH+3,X ; X COORDH
+ PLA
CLC
ADC #$01
CMP ESTKL+1,X ; WIDTH
BNE -
BLTDONE INX
INX
INX
INX
RTS
end
def spriteBLTMask(x, y, w, h, srcptr)#0
word i, j
byte pitch
byte c
pitch = (w + 1) / 2
for j = y to y + h - 1
scanMask(x, j, w, srcptr)
// for i = 0 to w - 1
// c = srcptr->[i >> 1]
// if i & 1
// hgrColor(c & $08 ?? 3 :: 0)
// else
// hgrColor(c & $80 ?? 3 :: 0)
// fin
// hgrPlot(x + i, j)
// next
srcptr = srcptr + pitch
next
end
export def spriteCompile(w, h, xcenter, ycenter, srcptr)#1
var sprtptr, bytewidth, spritesize, i
sprtptr = heapalloc(t_sprite)
if not sprtptr; return 0; fin
bytewidth = (w + 13) / 7
sprtptr->s_pitch = bytewidth
spritesize = bytewidth * h
sprtptr=>s_size = spritesize
sprtptr->s_height = h
sprtptr->s_xcenter = xcenter
sprtptr->s_ycenter = ycenter
sprtptr=>s_under[0] = 0
sprtptr=>s_under[1] = 0
for i = 0 to 13
sprtptr=>s_map[i] = heapalloc(spritesize)
sprtptr=>s_mask[i] = heapalloc(spritesize)
if not sprtptr=>s_map[i] or not sprtptr=>s_mask[i]
heaprelease(sprtptr)
return 0
fin
hgrColor(7)
hgrRect(0, 0, w + 21, h - 1)
spriteBLTMask(i, 0, w, h, srcptr)
hgrCopyDst(i > 6 ?? 1 :: 0, 0, bytewidth, h, sprtptr=>s_mask[i])
hgrColor(0)
hgrRect(0, h, w + 21, h * 2 - 1)
hgrBLT(i, h, w, h, srcptr)
hgrCopyDst(i > 6 ?? 1 :: 0, h, bytewidth, h, sprtptr=>s_map[i])
next
return sprtptr
end
export def spriteDup(sprtsrc)#1
var sprtdup
byte i
sprtdup = heapalloc(t_sprite)
if not sprtdup; return 0; fin
memcpy(sprtdup, sprtsrc, t_sprite)
sprtdup=>s_under[0] = 0
sprtdup=>s_under[1] = 0
return sprtdup
end
export def spriteRead(filestr)#1
var sprtptr, spritesize
byte refnum, i
sprtptr = heapalloc(t_sprite)
if not sprtptr; return 0; fin
refnum = fileio:open(filestr)
if refnum
if fileio:read(refnum, sprtptr, t_sprite) == t_sprite
spritesize = sprtptr=>s_size
sprtptr=>s_under[0] = 0
sprtptr=>s_under[1] = 0
for i = 0 to 13
sprtptr=>s_map[i] = heapalloc(spritesize)
sprtptr=>s_mask[i] = heapalloc(spritesize)
if not sprtptr=>s_map[i] or not sprtptr=>s_mask[i]
heaprelease(sprtptr)
fileio:close(refnum)
return 0
fin
fileio:read(refnum, sprtptr=>s_map[i], spritesize)
fileio:read(refnum, sprtptr=>s_mask[i], spritesize)
next
else
heaprelease(sprtptr)
sprtptr = 0
fin
fileio:close(refnum)
else
heaprelease(sprtptr)
sprtptr = 0
fin
return sprtptr
end
export def spriteSave(filestr, sprtptr)#1
var spritesize
byte refnum, i
fileio:destroy(filestr)
if fileio:create(filestr, $06, $0000) == FILE_ERR_OK
refnum = fileio:open(filestr)
if refnum
if fileio:write(refnum, sprtptr, t_sprite) == t_sprite
spritesize = sprtptr=>s_size
for i = 0 to 13
fileio:write(refnum, sprtptr=>s_map[i], spritesize)
fileio:write(refnum, sprtptr=>s_mask[i], spritesize)
next
fin
fileio:close(refnum)
return 0
fin
fin
return -1
end
export def spriteDraw(sprtptr)#0
byte map, pitch, height
var ofst, y
y = sprtptr=>s_ypos
ofst, map = divmod7(sprtptr=>s_xpos)
if ofst & 1
map = map + 7
fin
sprtptr=>s_underofst[drawpage] = ofst
sprtptr=>s_undery[drawpage] = y
pitch = sprtptr->s_pitch
height = sprtptr->s_height
if not sprtptr=>s_under[drawpage]
sprtptr=>s_under[drawpage] = heapalloc(sprtptr=>s_size)
if not sprtptr=>s_under[drawpage]; return; fin
fin
hgrCopyDst(ofst, y, pitch, height, sprtptr=>s_under[drawpage])
hgrAndSrc( ofst, y, pitch, height, sprtptr=>s_mask[map])
hgrXorSrc( ofst, y, pitch, height, sprtptr=>s_map[map])
end
export def spriteUnDraw(sprtptr)#0
if sprtptr=>s_under[drawpage]
hgrCopySrc(sprtptr=>s_underofst[drawpage], sprtptr=>s_undery[drawpage], sprtptr->s_pitch, sprtptr->s_height, sprtptr=>s_under[drawpage])
fin
end
export def spriteDrawXor(sprtptr)#0
byte map, pitch, height
var ofst, y
y = sprtptr=>s_ypos
ofst, map = divmod7(sprtptr=>s_xpos)
if ofst & 1
map = map + 7
fin
sprtptr->s_undermap[drawpage] = map
sprtptr=>s_underofst[drawpage] = ofst
sprtptr=>s_undery[drawpage] = y
pitch = sprtptr->s_pitch
height = sprtptr->s_height
hgrXorSrc( ofst, y, pitch, height, sprtptr=>s_map[map])
end
export def spriteUnDrawXor(sprtptr)#0
hgrXorSrc(sprtptr=>s_underofst[drawpage], sprtptr=>s_undery[drawpage], sprtptr->s_pitch, sprtptr->s_height, sprtptr=>s_map[sprtptr->s_undermap[drawpage]])
end
export def spritePos(x, y, sprtptr)#0
sprtptr=>s_ypos = y - sprtptr->s_ycenter
sprtptr=>s_xpos = x - sprtptr->s_xcenter
end
export def spritePosIndex(x, y, i)#0
i = i & 15
if drawList[i]
drawList[i]=>s_ypos = y - drawList[i]->s_ycenter
drawList[i]=>s_xpos = x - drawList[i]->s_xcenter
fin
end
export def spriteUnDrawList#0
byte i
var undrawptr
undrawptr = undrawList[drawpage]
for i = 15 downto 0
if undrawptr=>[i]
spriteUnDraw(undrawptr=>[i])
undrawptr=>[i] = 0
fin
next
end
export def spriteDrawList#0
byte i
var undrawptr
undrawptr = undrawList[drawpage]
for i = 15 downto 0
if undrawptr=>[i]
spriteUnDraw(undrawptr=>[i])
fin
next
for i = 0 to 15
if drawList[i]
spriteDraw(drawList[i])
fin
next
memcpy(undrawptr, @drawList, 16*2)
end
export def spriteUnDrawXorList#0
byte i
var undrawptr
undrawptr = undrawList[drawpage]
for i = 0 to 15
if undrawptr=>[i]
spriteUnDrawXor(undrawptr=>[i])
undrawptr=>[i] = 0
fin
next
end
export def spriteDrawXorList#0
byte i
var undrawptr
undrawptr = undrawList[drawpage]
for i = 0 to 15
if undrawptr=>[i]
spriteUnDrawXor(undrawptr=>[i])
fin
if drawList[i]
spriteDrawXor(drawList[i])
fin
next
memcpy(undrawptr, @drawList, 16*2)
end
export def spriteAdd(i, sprtptr)#1
var sprtprev
i = i & 15
sprtprev = drawList[i]
drawList[i] = sprtptr
return sprtprev
end
export def spriteDel(i)#1
var sprtprev
i = i & 15
sprtprev = drawList[i]
drawList[i] = 0
return sprtprev
end
export def spriteDrawBuf(page)#1
drawpage = page & 1
return drawpage
end
//
// Assembly fixups
//
_scanMaskA:1 = @hgrColor
_scanMaskB:1 = @hgrPlot
_scanMaskC:1 = @hgrColor
_scanMaskD:1 = @hgrPlot
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,404 +0,0 @@
include "inc/cmdsys.plh"
//
// Hardware addresses
//
const showgraphics = $C050
const showtext = $C051
const showfull = $C052
const showmix = $C053
const showpage1 = $C054
const showpage2 = $C055
const showlores = $C056
const showhires = $C057
const keyboard = $C000
const keystrobe = $C010
const txt1 = $0400
const txt2 = $0800
const hgr1 = $2000
const hgr2 = $4000
const page1 = 0
const page2 = 1
word txtbuff[] = txt1, txt2
word hgrbuff[] = hgr1, hgr2
//
// Screen tile scanline addresses.
//
word[] rowaddr = $0000,$0080,$0100,$0180,$0200,$0280,$0300,$0380
word = $0028,$00A8,$0128,$01A8,$0228,$02A8,$0328,$03A8
word = $0050,$00D0,$0150,$01D0,$0250,$02D0,$0350,$03D0
byte[] scanbttml = $00,$80,$00,$80,$00,$80,$00,$80
byte = $28,$A8,$28,$A8,$28,$A8,$28,$A8
byte = $50,$D0,$50,$D0,$50,$D0,$50,$D0
byte[] scanbttmh = $1C,$1C,$1D,$1D,$1E,$1E,$1F,$1F
byte = $1C,$1C,$1D,$1D,$1E,$1E,$1F,$1F
byte = $1C,$1C,$1D,$1D,$1E,$1E,$1F,$1F
byte hbmask = $81,$82,$84,$88,$90,$A0,$C0
word hcolor[] = $0000,$552A,$2A55,$7F7F,$8080,$D5AA,$AAD5,$FFFF
byte drawpage = 0
word drawbuff = hgr1
asm tileInc#0
!SOURCE "vmsrc/plvmzp.inc"
CURSH = $24
CURSV = $25
GBASL = $26
GBASH = $27
GBASE = GBASL
TBASL = $28
TBASH = $29
TBASE = TBASL
TBAS2L = $2A
TBAS2H = $2B
TBAS2E = TBAS2L
end
//export def tileDraw(x, y, tileptr)#0
// var scrnptr
//
// scrnptr = (scanaddr[y] | drawbuff) + x
// scrnptr->[$1C00] = tileptr->[7]
// scrnptr->[$1800] = tileptr->[6]
// scrnptr->[$1400] = tileptr->[5]
// scrnptr->[$1000] = tileptr->[4]
// scrnptr->[$0C00] = tileptr->[3]
// scrnptr->[$0800] = tileptr->[2]
// scrnptr->[$0400] = tileptr->[1]
// scrnptr->[$0000] = tileptr->[0]
//end
export asm tileDraw(x, y, tileptr)#0
LDA ESTKL+0,X ; TILEPTRL
STA SRCL
LDA ESTKH+0,X ; TILEPTRH
STA SRCH
LDY ESTKL+1,X ; Y COORD
LDA ESTKL+2,X ; X COORD
CLC
end
asm _tileDraw
ADC $1000,Y ; SCANBTTML
STA ESTKL+0,X ; USE ESTK AS POINTER
LDA $3001 ; DRAWBUFFH
ADC $2000,Y ; SCANBTTMH
STA ESTKL+1,X
LDY #$07 ; DRAW BOTTOM UP
SEC
- LDA (SRC),Y
STA (ESTKL,X)
LDA ESTKL+1,X
SBC #$04
STA ESTKL+1,X
DEY
BNE -
LDA (SRC),Y
STA (ESTKL,X)
INX
INX
INX
RTS
end
//export def tileXorDraw(x, y, tileptr)#0
// var scrnptr
//
// scrnptr = (scanaddr[y] | drawbuff) + x
// scrnptr->[$1C00] = tileptr->[7]
// scrnptr->[$1800] = tileptr->[6]
// scrnptr->[$1400] = tileptr->[5]
// scrnptr->[$1000] = tileptr->[4]
// scrnptr->[$0C00] = tileptr->[3]
// scrnptr->[$0800] = tileptr->[2]
// scrnptr->[$0400] = tileptr->[1]
// scrnptr->[$0000] = tileptr->[0]
//end
export asm tileXorDraw(x, y, tileptr)#0
LDA ESTKL+0,X ; TILEPTRL
STA SRCL
LDA ESTKH+0,X ; TILEPTRH
STA SRCH
LDY ESTKL+1,X ; Y COORD
LDA ESTKL+2,X ; X COORD
CLC
end
asm _tileXDraw
ADC $1000,Y ; SCANBTTML
STA ESTKL+0,X ; USE ESTK AS POINTER
LDA $3001 ; DRAWBUFFH
ADC $2000,Y ; SCANBTTMH
STA ESTKL+1,X
LDY #$07 ; DRAW BOTTOM UP
SEC
- LDA (SRC),Y
EOR (ESTKL,X)
STA (ESTKL,X)
LDA ESTKL+1,X
SBC #$04
STA ESTKL+1,X
DEY
BNE -
LDA (SRC),Y
EOR (ESTKL,X)
STA (ESTKL,X)
INX
INX
INX
RTS
end
//export def tileOrDraw(x, y, tileptr)#0
// var scrnptr
//
// scrnptr = (scanaddr[y] | drawbuff) + x
// scrnptr->[$1C00] = tileptr->[7]
// scrnptr->[$1800] = tileptr->[6]
// scrnptr->[$1400] = tileptr->[5]
// scrnptr->[$1000] = tileptr->[4]
// scrnptr->[$0C00] = tileptr->[3]
// scrnptr->[$0800] = tileptr->[2]
// scrnptr->[$0400] = tileptr->[1]
// scrnptr->[$0000] = tileptr->[0]
//end
export asm tileOrDraw(x, y, tileptr)#0
LDA ESTKL+0,X ; TILEPTRL
STA SRCL
LDA ESTKH+0,X ; TILEPTRH
STA SRCH
LDY ESTKL+1,X ; Y COORD
LDA ESTKL+2,X ; X COORD
CLC
end
asm _tileODraw
ADC $1000,Y ; SCANBTTML
STA ESTKL+0,X ; USE ESTK AS POINTER
LDA $3001 ; DRAWBUFFH
ADC $2000,Y ; SCANBTTMH
STA ESTKL+1,X
LDY #$07 ; DRAW BOTTOM UP
SEC
- LDA (SRC),Y
ORA (ESTKL,X)
STA (ESTKL,X)
LDA ESTKL+1,X
SBC #$04
STA ESTKL+1,X
DEY
BNE -
LDA (SRC),Y
ORA (ESTKL,X)
STA (ESTKL,X)
INX
INX
INX
RTS
end
//export def tileAndDraw(x, y, tileptr)#0
// var scrnptr
//
// scrnptr = (scanaddr[y] | drawbuff) + x
// scrnptr->[$1C00] = tileptr->[7]
// scrnptr->[$1800] = tileptr->[6]
// scrnptr->[$1400] = tileptr->[5]
// scrnptr->[$1000] = tileptr->[4]
// scrnptr->[$0C00] = tileptr->[3]
// scrnptr->[$0800] = tileptr->[2]
// scrnptr->[$0400] = tileptr->[1]
// scrnptr->[$0000] = tileptr->[0]
//end
export asm tileAndDraw(x, y, tileptr)#0
LDA ESTKL+0,X ; TILEPTRL
STA SRCL
LDA ESTKH+0,X ; TILEPTRH
STA SRCH
LDY ESTKL+1,X ; Y COORD
LDA ESTKL+2,X ; X COORD
CLC
end
asm _tileADraw
ADC $1000,Y ; SCANBTTML
STA ESTKL+0,X ; USE ESTK AS POINTER
LDA $3001 ; DRAWBUFFH
ADC $2000,Y ; SCANBTTMH
STA ESTKL+1,X
LDY #$07 ; DRAW BOTTOM UP
SEC
- LDA (SRC),Y
AND (ESTKL,X)
STA (ESTKL,X)
LDA ESTKL+1,X
SBC #$04
STA ESTKL+1,X
DEY
BNE -
LDA (SRC),Y
AND (ESTKL,X)
STA (ESTKL,X)
INX
INX
INX
RTS
end
//export def tileDrawStr(x, y, strptr, strlen, tileset)#0
// while strlen
// tileDraw(x, y, tileset + ^strptr * 8)
// x++
// strptr++
// strlen--
// loop
//end
export asm tileDrawStr(x, y, strptr, strlen, tileset)#0
LDA ESTKL+0,X ; TILESETPTRL
STA DSTL
LDA ESTKH+0,X ; TILESETPTRH
STA DSTH
LDA ESTKL+2,X ; STRPTRL
STA TMPL
LDA ESTKH+2,X ; STRPTRH
STA TMPH
LDY ESTKL+3,X ; Y COORD
LDA ESTKL+4,X ; X COORD
CLC
end
asm _tileDSa
ADC $1000,Y ; SCANBTTML
STA $D000 ; SELF MODIFY LOOP
STA $D001
STA $D002
STA $D003
STA $D004
STA $D005
STA $D006
STA $D007
end
asm _tileDSb
LDA $3001 ; DRAWBUFFH
ADC $2000,Y ; SCANBTTMH
STA $D008 ; SELF MODIFY LOOP
SEC
SBC #$04
STA $D009
SBC #$04
STA $D00A
SBC #$04
STA $D00B
SBC #$04
STA $D00C
SBC #$04
STA $D00D
SBC #$04
STA $D00E
SBC #$04
STA $D00F
LDA ESTKL+1,X ; STRLEN
STX IPY
TAX ; DRAW RIGHT TO LEFT
BEQ +
DEX
LDY #$00
- STY SRCH
TXA
TAY
LDA (TMP),Y ; TILE INDEX * 8
ASL
ROL SRCH
ASL
ROL SRCH
ASL
ROL SRCH
; CLC ; CARRY IS CLEAR FROM ABOVE
ADC DSTL ; ADD TO TILESETPTR
STA SRCL
LDA SRCH
ADC DSTH
STA SRCH
LDY #$07 ; DRAW BOTTOM UP
end
asm _tileDSc
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEY
LDA (SRC),Y
STA $4000,X
DEX
BPL -
LDX IPY
+ INX
INX
INX
INX
INX
RTS
end
export def tileFromText(txtpage, tileset)#0
byte y
word txtptr
txtptr = txtbuff[txtpage & 1]
for y = 0 to 23
tileDrawStr(0, y, rowaddr[y] | txtptr, 40, tileset)
next
end
//
// Set draw buffer
//
export def tileDrawBuf(page)#1
drawpage = page & 1
drawbuff = hgrbuff[drawpage]
return drawpage
end
//
// Assembly fixups
//
_tileDraw:1 = @scanbttml
_tileDraw:6 = @drawbuff.1
_tileDraw:9 = @scanbttmh
_tileXDraw:1 = @scanbttml
_tileXDraw:6 = @drawbuff.1
_tileXDraw:9 = @scanbttmh
_tileODraw:1 = @scanbttml
_tileODraw:6 = @drawbuff.1
_tileODraw:9 = @scanbttmh
_tileADraw:1 = @scanbttml
_tileADraw:6 = @drawbuff.1
_tileADraw:9 = @scanbttmh
_tileDSa:1 = @scanbttml
_tileDSa:4 = @_tileDSc.3
_tileDSa:7 = @_tileDSc.9
_tileDSa:10 = @_tileDSc.15
_tileDSa:13 = @_tileDSc.21
_tileDSa:16 = @_tileDSc.27
_tileDSa:19 = @_tileDSc.33
_tileDSa:22 = @_tileDSc.39
_tileDSa:25 = @_tileDSc.45
_tileDSa:28 = @_tileDSc.51
_tileDSb:1 = @drawbuff.1
_tileDSb:4 = @scanbttmh
_tileDSb:7 = @_tileDSc.4
_tileDSb:13 = @_tileDSc.10
_tileDSb:18 = @_tileDSc.16
_tileDSb:23 = @_tileDSc.22
_tileDSb:28 = @_tileDSc.28
_tileDSb:33 = @_tileDSc.34
_tileDSb:38 = @_tileDSc.40
_tileDSb:43 = @_tileDSc.46
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,56 +0,0 @@
//
// PLASMA JIT bytecode compiler
//
include "inc/cmdsys.plh"
//
// Indirect interpreter DEFinition entrypoint
//
struc t_defentry
byte interpjsr
word interpaddr
word bytecodeaddr
byte callcount
byte bytecodesize
end
//
// JIT compiler constants
//
const jitcomp = $03E2
const jitcodeptr = $03E4
const codemax = $BEE0
const estkh8 = $C000
const estkh = $00C0
const estkl8 = $D000
const estkl = $00D0
const ifpl8 = $E000
const ifph8 = $E100
const jmptmp = $00E6
const tmpl8 = $E700
const tmph8 = $E800
//
// Bytecode interpreter entrypoints
//
const indirectentry = $03DC
const directentry = $03D0
//
// Copy bytecode DEF to main memory
//
def defcpy(dst, defptr)#0
*$003C = defptr=>bytecodeaddr
*$003E = *$003C + defptr->bytecodesize
*$0042 = dst
call($C311, 0, 0, 0, $04) // CALL XMOVE with carry clear (AUX->MAIN) and ints disabled
end
include "libsrc/jitcore.pla"
//
// Install JIT compiler
//
if *jitcomp
return 0
fin
*jitcomp = @compiler
cmdsys.jitcount = 36
cmdsys.jitsize = 96
puts("JITC enabled\n")
return modkeep
done

View File

@@ -1,67 +0,0 @@
//
// PLASMA JIT bytecode compiler
//
include "inc/cmdsys.plh"
//
// Indirect interpreter DEFinition entrypoint
//
struc t_defentry
byte interpjsr
word interpaddr
word bytecodeaddr
byte callcount
byte bytecodesize
end
//
// JIT compiler constants
//
const jitcomp = $03E2
const jitcodeptr = $03E4
const codemax = $BEE0
const estkh8 = $C000
const estkh = $00C0
const estkl8 = $D000
const estkl = $00D0
const ifp8 = $E000
const ifpl8 = $E000
const ifph8 = $E100
const jmptmp = $00E6
const tmp8 = $E700
const tmpl8 = $E700
const tmph8 = $E800
const fetchop = $00F1
const ip8 = $F200
const ip = $00F2
//
// Bytecode interpreter entrypoints
//
const indirectentry = $03DC
const directentry = $03D0
//
// Copy bytecode DEF to main memory
//
def defcpy(dst, defptr)#0
*$003C = defptr=>bytecodeaddr
*$003E = *$003C + defptr->bytecodesize
*$0042 = dst
call($C311, 0, 0, 0, $04) // CALL XMOVE with carry clear (AUX->MAIN) and ints disabled
end
//
// Identify hardware addresses for certain byte sized access operations
//
def is_hwaddr(addr)
return isuge(addr, $C000) and isult(addr, $C100)
end
include "libsrc/jit16core.pla"
//
// Install JIT compiler
//
if *jitcomp
return 0
fin
*jitcomp = @compiler
cmdsys.jitcount = 48
cmdsys.jitsize = 128
puts("16-bit VM/JITC enabled\n")
return modkeep
done

View File

@@ -1,4 +1,3 @@
include "inc/cmdsys.plh"
asm asmdefs
!SOURCE "vmsrc/plvmzp.inc"
SPEAKER = $C030
@@ -58,8 +57,4 @@ GC1DLY NOP ; TIMING
BUZZDLY BNE + ; TIMING
+ BNE GC0READ
end
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,130 +0,0 @@
include "inc/cmdsys.plh"
include "inc/fileio.plh"
var dirbuf
//
// Match next section of source and expression
//
def matchNext(src, srcofst, exp, expofst)
if ^exp >= expofst
when exp->[expofst]
is '*' // Multi-char wildcard
if matchNext(src, srcofst, exp, expofst + 1) // Match zero wild chars
return TRUE
elsif ^src >= srcofst and matchNext(src, srcofst + 1, exp, expofst) // Match more wild chars
return TRUE
fin
is '?' // Single char wildcard
if ^src >= srcofst
return matchNext(src, srcofst + 1, exp, expofst + 1)
fin
return FALSE
otherwise // verbatim match
if ^src >= srcofst and src->[srcofst] == exp->[expofst]
return matchNext(src, srcofst + 1, exp, expofst + 1)
fin
return FALSE
wend
fin
return ^src < srcofst and ^exp < expofst // Return TRUE if at the end of both
end
//
// Start off matching process
//
export def matchName(src, exp)#1
//
// Match on empty wildcard name (same as '*')
//
if not ^exp
return TRUE
fin
return matchNext(src, 1, exp, 1)
end
export def matchList(pathstr, exp)#2
byte refnum
char[64] curpath
var firstblk, entrylen, entriesblk, i, entry, entrylist, entryptr, entrycnt
if not dirbuf
dirbuf = heapallocalign(512, 8, 0)
fin
if not ^pathstr
fileio:getpfx(@curpath)
pathstr = @curpath
fin
if pathstr->[^pathstr] <> '/' // Make sure path ends with a '/'
^pathstr++
pathstr->[^pathstr] = '/'
fin
entrylist = 0
entrycnt = 0
firstblk = 1
refnum = fileio:open(pathstr)
while fileio:read(refnum, dirbuf, 512) == 512
//
// Skip block pointers
//
entry = dirbuf + 4
if firstblk
//
// Pull out revelant details from the first block
//
entrylen = dirbuf->$23
entriesblk = dirbuf->$24 - 1
entry = entry + entrylen
fin
for i = firstblk to entriesblk
//
// Copy directory entry details
//
^entry = ^entry & $0F
if ^entry
//
// Match wildcard filename
//
if matchName(entry, exp)
entryptr = heapalloc(t_fileentry)
memcpy(entryptr, entry, t_fileentry)
entrycnt++
if not entrylist
entrylist = entryptr
fin
fin
fin
entry = entry + entrylen
next
firstblk = 0
loop
fileio:close(refnum)
return entrylist, entrycnt
end
//
// Is this a wildcard name?
//
export def isWildName(exp)#1
byte i
if ^exp
for i = 1 to ^exp
if exp->[i] == '*' or exp->[i] == '?'
return TRUE
fin
next
fin
return FALSE
end
//
// Utility routine to separate filename from path
//
export def fileFromPath(filestr, pathstr)#0
byte i
for i = ^pathstr downto 1
if pathstr->[i] == '/'
break
fin
next
^filestr = ^pathstr - i
memcpy(filestr + 1, pathstr + 1 + i, ^filestr)
end
done

View File

@@ -206,9 +206,6 @@ for rom = $C100 to $C700 step $0100
updateMouse:5 = rom + rom->$14 // readMouseFW
readMouse.1 = index
call(rom + rom->$19, $00, slot, page, $04) // initMouseFW
//
// Keep module in memory
//
return modkeep
fin
next
@@ -273,7 +270,7 @@ CHKSIG: LDY #$05
LDA (TMPTR),Y
CMP #$01
BNE :+
INY
LDY #$0C
TXA ; LOOK FOR MATCHING ID
CMP (TMPTR),Y
BNE :+
@@ -286,6 +283,7 @@ CHKSIG: LDY #$05
LDA TMPTR+1
CMP #$C8
BCC CHKSIG
SEC
RTS
;*

View File

@@ -20,26 +20,28 @@ const WAIT = $FCA8
export def digitalRead(pin)
return FLAG0[pin&3] > 127
end
export def portRead
return (^FLAG0>>7)&1|(^FLAG1>>6)&2|(^FLAG2>>5)&4|(^FLAG3>>4)&8
end
export def digitalWrite(pin, val)#0
ANN0[((pin&3)<<1)+(val&1)]
end
export def portWrite(val)#0
ANN0[val&1]
ANN1[(val>>1)&1]
ANN2[(val>>2)&1]
ANN3[(val>>3)&1]
end
export def analogRead(pin)
return call(PREAD,0,pin&3,0,0).2
end
export def delay(time)#0
call(WAIT,time,0,0,0)
end
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,183 +0,0 @@
include "inc/cmdsys.plh"
//
// Apple II hardware constants.
//
const store80dis = $C000
const store80en = $C001
const vidctl = $C029
const showgraphics = $C050
const showtext = $C051
const showfull = $C052
const showmix = $C053
const showpage1 = $C054
const showpage2 = $C055
const showlores = $C056
const showhires = $C057
const show40 = $C00C
const show80 = $C00D
const mapmain = $C000
const mapaux = $C001
const an3on = $C05E
const an3off = $C05F
const ena80 = $C07E
const dis80 = $C07F
const pixbuf = $2000
const scbbuf = $9D00
const palbuf = $9E00
const scb640 = $80 // 640 PIXEL SUPER-HIRES
const scb320 = $00 // 320 PIXEL SUPER-HIRES
word palette = $0000, $0007, $0070, $0077, $0700, $0707, $0770, $0
word = $0CCC, $000F, $00F0, $00FF, $0F00, $0F0F, $0FF0, $0FFF
asm shrInc(buff)
!SOURCE "vmsrc/plvmzp.inc"
GBASL = $26
GBASH = $27
GBASE = GBASL
GCLR = $30
STORE80DIS = $C000
STORE80EN = $C001
MAINWRT = $C004
AUXWRT = $C005
VIDCTL = $C029
SHADOW = $C035
end
//
// This gets copied to $0100!!!
//
asm auxRead
STA $C003 ; READ AUX MEM
LDA (GBASE),Y
STA $C002 ; READ MAIN MEM
RTS
end
//
// Peek byte from SHR memory
//
asm shrPeek(addr)
LDA ESTKL,X
STA GBASL
LDA ESTKH,X
STA GBASH
LDY #$00
STY ESTKH,X
PHP
SEI
LDA SHADOW
AND #$F7
STA SHADOW
JSR $0100
STA ESTKL,X
LDA SHADOW
ORA #$08
STA SHADOW
PLP
RTS
end
//
// Poke byte into SHR memory
//
asm shrPoke(addr, data)#0
LDA ESTKL+1,X
STA GBASL
LDA ESTKH+1,X
STA GBASH
LDY #$00
PHP
SEI
LDA SHADOW
AND #$F7
STA SHADOW
LDA ESTKL+0,X
STA AUXWRT
STA (GBASE),Y
STA MAINWRT
LDA SHADOW
ORA #$08
STA SHADOW
PLP
INX
INX
RTS
end
//
// Fill byte into SHR memory
//
asm shrFill(addr, data, len)#0
LDA ESTKL+2,X
STA GBASL
LDA ESTKH+2,X
STA GBASH
LDY #$00
PHP
SEI
LDA SHADOW
AND #$F7
STA SHADOW
LDA ESTKL+1,X
STA AUXWRT
- STA (GBASE),Y
INY
BNE +
INC GBASH
+ DEC ESTKL+0,X
BNE -
DEC ESTKH+0,X
BNE -
STA MAINWRT
LDA SHADOW
ORA #$08
STA SHADOW
PLP
INX
INX
RTS
end
export def shrPalette(pal, rgbptr)#0
word palptr
byte i
palptr = palbuf + pal * 32
for i = 0 to 31
shrPoke(palptr + i, ^(rgbptr + i))
next
end
export def shrMode(mode)#0
byte row, scb
if mode
//
// Set super hires graphics
//
if mode == 640
scb = scb640
else
scb = scb320
fin
for row = 0 to 199
shrPoke(scbbuf + row, scb)
shrRowPalette(row, palette)
next
^store80dis = 0 // Turn off 80 column mode
^vidctl = ^vidctl | $80 // Turn on SHR mode
return
fin
//
// Set text mode
//
^vidctl = ^vidctl & $7F
^showtext
^showpage1
^ena80 = 0
^show40 = 0
^mapmain = 0
^an3off
call($FC58, 0, 0, 0, 0) // home()
end
// Put read AUX mem routine in scary location
memcpy($0100, @auxRead, 9)
//
// Keep module in memory
//
done

View File

@@ -305,7 +305,7 @@ TONELP SBC #$01 ; 2
;+4 = 11 (from BNE above)
+++ BIT $C000 ; 4
NOP ; 2
BMI TONEXIT ; 2
BPL TONELP ; 3
;---
;+9 = 20
@@ -867,9 +867,7 @@ if mbSlot < 0
spkrOctave0[instr] = mbOctave0[instr]/NOTEDIV
next
fin
//
// Keep module in memory
//
done
////////////////////////////////////////////////////////////////////////////////

View File

@@ -35,10 +35,10 @@ asm sosexec(addr)#0
STA SRCL
BCC +
INC SRCH
+; LDA SRCL
CMP DSTL
LDA SRCH
SBC DSTH
+ LDA DSTL
CMP SRCL
LDA DSTH
SBC SRCH
BCC REVCPY
;
; FORWARD COPY

View File

@@ -5,12 +5,14 @@ include "inc/cmdsys.plh"
const SPI_SLAVE_READY = '@'
const SPI_SLAVE_ERROR = '!'
const SPI_SLAVE_BUSY = $FF
word spiReadWriteByte, spiWriteBytes, spiReadBytes
asm spiInc
!SOURCE "vmsrc/plvmzp.inc"
!CPU 65C02
end
asm spiXferByteStd(outbyte)
PHP ; DISABLE INTS
SEI
@@ -78,6 +80,7 @@ asm spiXferByteStd(outbyte)
PLP
RTS
end
asm spiXferByteGS(outbyte)
PHP ; DISABLE INTS
SEI
@@ -208,6 +211,7 @@ asm spiReadBytesStd(buf, len)
PLP
RTS
end
asm spiReadBytesGS(buf, len)
PHP ; DISABLE INTS
SEI
@@ -271,6 +275,7 @@ asm spiReadBytesGS(buf, len)
PLP
RTS
end
asm spiWriteBytesStd(buf, len)
PHP ; DISABLE INTS
SEI
@@ -343,6 +348,7 @@ asm spiWriteBytesStd(buf, len)
PLP
RTS
end
asm spiWriteBytesGS(buf, len)
PHP ; DISABLE INTS
SEI
@@ -387,12 +393,15 @@ asm spiWriteBytesGS(buf, len)
PLP
RTS
end
export def spiXferByte(outbyte)
return (spiReadWriteByte)(outbyte)
end
export def spiDelay(time)
return call($FCA8, time, 0, 0, 0) // DELAY
end
export def spiSend(data)
byte timeout, status
@@ -406,19 +415,23 @@ export def spiSend(data)
putc(status);putc('0'+data/10);putc('0'+data%10)
return status
end
export def spiRecv
return spiSend(0)
end
export def spiWriteBuf(buf, len)
spiSend(13) // CMD_BUF_WRITE
spiSend(len >> 8); spiSend(len)
return (spiWriteBytes)(buf, len)
end
export def spiReadBuf(buf, len)
spiSend(12) // CMD_BUF_READ
spiSend(len >> 8); spiSend(len)
return (spiReadBytes)(buf, len)
end
export def spiReady
byte timeout
@@ -429,11 +442,13 @@ export def spiReady
loop
return timeout
end
export def spiReset
^$C05B // DISABLE SLAVE SELECT
^$C05D // CLOCK RAISE (GS ONLY)
return spiReady
end
if call($FE1F, 0, 0, 0, 1).3 & 1 // GS ID ROUTINE
spiReadWriteByte = @spiXferByteStd
spiReadBytes = @spiReadBytesStd
@@ -443,8 +458,5 @@ else
spiReadBytes = @spiReadBytesGS
spiWriteBytes = @spiWriteBytesGS
fin
//
// Keep module in memory
//
return spiReset <> 0
done

View File

@@ -11,10 +11,10 @@ end
//
// Uthernet register offsets
//
const TX_DATA = $00
const RX_DATA = $00
const TX_CMD = $04
const TX_LEN = $06
const TX_DATA = $00
const RX_DATA = $00
const TX_CMD = $04
const TX_LEN = $06
const INT_STATUS = $08
const PREG_INDEX = $0A
const PREG_DATA = $0C
@@ -22,14 +22,13 @@ const AUTO_INC = $8000
//
// Uthernet register addresses
//
byte[] slot // Init time only
byte rxdata_lo, rxdata_hi
byte txcmd
byte txlen
byte isq
word rom[]
byte pregidx
byte pregdata
byte[] slot // Init time only
//
// Uthernet MAC address
//
@@ -38,155 +37,156 @@ byte[6] utherMAC = $00,$0A,$99,$1E,$02,$A0
// Defines for ASM routines
//
asm equates
!SOURCE "vmsrc/plvmzp.inc"
!SOURCE "vmsrc/plvmzp.inc"
end
//
// Uthernet I/O functions
//
asm _pokeiow(val)#0
LDA ESTKL,X
asm _pokeiow(val)
LDA ESTKL,X
end
asm _pokeiowl
STA $C000
LDA ESTKH,X
STA $C000
LDA ESTKH,X
end
asm _pokeiowh
STA $C000
INX
RTS
STA $C000
RTS
end
//
// PEEK BYTE FROM I/O SPACE
// _peekio()
//
asm _peekio#1
DEX
asm _peekio
DEX
end
asm _peekiol
LDA $C000
STA ESTKL,X
LDA #$00
STA ESTKH,X
RTS
LDA $C000
STA ESTKL,X
LDA #$00
STA ESTKH,X
RTS
end
//
// PEEK WORD FROM I/O SPACE
// _peekiow()
//
asm _peekiow#1
DEX
asm _peekiow
DEX
end
asm _peekiowl
LDA $C000
STA ESTKL,X
LDA $C000
STA ESTKL,X
end
asm _peekiowh
LDA $C000
STA ESTKH,X
RTS
LDA $C000
STA ESTKH,X
RTS
end
//
// WRITE FRAME DATA INTO I/O SPACE
// pokefrm(BUF, LEN)
//
asm pokefrm(buf, len)#1
LDY #$00
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
STA SRCH
LSR ESTKH,X ; CONVERT BYTE LEN TO WORD LEN
LDA ESTKL,X
ROR
ADC #$00
STA ESTKL,X
BEQ +
INC ESTKH,X
+ BCC POKELP
INC ESTKH,X
POKELP LDA (SRC),Y
asm pokefrm(buf, len)
LDY #$00
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
STA SRCH
LSR ESTKH,X ; CONVERT BYTE LEN TO WORD LEN
LDA ESTKL,X
ROR
ADC #$00
STA ESTKL,X
BEQ +
!BYTE $A9
- CLC
INC ESTKH,X
+ BCS -
POKELP LDA (SRC),Y
end
asm _pokefrml
STA $C000
INY
LDA (SRC),Y
STA $C000
INY
LDA (SRC),Y
end
asm _pokefrmh
STA $C000
INY
BNE +
INC SRCH
+ DEC ESTKL,X
BNE POKELP
DEC ESTKH,X
BNE POKELP
INX
RTS
STA $C000
INY
BNE +
INC SRCH
+ DEC ESTKL,X
BNE POKELP
DEC ESTKH,X
BNE POKELP
INX
RTS
end
//
// READ FRAME DATA FROM I/O SPACE
// peekfrm(BUF, LEN)
//
asm peekfrm(buf, len)#1
LDY #$00
LDA ESTKL+1,X
STA DSTL
LDA ESTKH+1,X
STA DSTH
LSR ESTKH,X ; CONVERT BYTE LEN TO WORD LEN
LDA ESTKL,X
ROR
ADC #$00
STA ESTKL,X
BEQ +
INC ESTKH,X
+ BCC PEEKLP
INC ESTKH,X
asm peekfrm(buf, len)
LDY #$00
LDA ESTKL+1,X
STA DSTL
LDA ESTKH+1,X
STA DSTH
LSR ESTKH,X ; CONVERT BYTE LEN TO WORD LEN
LDA ESTKL,X
ROR
ADC #$00
STA ESTKL,X
BEQ +
!BYTE $A9
- CLC
INC ESTKH,X
+ BCS -
end
asm _peekfrml
PEEKLP LDA $C000
STA (DST),Y
INY
PEEKLP LDA $C000
STA (DST),Y
INY
end
asm _peekfrmh
LDA $C000
STA (DST),Y
INY
BNE +
INC DSTH
+ DEC ESTKL,X
BNE PEEKLP
DEC ESTKH,X
BNE PEEKLP
EXPSW INX
RTS
+ LDA $C000
STA (DST),Y
INY
BNE +
INC DSTH
+ DEC ESTKL,X
BNE PEEKLP
DEC ESTKH,X
BNE PEEKLP
EXPSW INX
RTS
end
def pokeiow(io, data)#0
def pokeiow(io, data)
_pokeiowl.1 = io
_pokeiowh.1 = io+1
_pokeiow(data)
return _pokeiow(data)
end
def peekio(io)#1
def peekio(io)
_peekiol.1 = io
return _peekio()
end
def peekiow(io)#1
def peekiow(io)
_peekiowl.1 = io
_peekiowh.1 = io+1
return _peekiow()
end
def pokepreg(reg, data)#0
def pokepreg(reg, data)
pokeiow(pregidx, reg)
pokeiow(pregdata, data)
return pokeiow(pregdata, data)
end
def peekpreg(reg)#1
def peekpreg(reg)
pokeiow(pregidx, reg)
return peekiow(pregdata)
end
//
// Set the length of the next packet to send and wait for data space availability
//
def pokefrmlen(len)#1
def pokefrmlen(len)
pokeiow(txcmd, $C0)
pokeiow(txlen, len)
repeat; until peekpreg($0138) & $0100
@@ -195,7 +195,7 @@ end
//
// Return the length of awaiting packet, 0 otherwise
//
def peekfrmlen#1
def peekfrmlen
word len
len = 0
if peekiow(isq) & $3F == $04
@@ -214,40 +214,35 @@ end
// Identify Uthernet card and initialize
//
for slot = $90 to $F0 step $10
rom = ((slot & $70) << 4) | $C000
if rom=>$06 <> $3C86 or (slot == $0B or (rom->$05 <> $38 and rom->$07 <> $18)) // Skip slots with signature
if (peekiow(slot+TX_CMD) & $CC3F) == $0009
pokeiow(slot+PREG_INDEX, 0)
if peekiow(slot+PREG_DATA) == $630E
pregidx = slot + PREG_INDEX
pregdata = slot + PREG_DATA
pokepreg($0114, $40) // RESET
rxdata_lo = slot + RX_DATA
rxdata_hi = slot + RX_DATA + 1
txcmd = slot + TX_CMD
txlen = slot + TX_LEN
isq = slot + INT_STATUS
_pokefrml.1 = slot + TX_DATA
_pokefrmh.1 = slot + TX_DATA + 1
_peekfrml.1 = slot + RX_DATA
_peekfrmh.1 = slot + RX_DATA + 1
pokepreg($0158, utherMAC:0) // MAC addr
pokepreg($015A, utherMAC:2) // MAC addr
pokepreg($015C, utherMAC:4) // MAC addr
pokepreg($0102, $0100) // Recv cfg
pokepreg($0104, $0D00) // Recv ctrl
pokepreg($0106, $8200) // Xmit cfg
pokepreg($0112, $00C0) // Line ctrl
//
// Install etherip driver
//
puts("Found Uthernet I in slot #"); putc('0' + ((slot - $80) >> 4)); putln
setEtherDriver(@utherMAC, @peekfrmlen, @peekfrm, @pokefrmlen, @pokefrm)
//
// Keep module in memory
//
return modkeep
fin
if (peekiow(slot+TX_CMD) & $CC3F) == $09
pokeiow(slot+PREG_INDEX, 0)
if peekiow(slot+PREG_DATA) == $630E
pokepreg($0114, $40) // RESET
rxdata_hi = slot + 1
txcmd = slot + TX_CMD
txlen = slot + TX_LEN
isq = slot + INT_STATUS
pregidx = slot + PREG_INDEX
pregdata = slot + PREG_DATA
_pokefrml.1 = slot
_pokefrmh.1 = slot+1
_peekfrml.1 = slot
_peekfrmh.1 = slot+1
pokepreg($0158, utherMAC:0) // MAC addr
pokepreg($015A, utherMAC:2) // MAC addr
pokepreg($015C, utherMAC:4) // MAC addr
pokepreg($0102, $0100) // Recv cfg
pokepreg($0104, $0D00) // Recv ctrl
pokepreg($0106, $8200) // Xmit cfg
pokepreg($0112, $00C0) // Line ctrl
//
// Install etherip driver
//
puts("Found Uthernet I in slot #")
putc('0' + ((slot - $80) >> 4))
putln
setEtherDriver(@utherMAC, @peekfrmlen, @peekfrm, @pokefrmlen, @pokefrm)
return modkeep
fin
fin
next

View File

@@ -71,11 +71,10 @@ const WIZ_RXMEM3 = $7800
//
// Wiznet indirect registers
//
word[] rom
word saveidx
byte regidx
byte regdata
byte slot
byte slot
word saveidx
byte regidx
byte regdata
//
// Wiznet MAC address
//
@@ -138,15 +137,16 @@ word bcast = IP_BROADCAST, IP_BROADCAST
//
// ICMP type/codes
//
const IP_PROTO_ICMP = 1
const ICMP_ECHO_REQST = 8
const ICMP_ECHO_REPLY = 0
//
// ICMP message format
//
struc t_icmp
byte icmp_type
byte icmp_code
word icmp_chksm
byte icmp_type
byte icmp_code
word icmp_chksm
word[2] icmp_header
end
//
@@ -155,9 +155,9 @@ end
struc t_piphdr
byte[IP4ADR_SIZE] pip_src
byte[IP4ADR_SIZE] pip_dst
byte pip_zero
byte pip_proto
word pip_len
byte pip_zero
byte pip_proto
word pip_len
end
//
// UDP header
@@ -184,11 +184,11 @@ const MAX_WIZ_CHANNELS = 4
//
// Channel protocols
//
const WIZ_PROTO_CLOSED = 0
const WIZ_PROTO_TCP = 1
const WIZ_PROTO_UDP = 2
const WIZ_PROTO_IP = 3
const WIZ_PROTO_RAW = 4
const WIZ_PROTO_CLOSED = 0
const WIZ_PROTO_TCP = 1
const WIZ_PROTO_UDP = 2
const WIZ_PROTO_IP = 3
const WIZ_PROTO_RAW = 4
//
// State transistions
//
@@ -212,7 +212,7 @@ struc t_channel
word channel_recv_func
word channel_recv_parm
end
byte[t_channel] wizChannel[MAX_WIZ_CHANNELS]
byte[t_channel * MAX_WIZ_CHANNELS] wizChannel
//
// Service ICMP hook
//
@@ -221,17 +221,17 @@ export word hookICMP
// Defines for ASM routines
//
asm equates
!SOURCE "vmsrc/plvmzp.inc"
!SOURCE "vmsrc/plvmzp.inc"
end
//
// Swap bytes in word
//
asm swab(val)
LDA ESTKL,X
LDY ESTKH,X
STA ESTKH,X
STY ESTKL,X
RTS
LDA ESTKL,X
LDY ESTKH,X
STA ESTKH,X
STY ESTKL,X
RTS
end
//
// Wiznet I/O functions
@@ -239,122 +239,118 @@ end
// POKE WORD TO I/O SPACE
// Note: Big Endian format
//
asm _pokeiow(val)#0
LDA ESTKH,X
asm _pokeiow(val)
LDA ESTKH,X
end
asm _pokeiowl
STA $C000
LDA ESTKL,X
STA $C000
LDA ESTKL,X
end
asm _pokeiowh
STA $C000
INX
RTS
STA $C000
RTS
end
//
// POKE BYTE TO I/O SPACE
//
asm _pokeio(val)#0
LDA ESTKL,X
asm _pokeio(val)
LDA ESTKL,X
end
asm _pokeiol
STA $C000
INX
RTS
STA $C000
RTS
end
//
// PEEK BYTE FROM I/O SPACE
//
asm _peekio
DEX
DEX
end
asm _peekiol
LDA $C000
STA ESTKL,X
LDA #$00
STA ESTKH,X
RTS
LDA $C000
STA ESTKL,X
LDA #$00
STA ESTKH,X
RTS
end
//
// PEEK WORD FROM I/O SPACE
// Note: Big Endian format
//
asm _peekiow
DEX
DEX
end
asm _peekiowl
LDA $C000
STA ESTKH,X
LDA $C000
STA ESTKH,X
end
asm _peekiowh
LDA $C000
STA ESTKL,X
RTS
LDA $C000
STA ESTKL,X
RTS
end
//
// WRITE DATA INTO I/O SPACE
// pokedata(BUF, LEN)
//
asm pokedata(buf, len)#0
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
STA SRCH
LDY ESTKL,X
BEQ POKELP
LDY #$00
INC ESTKH,X
POKELP LDA (SRC),Y
asm pokedata(buf, len)
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
STA SRCH
LDY ESTKL,X
BEQ POKELP
LDY #$00
INC ESTKH,X
POKELP LDA (SRC),Y
end
asm _pokedata
STA $C000
INY
BNE +
INC SRCH
+ DEC ESTKL,X
BNE POKELP
DEC ESTKH,X
BNE POKELP
INX
INX
RTS
STA $C000
INY
BNE +
INC SRCH
+ DEC ESTKL,X
BNE POKELP
DEC ESTKH,X
BNE POKELP
INX
RTS
end
//
// READ DATA FROM I/O SPACE
// peekdata(BUF, LEN)
//
asm peekdata(buf, len)#0
LDA ESTKL+1,X
STA DSTL
LDA ESTKH+1,X
STA DSTH
LDY ESTKL,X
BEQ PEEKLP
LDY #$00
INC ESTKH,X
asm peekdata(buf, len)
LDA ESTKL+1,X
STA DSTL
LDA ESTKH+1,X
STA DSTH
LDY ESTKL,X
BEQ PEEKLP
LDY #$00
INC ESTKH,X
end
asm _peekdata
PEEKLP LDA $C000
STA (DST),Y
INY
BNE +
INC DSTH
+ DEC ESTKL,X
BNE PEEKLP
DEC ESTKH,X
BNE PEEKLP
INX
INX
RTS
PEEKLP LDA $C000
STA (DST),Y
INY
BNE +
INC DSTH
+ DEC ESTKL,X
BNE PEEKLP
DEC ESTKH,X
BNE PEEKLP
INX
RTS
end
def pokeiow(io, data)#0
def pokeiow(io, data)
_pokeiowl.1 = io
_pokeiowh.1 = io+1
_pokeiow(data)
return _pokeiow(data)
end
def pokeio(io, data)#0
def pokeio(io, data)
_pokeiol.1 = io
_pokeio(data)
return _pokeio(data)
end
def peekio(io)
_peekiol.1 = io
@@ -365,26 +361,26 @@ def peekiow(io)
_peekiowh.1 = io+1
return _peekiow()
end
def pokereg(reg, data)#0
def pokereg(reg, data)
_pokeiow(reg)
_pokeio(data)
return _pokeio(data)
end
def peekreg(reg)
_pokeiow(reg)
return _peekio()
end
def pokeregs(reg, buf, len)#0
def pokeregs(reg, buf, len)
_pokeiow(reg)
pokedata(buf, len)
return pokedata(buf, len)
end
def peekregs(reg, buf, len)#0
def peekregs(reg, buf, len)
_pokeiow(reg)
peekdata(buf, len)
return peekdata(buf, len)
end
def pokeregw(reg, dataw)#0
def pokeregw(reg, dataw)
_pokeiow(reg)
_pokeio(dataw.1)
_pokeio(dataw.0)
return _pokeio(dataw.0)
end
def peekregw(reg)
word dataw
@@ -419,7 +415,7 @@ def wizSendUDP(wiz, ipdst, portdst, data, len)
splitlen = WIZ_TXSIZE - txrr
pokeregs(wizdata + txrr, data, splitlen)
pokeregs(wizdata, data + splitlen, len - splitlen)
else
else
pokeregs(wizdata + txrr, data, len)
fin
//
@@ -474,9 +470,9 @@ def wizOpenUDP(localport, callback, param)
wiz=>channel_lclport = localport
wiz=>channel_recv_func = callback
wiz=>channel_recv_parm = param
pokereg(wiz=>channel_regs + WIZ_SnMR, $02) // UDP protocol
pokeregw(wiz=>channel_regs + WIZ_SnPORT, localport)
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
pokereg(wiz=>channel_regs + WIZ_SnMR, $02) // UDP protocol
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
return wiz
end
//
@@ -484,14 +480,14 @@ end
//
def wizCloseUDP(wiz)
if isuge(wiz, @wizChannel) and isult(wiz, @wizChannel + MAX_WIZ_CHANNELS * t_channel)
//
// Clear notiications on this port
//
//
// Clear notiications on this port
//
if wiz->channel_proto == WIZ_PROTO_UDP
wiz->channel_proto = WIZ_PROTO_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
return 0
fin
return 0
fin
fin
//
// Invalid port
@@ -512,8 +508,8 @@ def wizListenTCP(lclport, callback, param)
for i = 1 to MAX_WIZ_CHANNELS
if wiz->channel_proto == WIZ_PROTO_TCP and wiz->channel_state == TCP_STATE_LISTEN and wiz=>channel_lclport == lclport
break
fin
wiz = wiz + t_channel
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
//
@@ -523,8 +519,8 @@ def wizListenTCP(lclport, callback, param)
for i = 1 to MAX_WIZ_CHANNELS
if !wiz->channel_proto
break
fin
wiz = wiz + t_channel
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
return 0
@@ -541,9 +537,9 @@ def wizListenTCP(lclport, callback, param)
wiz=>channel_lclport = lclport
wiz=>channel_recv_func = callback
wiz=>channel_recv_parm = param
pokereg(wiz=>channel_regs + WIZ_SnMR, $01) // TCP protocol
pokereg(wiz=>channel_regs + WIZ_SnMR, $01) // TCP protocol
pokeregw(wiz=>channel_regs + WIZ_SnPORT, lclport)
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
while peekreg(wiz=>channel_regs + WIZ_SnSR) <> $13; loop // Wait for init
pokereg(wiz=>channel_regs + WIZ_SnCR, $02) // LISTEN
return wiz
@@ -623,7 +619,7 @@ def wizSendTCP(wiz, data, len)
pokeregs(wizdata + txrr, data, splitlen)
pokeregs(wizdata, data + splitlen, len - splitlen)
//putc('(');puti(splitlen);putc(',');puti(len-splitlen);putc(')')
else
else
pokeregs(wizdata + txrr, data, len)
fin
//
@@ -638,9 +634,9 @@ end
//
def wizCloseTCP(wiz)
if isuge(wiz, @wizChannel) and isult(wiz, @wizChannel + MAX_WIZ_CHANNELS * t_channel)
//
// Clear notiications on this port
//
//
// Clear notiications on this port
//
if wiz->channel_proto == WIZ_PROTO_TCP
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
wiz->channel_proto = WIZ_PROTO_CLOSED
@@ -674,10 +670,10 @@ end
def wizSetParam(wiz, param)
if wiz->channel_proto == WIZ_PROTO_UDP or wiz->channel_proto == WIZ_PROTO_TCP
//
// Update param on this port
//
wiz=>channel_recv_parm = param
return 0
// Update param on this port
//
wiz=>channel_recv_parm = param
return 0
fin
//
// Invalid port
@@ -702,7 +698,7 @@ def wizServiceIP
wizregs = wiz=>channel_regs
wizdata = wiz=>channel_rxmem
sir = peekreg(wizregs + WIZ_SnIR)
pokereg(wizregs + WIZ_SnIR, sir) // Clear SnIR
pokereg(wiz=>channel_regs + WIZ_SnIR, sir) // Clear SnIR
when wiz->channel_proto
is WIZ_PROTO_UDP
if sir & $04
@@ -739,63 +735,63 @@ def wizServiceIP
wiz->channel_state = TCP_STATE_OPEN
wend
fin
if sir & $04
//
// Receive TCP packet
//
if wiz->channel_state == TCP_STATE_OPEN
rxlen = peekregw(wizregs + WIZ_SnRSR)
rxrr = peekregw(wizregs + WIZ_SnRXRD)
rxwr = rxrr & WIZ_RXMASK
rxpkt = heapalloc(rxlen)
if rxwr + rxlen > WIZ_RXSIZE
splitlen = WIZ_RXSIZE - rxwr
peekregs(wizdata + rxwr, rxpkt, splitlen)
peekregs(wizdata, rxpkt + splitlen, rxlen - splitlen)
else
peekregs(wizdata + rxwr, rxpkt, rxlen)
fin
pokeregw(wizregs + WIZ_SnRXRD, rxrr + rxlen)
pokereg(wizregs + WIZ_SnCR, $40) // RECV
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,rxpkt,rxlen,wiz=>channel_recv_parm)
heaprelease(rxpkt)
if sir & $04
//
// Receive TCP packet
//
if wiz->channel_state == TCP_STATE_OPEN
rxlen = peekregw(wizregs + WIZ_SnRSR)
rxrr = peekregw(wizregs + WIZ_SnRXRD)
rxwr = rxrr & WIZ_RXMASK
rxpkt = heapalloc(rxlen)
if rxwr + rxlen > WIZ_RXSIZE
splitlen = WIZ_RXSIZE - rxwr
peekregs(wizdata + rxwr, rxpkt, splitlen)
peekregs(wizdata, rxpkt + splitlen, rxlen - splitlen)
else
peekregs(wizdata + rxwr, rxpkt, rxlen)
fin
pokeregw(wizregs + WIZ_SnRXRD, rxrr + rxlen)
pokereg(wizregs + WIZ_SnCR, $40) // RECV
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,rxpkt,rxlen,wiz=>channel_recv_parm)
heaprelease(rxpkt)
fin
if sir & $02
//
// Close TCP socket
//
if wiz->channel_state == TCP_STATE_OPEN // Notify callback w/ len = 0
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,0,wiz=>channel_lclport,0,wiz=>channel_recv_parm)
fin
wiz->channel_state = TCP_STATE_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
fin
if sir & $08
//
// Timeout on TCP socket
//
when wiz->channel_state
is TCP_STATE_OPEN
wiz->channel_state = TCP_STATE_CLOSING
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,0,0,wiz=>channel_recv_parm)
break
is TCP_STATE_CONNECT
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,0,0,wiz=>channel_recv_parm)
is TCP_STATE_CLOSING
wiz->channel_state = TCP_STATE_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
wend
fin
if sir & $02
//
// Close TCP socket
//
if wiz->channel_state == TCP_STATE_OPEN // Notify callback w/ len = 0
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,0,wiz=>channel_lclport,0,wiz=>channel_recv_parm)
fin
wiz->channel_state = TCP_STATE_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
fin
if sir & $08
//
// Timeout on TCP socket
//
when wiz->channel_state
is TCP_STATE_OPEN
wiz->channel_state = TCP_STATE_CLOSING
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,0,0,wiz=>channel_recv_parm)
break
is TCP_STATE_CONNECT
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,0,0,wiz=>channel_recv_parm)
is TCP_STATE_CLOSING
wiz->channel_state = TCP_STATE_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
wend
fin
wend
fin
wiz = wiz + t_channel
next
if ir & $80
if ir & $80
//
// IP conflict
//
pokereg(WIZ_IR, $80)
// IP conflict
//
pokereg(WIZ_IR, $80)
fin
if ir & $40
//
@@ -843,80 +839,71 @@ end
// Identify Uthernet II card and initialize
//
for slot = $90 to $F0 step $10
rom = ((slot & $70) << 4) | $C000
if rom=>$06 <> $3C86 or (slot == $0B or (rom->$05 <> $38 and rom->$07 <> $18)) // Skip slots with signature
regdata = peekio(slot)
if (regdata & $E4) == $00
pokeio(slot, $03) // Try setting auto-increment indirect I/F
if peekio(slot) == $03
saveidx = peekiow(slot + 1)
peekio(slot + 3) // Dummy read to data register should increment index
if peekiow(slot + 1) == saveidx + 1
//
// Good chance this is it
//
pokeio(slot, $80) // RESET
regidx = slot + 1
regdata = slot + 3
_pokedata.1 = regdata
_peekdata.1 = regdata
repeat
pokeio(slot, $03) // Auto-increment indirect I/F + enable ping
until peekio(slot) == $03
//
// The following looks redundant, but it sets up the peek/poke locations
// for peekreg(s)/pokereg(s)
//
pokeiow(regidx, WIZ_MR)
pokeio(regdata, $03) // Auto-increment indirect I/F + enable ping
peekio(regdata)
//
// Initialize common registers
//
wizMAC[5] = slot >> 4 // Slighty unique MAC address
pokeregs(WIZ_SHAR, @wizMAC, 6) // MAC addr
pokeregw(WIZ_RTR, 5000) // Timeout period to 500ms
pokereg(WIZ_RMSR, $55) // 2K Rx memory/channel
pokereg(WIZ_TMSR, $55) // 2K Tx memory/channel
//
// Print settings
//
puts("Found Uthernet II in slot #")
putc('0' + ((slot - $80) >> 4))
putln
//
// Fill channel structure
//
saveidx = @wizChannel
for slot = 0 to 3
saveidx=>channel_regs = WIZ_SREGS + (WIZ_SSIZE * slot)
saveidx=>channel_txmem = WIZ_TXMEM + (WIZ_TXSIZE * slot)
saveidx=>channel_rxmem = WIZ_RXMEM + (WIZ_RXSIZE * slot)
saveidx = saveidx + t_channel
next
//
// Fill in Net class
//
iNet:serviceIP = @wizServiceIP
iNet:openUDP = @wizOpenUDP
iNet:sendUDP = @wizSendUDP
iNet:closeUDP = @wizCloseUDP
iNet:listenTCP = @wizListenTCP
iNet:connectTCP = @wizConnectTCP
iNet:sendTCP = @wizSendTCP
iNet:closeTCP = @wizCloseTCP
iNet:setInterfaceIP = @setWizIP
iNet:getInterfaceHA = @getWizHA
iNet:setCallback = @wizSetCallback
iNet:setParam = @wizSetParam
//
// Keep module in memory
//
return modkeep
fin
regdata = peekio(slot)
if (regdata & $E4) == $00
pokeio(slot, $03) // Try setting auto-increment indirect I/F
if peekio(slot) == $03
saveidx = peekiow(slot + 1)
peekio(slot + 3) // Dummy read to data register should increment index
if peekiow(slot + 1) == saveidx + 1
//
// Good chance this is it
//
pokeio(slot, $80) // RESET
regidx = slot + 1
regdata = slot + 3
_pokedata.1 = regdata
_peekdata.1 = regdata
pokeio(slot, $03) // Auto-increment indirect I/F + enable ping
//
// The following looks redundant, but it sets up the peek/poke locations
// for peekreg(s)/pokereg(s)
//
pokeiow(regidx, WIZ_MR)
pokeio(regdata, $03) // Auto-increment indirect I/F + enable ping
peekio(regdata)
//
// Initialize common registers
//
pokeregs(WIZ_SHAR, @wizMAC, 6) // MAC addr
pokeregw(WIZ_RTR, 5000) // Timeout period to 500ms
pokereg(WIZ_RMSR, $55) // 2K Rx memory/channel
pokereg(WIZ_TMSR, $55) // 2K Tx memory/channel
//
// Print settings
//
puts("Found Uthernet II in slot #")
putc('0' + ((slot - $80) >> 4))
putln
//
// Fill channel structure
//
saveidx = @wizChannel
for slot = 0 to 3
saveidx=>channel_regs = WIZ_SREGS + (WIZ_SSIZE * slot)
saveidx=>channel_txmem = WIZ_TXMEM + (WIZ_TXSIZE * slot)
saveidx=>channel_rxmem = WIZ_RXMEM + (WIZ_RXSIZE * slot)
saveidx = saveidx + t_channel
next
//
// Fill in Net class
//
iNet:serviceIP = @wizServiceIP
iNet:openUDP = @wizOpenUDP
iNet:sendUDP = @wizSendUDP
iNet:closeUDP = @wizCloseUDP
iNet:listenTCP = @wizListenTCP
iNet:connectTCP = @wizConnectTCP
iNet:sendTCP = @wizSendTCP
iNet:closeTCP = @wizCloseTCP
iNet:setInterfaceIP = @setWizIP
iNet:getInterfaceHA = @getWizHA
iNet:setCallback = @wizSetCallback
iNet:setParam = @wizSetParam
return modkeep
fin
pokeio(slot, regdata) // Restore register
fin
pokeio(slot, regdata) // Restore register
fin
next
//

View File

@@ -1,5 +1,4 @@
include "inc/cmdsys.plh"
sysflags nojitc // No need to speed this up
def argDelim(str)
byte n

View File

@@ -3,7 +3,6 @@
//
include "inc/cmdsys.plh"
include "inc/inet.plh"
sysflags nojitc // No need to JITC this temp loaded module
//
// Needed to init subnet
//
@@ -138,7 +137,7 @@ end
def recvDHCP(remip, remport, pkt, len, param)
word servopts, maskopts, gwopts, dnsopts
//puts("recvDHCP: ");putip(remip);putc(':');puti(remport);putln
//putip(remip);putc(':');puti(remport);putln
//dumpdhcp(pkt)
if pkt=>dhcp_xid:0 == $0201 and pkt=>dhcp_xid:2 == $0403
when pkt->dhcp_opts.[parseopts(@pkt->dhcp_opts, 53) + 2]
@@ -156,10 +155,10 @@ def recvDHCP(remip, remport, pkt, len, param)
iNet:sendUDP(portDHCP, 0, DHCP_SERVER_PORT, @DHCP, @endDHCP - @DHCP)
break
is DHCP_ACK
optsOP.2 = DHCP_ACK
//
// Copy parameters to working copy
//
optsOP.2 = DHCP_ACK
memcpy(@localip, @pkt->dhcp_yourip, IP4ADR_SIZE)
maskopts = parseopts(@pkt->dhcp_opts, 1) + 2
if maskopts >= 0
@@ -188,7 +187,7 @@ iNet:getInterfaceHA(@optsCID.3)
//
// Clear our local IP address
//
iNet:setInterfaceIP(@zeros, @ones, @zeros)
iNet:setInterfaceIP(@zeros,@ones, @zeros)
//
// Prepare to receive DHCP packets from a server
//
@@ -207,17 +206,17 @@ repeat
optsSRV = 255
DHCP.dhcp_secs.1 = retry
iNet:sendUDP(portDHCP, 0, DHCP_SERVER_PORT, @DHCP, @optsSRV - @DHCP + 1)
for timeout = 0 to 4000
for timeout = 0 to 1000
iNet:serviceIP()
if optsOP.2 == DHCP_ACK
break
fin
next
retry++
retry = retry + 1
until retry > 4 or optsOP.2 == DHCP_ACK
iNet:closeUDP(portDHCP)
iNet:setInterfaceIP(@localip, @localnet, @localgw)
puts("Apple II bound to:\n");putip(@localip);putc('/');putip(@localnet);putln
iNet:setDNS(@localdns)
puts("DNS:");putip(@localdns);putln
//puts("DNS: ");putip(@localdns);putln
done

View File

@@ -52,6 +52,7 @@ const IP_PROTO_TCP = $06
//
// ICMP type/codes
//
const IP_PROTO_ICMP = 1
const ICMP_ECHO_REQST = 8
const ICMP_ECHO_REPLY = 0
//
@@ -100,7 +101,7 @@ const ARP_REQST = $0100 // BE format
const ARP_REPLY = $0200 // BE format
struc t_arp
word arp_hw
word arp_prot
word arp_proto
byte arp_hlen
byte arp_plen
word arp_op
@@ -154,8 +155,8 @@ struc t_notify
word notify_func
word notify_parm
end
byte[t_notify] portsUDP[MAX_UDP_NOTIFIES]
byte[t_notify] portsTCP[MAX_TCP_NOTIFIES]
byte[t_notify * MAX_UDP_NOTIFIES] portsUDP
byte[t_notify * MAX_TCP_NOTIFIES] portsTCP
//
// Service ICMP hook
//
@@ -378,14 +379,12 @@ end
// Open TCP socket in SERVER mode
//
def etherListenTCP(lclport, callback, param)
puts("TCP/IP not yet implented for this hardware.\n")
return 0
end
//
// Open TCP socket in CLIENT mode
//
def etherConnectTCP(remip, remport, lclport, callback, param)
puts("TCP/IP not yet implented for this hardware.\n")
return 0
end
//
@@ -587,6 +586,7 @@ def getEtherHA(ha)
if ha; memcpy(ha, @myMAC, MAC_SIZE); fin
return MAC_SIZE
end
//
// Fill in iNet class
//
@@ -602,8 +602,4 @@ iNet:setInterfaceIP = @setEtherIP
iNet:getInterfaceHA = @getEtherHA
iNet:setCallback = @etherSetCallback
iNet:setParam = @etherSetParam
//
// Keep module in memory
//
return modkeep
done

View File

@@ -19,7 +19,6 @@ byte fbrNext[MAX_FIBERS]
word fbrVMState[MAX_FIBERS]
word fbrPool
byte fbrRunning = 0
export byte fbrCount = 0
//
// Zero Page VM state and 6502 stack
//
@@ -137,7 +136,6 @@ export def fbrInit(numPool)
else
return -1
fin
fbrCount = 1
return 0
end
//
@@ -153,7 +151,6 @@ export def fbrStop(fid)#0
//
// Remove fiber from RUN list and tag as free
//
fbrCount--
fbrState[fid] = FIBER_FREE
i = 0
while fbrNext[i] <> fid
@@ -215,7 +212,6 @@ export def fbrStart(defaddr, param)
//
// Return fiber ID (index)
//
fbrCount++
return i
fin
next

View File

@@ -3,7 +3,6 @@
//
include "inc/cmdsys.plh"
include "inc/sane.plh"
include "inc/fpstr.plh"
//
// Structures for DEC2BIN, BIN2DEC
//
@@ -20,13 +19,14 @@ end
// Parse string into decrecord, return SANE conversion output
//
export def str2ext(str, ext)
byte i, d
byte i, s, d
byte decrec[t_decrecord]
word sgnadj, expadj
decrec:sgn = 0
decrec:exp = 0
decrec.sig = 0
s = 1
i = 1
//
// Skip whitespace
@@ -51,34 +51,27 @@ export def str2ext(str, ext)
// Parse number
//
while i <= ^str
d = ^(str+i)
d = toupper(^(str+i))
if d >= '0' and d <= '9'
//
// Parse digit
//
decrec.sig[s] = ^(str+i)
decrec:sig++
decrec.sig[decrec.sig] = d
s++
elsif d == '.'
//
// Parse decimal point
//
i++
if !decrec.sig
//
// Skip leading zeros
//
while i <= ^str and ^(str+i) == '0'
decrec:exp--
i++
loop
fin
while i <= ^str
d = ^(str+i)
d = toupper(^(str+i))
if d >= '0' and d <= '9'
decrec.sig[s] = ^(str+i)
decrec.sig++
decrec.sig[decrec.sig] = d
decrec:exp--
elsif d == 'E' or d == 'e'
s++
elsif d == 'E'
i--
break
else
@@ -86,7 +79,7 @@ export def str2ext(str, ext)
fin
i++
loop
elsif d == 'E' or d == 'e'
elsif d == 'E'
//
// Parse exponent
//
@@ -115,20 +108,21 @@ export def str2ext(str, ext)
i++
loop
//
// Strip trailing zeros from sig
// Strip leading zeros from sig
//
while decrec.sig > 0 and decrec.sig[decrec.sig] == '0'
while decrec.sig > 1 and decrec.sig.1 == '0'
decrec.sig--
decrec:exp++
if decrec:exp < 0
decrec:exp--
fin
memcpy(@decrec.sig.1, @decrec.sig.2, decrec.sig)
loop
//
// Check for zero
//
if !decrec.sig
decrec.sig = 1
decrec.sig = 1
decrec.sig.1 = '0'
decrec:sgn = 0
decrec:exp = 0
fin
sane:saveZP()
return sane:restoreZP(sane:op2FP(FFEXT|FOD2B, ext, @decrec))
@@ -137,15 +131,14 @@ end
// Convert extended FP to string using , return string
//
export def ext2str(ext, str, intdigits, fracdigits, format)
byte d, numdigits
word istr, dp, tens
byte d, i, sigdigits, numdigits
word dp, tens
byte decform[t_decformat]
byte decrec[t_decrecord]
numdigits = intdigits + fracdigits
decform:style = format & FPSTR_FIXED
numdigits = intdigits + fracdigits
decform:style = format & $01
decform:digits = decform:style ?? fracdigits :: numdigits
decrec:exp = 0
sane:saveZP()
sane:restoreZP(sane:op3FP(FFEXT|FOB2D, @decrec, ext, @decform))
^(str+1) = decrec.sgn ?? '-' :: ' '
@@ -163,115 +156,93 @@ export def ext2str(ext, str, intdigits, fracdigits, format)
^str = 4
return str
fin
if decrec.sig.1 == '0'
while decrec.sig < fracdigits
decrec.sig++
decrec.sig[decrec.sig] = '0'
loop
decrec:exp = -decrec.sig
fin
dp = decrec.sig + decrec:exp
if format & FPSTR_EXP
if format & FPSTR_STRIP
//
// Strip off trailing fractional zeros
//
while decrec.sig > 1 and decrec.sig[decrec.sig] == '0'
decrec.sig--
decrec:exp++
loop
fin
sigdigits = decrec.sig
if decrec:exp < 0 and format & $02
//
// Copy over all significant digits
// Strip off trailing fractional zeros
//
while sigdigits > dp and decrec.sig[sigdigits] == '0'
sigdigits--
decrec:exp++
loop
fin
if -decrec:exp > numdigits or sigdigits + decrec:exp >= (decform:style ?? intdigits :: numdigits) or format & $04
//
// Convert to exponential format
//
^(str+2) = decrec.sig.1
^(str+3) = '.'
istr = str + 3
for d = 2 to decrec.sig
istr++
^istr = decrec.sig[d]
i = 3
for d = 0 to fracdigits
i++
^(str+i) = decrec.sig.2[d]
next
if ^istr == '.'; istr--; fin
//
// Print exponent as 4 digits with leading zeros
// Copy over all significant digits
//
istr++
^istr = 'E'
istr++
if ^(str+i) == '.'; i--; fin
i++
^(str+i) = 'E'
i++
dp--
if dp < 0
^istr = '-'
^(str+i) = '-'
dp = -dp
else
^istr = '+'
fin
tens = 1000
while tens
istr++
^istr = (dp / tens) + '0'
dp = dp % tens
tens = tens / 10
loop
else
if format & FPSTR_STRIP and decrec:exp < 0
//
// Strip off trailing fractional zeros
//
while decrec.sig > dp and decrec.sig[decrec.sig] == '0'
decrec.sig--
decrec:exp++
loop
fin
if decrec:sig == 1 | '0'<<8
//
// Case of zero or underflow
//
if decrec:exp == 0
//
// Zero
//
if format & FPSTR_FIXED
//
// Add trailing fractional zeros
//
dp = 1 - fracdigits
fin
elsif format & FPSTR_FLEX
//
// Underflow
//
dp = -fracdigits - 1
^(str+i) = '+'
if dp == 0
i++
^(str+i) = '0'
fin
fin
if format & FPSTR_FLEX and (dp < -fracdigits or dp > (format & FPSTR_FIXED ?? intdigits :: numdigits))
//
// Print as exponent if over/underflow fixed digits
//
if numdigits < 7; numdigits = 7; fin
return ext2str(ext, str, 1, numdigits - 7, FPSTR_EXP | (format & FPSTR_STRIP))
fin
//
// Pretty output the exponent (preceding zero for values less than 10)
//
d = 0
tens = 10000
while dp
d = d or tens <= 10
if dp >= tens or d
d = 1
i++
^(str+i) = (dp / tens) + '0'
fin
dp = dp % tens
tens = tens / 10
if !tens; break; fin
loop
else
//
// Convert as floating point
//
i = 1
if dp <= 0
*(str+2) = '0'|('.'<<8)
istr = str + 3
i = 3
while dp < 0
dp++
istr++
^istr = '0'
i++
^(str+i) = '0'
loop
else
istr = str + 1
fin
for d = 1 to decrec.sig
istr++
^istr = decrec.sig[d]
for d = 1 to sigdigits
i++
^(str+i) = decrec.sig[d]
if d == dp
istr++
^istr = '.'
i++
^(str+i) = '.'
fin
next
if ^istr == '.'; istr--; fin
if ^(str+i) == '.'; i--; fin
fin
^str = istr - str
^str = i
return str
end
//
// Keep module in memory
//
return modkeep
done

View File

@@ -369,8 +369,4 @@ def reset
next
return sane:restoreZP(0)
end
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,5 +1,24 @@
include "inc/cmdsys.plh"
include "inc/inet.plh"
//
// iNet API - must match inet.plh
//
struc t_inet
word initIP
word serviceIP
word openUDP
word sendUDP
word closeUDP
word listenTCP
word connectTCP
word sendTCP
word closeTCP
word setInterfaceIP
word getInterfaceHA
word setDNS
word resolveIP
word setCallback
word setParam
end
//
// DNS message
//
@@ -14,7 +33,7 @@ end
//
// External interface to net class. Must be first.
//
res[t_inet] iNet
export byte[t_inet] iNet
//
// List of loadable network device drivers
//
@@ -35,6 +54,12 @@ def iNetSetDNS(ipptr)
return 0
end
//def putb(hexb)
// return call($FDDA, hexb, 0, 0, 0)
//end
//def puth(hex)
// return call($F941, hex >> 8, hex, 0, 0)
//end
//def dumpbytes(buf, len)
// word i
//
@@ -62,14 +87,14 @@ def parseIP(ipstr, ipaddr)
endstr = ipstr + ^ipstr
for i = 0 to 3
ipstr = ipstr + 1
while ^ipstr >= '0' and ^ipstr <= '9' and ipstr <= endstr
ipaddr->[i] = ipaddr->[i] * 10 + ^ipstr - '0'
ipstr = ipstr + 1
while ^ipstr >= '0' and ^ipstr <= '9' and ipstr <= endstr
ipaddr->[i] = ipaddr->[i] * 10 + ^ipstr - '0'
ipstr = ipstr + 1
loop
if ^ipstr <> '.' and ipstr < endstr
return 0
fin
loop
if ^ipstr <> '.' and ipstr < endstr
return 0
fin
next
return i == 3
end
@@ -80,11 +105,11 @@ def parseDomain(domstr, msgptr)
l = 0
for i = 1 to ^domstr
if domstr->[i] == '.'
msgptr->[l] = i - l - 1
l = i
else
msgptr->[i] = domstr->[i]
fin
msgptr->[l] = i - l - 1
l = i
else
msgptr->[i] = domstr->[i]
fin
next
msgptr->[l] = i - l - 1
msgptr = msgptr + i
@@ -129,7 +154,7 @@ def recvDNS(remip, remport, pkt, len, ipaddr)
resptr = resptr + 8
//dumpbytes(resptr + 2, ^(resptr + 1))
resptr = resptr + 2 + ^(resptr + 1); putln
r--
r = r - 1
loop
fin
stateDNS = DNS_ANSWER
@@ -146,7 +171,7 @@ def iNetResolve(namestr, ipaddr)
//
// Query Domain Name Server for address
//
dnspkt = heapalloc(^namestr + t_dnshdr + 8) // Use heap as working DNS query packet
dnspkt = heapmark // Use heap as working DNS query packet
msgptr = dnspkt
msgptr=>dnsID = $BEEF
msgptr=>dnsCode = $0001 // RD (Recursion Desired)
@@ -156,8 +181,9 @@ def iNetResolve(namestr, ipaddr)
msgptr=>dnsArCount = 0
msgptr = parseDomain(namestr, msgptr + t_dnshdr)
msgptr=>0 = $0100 // BE TYPE = Address
msgptr=>2 = $0100 // BE CLASS = Internet
msgptr=>2 = $0100 // BE CLASS = INternet
msglen = msgptr - dnspkt + 4
heapalloc(msglen)
//
// Prepare to receive DNS answer from server
//
@@ -178,34 +204,32 @@ def iNetResolve(namestr, ipaddr)
fin
return ipaddr=>0 <> 0 or ipaddr=>2 <> 0
end
//
// Initialze network stack
//
def iNetInit
//
// Look for net hardware
//
while ^driver
//puts(driver);putln
if cmdsys:modexec(driver) >= 0
//
// Get an IP address
//
cmdsys:modexec("DHCP")
iNet:resolveIP = @iNetResolve
return @iNet
break
fin
driver = driver + ^driver + 1
loop
puts("No network adapters found.\n")
return NULL
if !^driver
return 0
fin
//
// Get an IP address
//
cmdsys:modexec("DHCP")
iNet:resolveIP = @iNetResolve
return @iNet
end
//
// Fill iNet class
//
iNet:initIP = @iNetInit
iNet:setDNS = @iNetSetDNS
//
// Keep module in memory
//
return modkeep
done

View File

@@ -1,685 +0,0 @@
//
// 32 bit integer math routines
//
include "inc/cmdsys.plh"
const t_i32 = 4
//
// Include zero page definitions
//
asm int32Inc
!SOURCE "vmsrc/plvmzp.inc"
ACCUM32 = DSTH+1
DVSIGN = TMP+3
end
export asm zero32#0
LDA #$00
STA ACCUM32+0
STA ACCUM32+1
STA ACCUM32+2
STA ACCUM32+3
RTS
end
export asm zext16to32#0
LDA #$00
STA ACCUM32+2
STA ACCUM32+3
RTS
end
export asm neg32#0
LDA #$00
SEC
SBC ACCUM32+0
STA ACCUM32+0
LDA #$00
SBC ACCUM32+1
STA ACCUM32+1
LDA #$00
SBC ACCUM32+2
STA ACCUM32+2
LDA #$00
SBC ACCUM32+3
STA ACCUM32+3
RTS
end
export asm load32(i32ptr)#0
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$00
LDA (TMP),Y
STA ACCUM32+0
INY
LDA (TMP),Y
STA ACCUM32+1
INY
LDA (TMP),Y
STA ACCUM32+2
INY
LDA (TMP),Y
STA ACCUM32+3
INX
RTS
end
export asm loadi16(imm16)#0
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA ACCUM32+0
LDA ESTKH+0,X ; IMM16H
STA ACCUM32+1
BPL + ; SIGN EXTEND
DEY
+ STY ACCUM32+2
STY ACCUM32+3
INX
RTS
end
export asm store32(i32ptr)#0
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$00
LDA ACCUM32+0
STA (TMP),Y
INY
LDA ACCUM32+1
STA (TMP),Y
INY
LDA ACCUM32+2
STA (TMP),Y
INY
LDA ACCUM32+3
STA (TMP),Y
INX
RTS
end
export asm add32(i32ptr)#0
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$00
LDA (TMP),Y
CLC
ADC ACCUM32+0
STA ACCUM32+0
INY
LDA (TMP),Y
ADC ACCUM32+1
STA ACCUM32+1
INY
LDA (TMP),Y
ADC ACCUM32+2
STA ACCUM32+2
INY
LDA (TMP),Y
ADC ACCUM32+3
STA ACCUM32+3
INX
RTS
end
export asm addi16(imm16)#0
LDY #$00
LDA ESTKL+0,X ; IMM16L
CLC
ADC ACCUM32+0
STA ACCUM32+0
LDA ESTKH+0,X ; IMM16H
BPL +
DEY
+ ADC ACCUM32+1
STA ACCUM32+1
TYA
ADC ACCUM32+2
STA ACCUM32+2
TYA
ADC ACCUM32+3
STA ACCUM32+3
INX
RTS
end
export asm sub32(i32ptr)#0
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
BMI _SUB
end
export asm subi16(imm16)#0
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
_SUB LDA ACCUM32+0
SEC
SBC SRC+0
STA ACCUM32+0
LDA ACCUM32+1
SBC SRC+1
STA ACCUM32+1
LDA ACCUM32+2
SBC SRC+2
STA ACCUM32+2
LDA ACCUM32+3
SBC SRC+3
STA ACCUM32+3
INX
RTS
end
export asm shl32(imm8)#0
LDA ESTKL+0,X ; IMM8
AND #$1F
CMP #16
BCC +
LDY ACCUM32+1
STY ACCUM32+3
LDY ACCUM32+0
STY ACCUM32+2
LDY #$00
STY ACCUM32+1
STY ACCUM32+0
SBC #16
+ CMP #8
BCC +
LDY ACCUM32+2
STY ACCUM32+3
LDY ACCUM32+1
STY ACCUM32+2
LDY ACCUM32+0
STY ACCUM32+1
LDY #$00
STY ACCUM32+0
SBC #8
+ TAY
BEQ ++
- ASL ACCUM32+0
ROL ACCUM32+1
ROL ACCUM32+2
ROL ACCUM32+3
DEY
BNE -
++ INX
RTS
end
export asm shr32(imm8)#0
LDA ESTKL+0,X ; IMM8
AND #$1F
BEQ +
TAY
LDA #$80
- CMP ACCUM32
ROR ACCUM32+3
ROR ACCUM32+2
ROR ACCUM32+1
ROR ACCUM32+0
DEY
BNE -
+ INX
RTS
end
export asm mul32(i32ptr)#0
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _MUL
end
export asm muli16(imm16)#0
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
LDY #$00
_MUL LDA ACCUM32+0
STA ESTKL-1,X
LDA ACCUM32+1
STA ESTKH-1,X
LDA ACCUM32+2
STA ESTKL+0,X
LDA ACCUM32+3
STA ESTKH+0,X
STY ACCUM32+0
STY ACCUM32+1
STY ACCUM32+2
STY ACCUM32+3
LDY #$03
LDA #$80
STA TMPL
- AND SRC,Y
BEQ +
CLC
LDA ESTKL-1,X
ADC ACCUM32+0
STA ACCUM32+0
LDA ESTKH-1,X
ADC ACCUM32+1
STA ACCUM32+1
LDA ESTKL+0,X
ADC ACCUM32+2
STA ACCUM32+2
LDA ESTKH+0,X
ADC ACCUM32+3
STA ACCUM32+3
+ LSR TMPL
BCC +
DEY
BMI ++
ROR TMPL
+ ASL ACCUM32+0
ROL ACCUM32+1
ROL ACCUM32+2
ROL ACCUM32+3
LDA TMPL
BNE -
++ INX
RTS
end
export asm div32(i32ptr)#2
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03 ; DVSR = SRC..SRC+3
LDA (TMP),Y
BMI +
STA SRC+3
DEY
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _DIV
+ SEC
- LDA #$00
SBC (TMP),Y
STA SRC,Y
DEY
BPL -
LDY #$01
BNE _DIV
end
export asm divi16(imm16)#2
LDY #$00 ; DVSR = SRC..SRC+3
STY SRC+2
STY SRC+3
LDA ESTKH+0,X ; IMM16H
BPL +
TYA ; DVSR IS NEG
SEC
SBC ESTKL+0,X ; IMM16L
STA SRC+0
TYA
SBC ESTKH+0,X ; IMM16L
STA SRC+1
INY
BNE _DIV
+ STA SRC+1
LDA ESTKL+0,X ; IMM16L
STA SRC+0
_DIV STY DVSIGN ; LSB = SIGN OF DVSR
DEX ; REMNDR = ESTK..ESTK+1
LDY #$00
STY ESTKL+0,X
STY ESTKH+0,X
STY ESTKL+1,X
STY ESTKH+1,X
LDA SRC+0 ; DIVIDE BY 0?
ORA SRC+1
ORA SRC+2
ORA SRC+3
BNE +
STA ACCUM32+0 ; SET TO 0 AND EXIT
STA ACCUM32+1
STA ACCUM32+2
STA ACCUM32+3
- RTS
+ LDA ACCUM32+0 ; DIVIDE 0?
ORA ACCUM32+1
ORA ACCUM32+2
ORA ACCUM32+3
BEQ -
LDA ACCUM32+3 ; DVDND = ACCUM32
BPL +
LDA #$81 ; DVDND IS NEG
CLC
ADC DVSIGN
STA DVSIGN
TYA
SEC
SBC ACCUM32+0
STA ACCUM32+0
TYA
SBC ACCUM32+1
STA ACCUM32+1
TYA
SBC ACCUM32+2
STA ACCUM32+2
TYA
SBC ACCUM32+3
STA ACCUM32+3
+ LDY #$21 ; #BITS+1
- ASL ACCUM32+0 ; SKIP DVDND LEADING 0 BITS
ROL ACCUM32+1
ROL ACCUM32+2
ROL ACCUM32+3
DEY
BCC -
- ROL ESTKL+0,X ; REMNDR
ROL ESTKH+0,X
ROL ESTKL+1,X
ROL ESTKH+1,X
LDA ESTKL+0,X ; REMNDR
CMP SRC+0 ; DVSR
LDA ESTKH+0,X ; COMPARE
SBC SRC+1
LDA ESTKL+1,X
SBC SRC+2
LDA ESTKH+1,X
SBC SRC+3
BCC + ; IS LESS THAN?
STA ESTKH+1,X
LDA ESTKL+0,X ; REMNDR
SBC SRC+0 ; DVSR
STA ESTKL+0,X ; SUBTRACT
LDA ESTKH+0,X
SBC SRC+1
STA ESTKH+0,X
LDA ESTKL+1,X
SBC SRC+2
STA ESTKL+1,X
SEC
+ ROL ACCUM32+0 ; DVDND
ROL ACCUM32+1 ; ROTATE IN RESULT
ROL ACCUM32+2
ROL ACCUM32+3
DEY
BNE -
LDA DVSIGN ; SET SIGNS OF RESULTS
BPL +
TYA
SEC
SBC ESTKL+0,X
STA ESTKL+0,X
TYA
SBC ESTKH+0,X
STA ESTKH+0,X
TYA
SBC ESTKL+1,X
STA ESTKL+1,X
TYA
SBC ESTKH+1,X
STA ESTKH+1,X
LDA DVSIGN
+ LSR
BCC +
TYA
SBC ACCUM32+0
STA ACCUM32+0
TYA
SBC ACCUM32+1
STA ACCUM32+1
TYA
SBC ACCUM32+2
STA ACCUM32+2
TYA
SBC ACCUM32+3
STA ACCUM32+3
+ RTS
end
export asm iseq32(i32ptr)#1
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _ISEQ
end
export asm iseqi16(imm16)#1
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
LDY #$00
_ISEQ LDA ACCUM32+0
CMP SRC+0
BNE +
LDA ACCUM32+1
CMP SRC+1
BNE +
LDA ACCUM32+2
CMP SRC+2
BNE +
LDA ACCUM32+3
CMP SRC+3
BNE +
DEY
+ STY ESTKL+0,X
STY ESTKH+0,X
RTS
end
export asm isge32(i32ptr)#1
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _ISGE
end
export asm isgei16(imm16)#1
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
LDY #$00
_ISGE LDA ACCUM32+0
CMP SRC+0
LDA ACCUM32+1
SBC SRC+1
LDA ACCUM32+2
SBC SRC+2
LDA ACCUM32+3
SBC SRC+3
BVC +
EOR #$80
+ BMI +
DEY
+ STY ESTKL+0,X
STY ESTKH+0,X
RTS
end
export asm isle32(i32ptr)#1
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _ISLE
end
export asm islei16(imm16)#1
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
LDY #$00
_ISLE LDA SRC+0
CMP ACCUM32+0
LDA SRC+1
SBC ACCUM32+1
LDA SRC+2
SBC ACCUM32+2
LDA SRC+3
SBC ACCUM32+3
BVC +
EOR #$80
+ BMI +
DEY
+ STY ESTKL+0,X
STY ESTKH+0,X
RTS
end
export asm isgt32(i32ptr)#1
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _ISGT
end
export asm isgti16(imm16)#1
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
LDY #$00
_ISGT LDA SRC+0
CMP ACCUM32+0
LDA SRC+1
SBC ACCUM32+1
LDA SRC+2
SBC ACCUM32+2
LDA SRC+3
SBC ACCUM32+3
BVC +
EOR #$80
+ BPL +
DEY
+ STY ESTKL+0,X
STY ESTKH+0,X
RTS
end
export asm islt32(i32ptr)#1
LDA ESTKL+0,X ; I32PTR
STA TMPL
LDA ESTKH+0,X ; I32PTR
STA TMPH
LDY #$03
- LDA (TMP),Y
STA SRC,Y
DEY
BPL -
INY
BEQ _ISLT
end
export asm islti16(imm16)#1
LDY #$00
LDA ESTKL+0,X ; IMM16L
STA SRC+0
LDA ESTKH+0,X ; IMM16H
STA SRC+1
BPL + ; SIGN EXTEND
DEY
+ STY SRC+2
STY SRC+3
LDY #$00
_ISLT LDA ACCUM32+0
CMP SRC+0
LDA ACCUM32+1
SBC SRC+1
LDA ACCUM32+2
SBC SRC+2
LDA ACCUM32+3
SBC SRC+3
BVC +
EOR #$80
+ BPL +
DEY
+ STY ESTKL+0,X
STY ESTKH+0,X
RTS
end
export def i32tos(i32ptr, strptr)#1
res[t_i32] save
word iptr, rem
char[12] istr
iptr = @istr.11
store32(@save)
load32(i32ptr)
if i32ptr->3 & $80
neg32()
putc('-')
fin
repeat
drop, rem = divi16(10) // Only care about LSW of remainder
^iptr = rem + '0'
iptr--
until iseqi16(0)
^iptr = @istr.11 - iptr
strcpy(strptr, iptr)
load32(@save)
return strptr
end
export def puti32(i32ptr)#0
char[12] i32str
puts(i32tos(i32ptr, @i32str))
end
//
// Keep module in memory
//
return modkeep
done

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,510 +0,0 @@
include "inc/cmdsys.plh"
predef nopLin(a, b, c)#0
predef nopPix(a, b)#0
byte jmpplot = $4C // Sneaky!
var plot = @nopPix
var hspan = @nopLin
var vspan = @nopLin
var err, shorterr, shortlen, longerr, longlen
//def nopLin(a, b, c)#0
//end
//def majorspans(majorstart, major, majorend, minor, dir, majorspan)#0
// //
// // Initial half-span step
// //
// err = err + shorterr
// repeat
// majorspan(majorstart, major, minor)#0
// minor = minor + dir // Move to next span
// majorstart = major + 1 // Start of next span = end of previous + 1
// if err >= 0 // Short span
// err = err + shorterr
// major = major + shortlen
// else // Long span
// err = err + longerr
// major = major + longlen
// fin
// until major >= majorend
// //
// // Final half-span step
// //
// majorspan(majorstart, majorend, minor)#0
//end
asm majorspans(majorstart, major, majorend, minor, dir, majorspan)#0
!SOURCE "vmsrc/plvmzp.inc"
LDA $1000 ; ERRL
CLC
ADC $2000 ; SHORTERRL
STA $1000 ; ERRL
LDA $1001 ; ERRH
ADC $2001 ; SHORTERRH
STA $1001 ; ERRH
LDA ESTKL+0,X ; MAJORSPANL
STA $A000
STA $B000
LDA ESTKH+0,X ; MAJORSPANH
STA $A001
STA $B001
end
asm _majorspansA
- DEX
DEX
DEX
LDA ESTKL+8,X ; MAJORSTARTL
STA ESTKL+2,X
LDA ESTKH+8,X ; MAJORSTARTH
STA ESTKH+2,X
LDA ESTKL+7,X ; MAJORL
STA ESTKL+1,X
LDA ESTKH+7,X ; MAJORH
STA ESTKH+1,X
LDA ESTKL+5,X ; MINORL
STA ESTKL+0,X
LDA ESTKH+5,X ; MINORH
STA ESTKH+0,X
JSR $A000
LDA ESTKL+2,X ; MINORL
CLC
ADC ESTKL+1,X ; DIRL
STA ESTKL+2,X
LDA ESTKH+2,X ; MINORH
ADC ESTKH+1,X ; DIRH
STA ESTKH+2,X
LDA ESTKL+4,X ; MAJORL
CLC
ADC #$01
STA ESTKL+5,X ; MAJORSTARTL
LDA ESTKH+4,X ; MAJORH
ADC #$00
STA ESTKH+5,X ; MAJORSTARTH
end
asm _majorspansB
LDY $1001 ; ERRH
BMI +
end
asm _majorspansC
LDA $1000 ; ERRL
CLC
ADC $2000 ; SHORTERRL
STA $1000 ; ERRL
TYA ; ERRH
ADC $2001 ; SHORTERRH
STA $1001 ; ERRH
LDA ESTKL+4,X ; MAJORL
CLC
ADC $3000 ; SHORTLENL
STA ESTKL+4,X
LDA ESTKH+4,X ; MAJORH
ADC $3001 ; SHORTLENH
STA ESTKH+4,X
LDA ESTKL+4,X ; MAJORL
CMP ESTKL+3,X ; MAJORENDL
LDA ESTKH+4,X ; MAJORH
SBC ESTKH+3,X ; MAJORENDH
BCC -
BCS ++
end
asm _majorspansD
+ LDA $1000 ; ERRL
CLC
ADC $4000 ; LONGERRL
STA $1000 ; ERRL
TYA ; ERRH
ADC $4001 ; LONGERRL
STA $1001 ; ERRH
LDA ESTKL+4,X ; MAJORL
CLC
ADC $5000 ; LONGLENL
STA ESTKL+4,X
LDA ESTKH+4,X ; MAJORH
ADC $5001 ; LONGLENH
STA ESTKH+4,X
LDA ESTKL+4,X ; MAJORL
CMP ESTKL+3,X ; MAJORENDL
LDA ESTKH+4,X ; MAJORH
SBC ESTKH+3,X ; MAJORENDH
BCS ++
end
asm _majorspansE
JMP $6000
++ DEX
DEX
DEX
LDA ESTKL+8,X ; MAJORSTARTL
STA ESTKL+2,X
LDA ESTKH+8,X ; MAJORSTARTH
STA ESTKH+2,X
LDA ESTKL+6,X ; MAJORENDL
STA ESTKL+1,X
LDA ESTKH+6,X ; MAJORENDH
STA ESTKH+1,X
LDA ESTKL+5,X ; MINORL
STA ESTKL+0,X
LDA ESTKH+5,X ; MINORH
STA ESTKH+0,X
JSR $B000
TXA
CLC
ADC #$06
TAX
RTS
end
asm nopLin(a, b, c)#0
INX
end
asm nopPix(a, b)#0
INX
INX
RTS
end
//def hline(x1, x2, dx2, y, dy2, sy)#0
// var dyx2, x
//
// err = dy2 - dx2 / 2
// dyx2 = dy2 - dx2
// for x = x1 to x2
// plot(x, y)#0
// if err >= 0
// y = y + sy
// err = err + dyx2
// else
// err = err + dy2
// fin
// next
//end
asm hline(x1, x2, dx2, y, dy2, sy)#0
LDA ESTKH+3,X ; DX2H
LSR
STA TMPH
LDA ESTKL+3,X ; DX2L
ROR
STA TMPL
LDA ESTKL+1,X ; DY2L
SEC
SBC TMPL
STA $1000 ; ERRL
LDA ESTKH+1,X ; DY2H
SBC TMPH
STA $1001 ; ERRH
LDA ESTKL+1,X ; DY2L
SEC
SBC ESTKL+3,X ; DX2L
STA ESTKL+3,X ; DYX2L
LDA ESTKH+1,X ; DY2H
SBC ESTKH+3,X ; DX2H
STA ESTKH+3,X ; DYX2H
- DEX
DEX
LDA ESTKL+7,X ; XL
STA ESTKL+1,X
LDA ESTKH+7,X ; XH
STA ESTKH+1,X
LDA ESTKL+4,X ; YL
STA ESTKL+0,X
LDA ESTKH+4,X ; YH
STA ESTKH+0,X
end
asm _hlineA
JSR $2000 ; PLOT
LDA $1001 ; ERRH
BMI +
LDA ESTKL+2,X ; YL
CLC
ADC ESTKL+0,X ; SYL
STA ESTKL+2,X
LDA ESTKH+2,X ; YH
ADC ESTKH+0,X ; SYH
STA ESTKH+2,X
LDA ESTKL+3,X ; DYX2L
LDY ESTKH+3,X ; DYX2H
BEQ ++
BNE ++
end
asm _hlineB
+ LDA ESTKL+1,X ; DY2L
LDY ESTKH+1,X ; DY2H
++ CLC
ADC $1000 ; ERRL
STA $1000 ; ERRL
TYA
ADC $1001 ; ERRH
STA $1001 ; ERRH
LDA ESTKL+5,X ; X1L
CMP ESTKL+4,X ; X2L
LDA ESTKH+5,X
SBC ESTKH+4,X
BCS +
INC ESTKL+5,X ; XL
BNE -
INC ESTKH+5,X ; XH
BCC -
+ TXA
ADC #$05
TAX
RTS
end
//def vline(y1, y2, dy2, x, dx2, sx)#0
// var dxy2, y
//
// err = dx2 - dy2 / 2
// dxy2 = dx2 - dy2
// for y = y1 to y2
// plot(x, y)#0
// if err >= 0
// x = x + sx
// err = err + dxy2
// else
// err = err + dx2
// fin
// next
//end
asm vline(y1, y2, dy2, x, dx2, sx)#0
LDA ESTKH+3,X ; DY2H
LSR
STA TMPH
LDA ESTKL+3,X ; DY2L
ROR
STA TMPL
LDA ESTKL+1,X ; DX2L
SEC
SBC TMPL
STA $1000 ; ERRL
LDA ESTKH+1,X ; DX2H
SBC TMPH
STA $1001 ; ERRH
LDA ESTKL+1,X ; DX2L
SEC
SBC ESTKL+3,X ; DX2L
STA ESTKL+3,X ; DXY2L
LDA ESTKH+1,X ; DX2H
SBC ESTKH+3,X ; DY2H
STA ESTKH+3,X ; DXY2H
- DEX
DEX
LDA ESTKL+4,X ; XL
STA ESTKL+1,X
LDA ESTKH+4,X ; XH
STA ESTKH+1,X
LDA ESTKL+7,X ; YL
STA ESTKL+0,X
LDA ESTKH+7,X ; YH
STA ESTKH+0,X
end
asm _vlineA
JSR $2000 ; PLOT
LDA $1001 ; ERRH
BMI +
LDA ESTKL+2,X ; XL
CLC
ADC ESTKL+0,X ; SXL
STA ESTKL+2,X
LDA ESTKH+2,X ; XH
ADC ESTKH+0,X ; SXH
STA ESTKH+2,X
LDA ESTKL+3,X ; DXY2L
LDY ESTKH+3,X ; DXY2H
BEQ ++
BNE ++
end
asm _vlineB
+ LDA ESTKL+1,X ; DX2L
LDY ESTKH+1,X ; DX2H
++ CLC
ADC $1000 ; ERRL
STA $1000 ; ERRL
TYA
ADC $1001 ; ERRH
STA $1001 ; ERRH
LDA ESTKL+5,X ; Y1L
CMP ESTKL+4,X ; Y2L
LDA ESTKH+5,X
SBC ESTKH+4,X
BCS +
INC ESTKL+5,X ; YL
BNE -
INC ESTKH+5,X ; YH
BCC -
+ TXA
ADC #$05
TAX
RTS
end
export def setlinespans(h, v)#0
hspan = h
vspan = v
end
def hmajorspans(x1, y1, x2, y2, dx, dy, sy)#0
var dy2, halflen, rem
//
// Half-span length and error
//
dy2 = dy * 2
halflen, rem = divmod(dx, dy2)
err = dy2 - rem
//
// Long-span length = half-span length * 2
//
longlen = (halflen + 1) * 2
longerr = err * 2
if longerr >= dy2
longerr = longerr - dy2
longlen--
fin
//
// Short-span length = long-span length - 1
//
shortlen = longlen - 1
shorterr = longerr - dy2
majorspans(x1, x1 + halflen, x2, y1, sy, hspan)
end
def vmajorspans(x1, y1, x2, y2, dx, dy, sx)#0
var dx2, halflen, rem
//
// Half-span length and error
//
dx2 = dx * 2
halflen, rem = divmod(dy, dx2)
err = dx2 - rem
//
// Long-span length = half-span length * 2
//
longlen = (halflen + 1) * 2
longerr = err * 2
if longerr >= dx2
longerr = longerr - dx2
longlen--
fin
shortlen = longlen - 1
shorterr = longerr - dx2
majorspans(y1, y1 + halflen, y2, x1, sx, vspan)
end
export def linespans(x1, y1, x2, y2)#0
var dx, dy, dx2, dy2, halflen, rem, sx, sy
sx = 1
sy = 1
dx = x2 - x1
if dx < 0
sx = -1; dx = -dx
fin
dy = y2 - y1
if dy < 0
sy = -1; dy = -dy
fin
if dx >= dy
if sx < 0
y1, y2 = y2, y1
x1, x2 = x2, x1
sy = -sy
fin
if dy == 0
hspan(x1, x2, y1)#0; return
fin
//
// JIT optimize setup
//
hmajorspans(x1, y1, x2, y2, dx, dy, sy)
else
if sy < 0
x1, x2 = x2, x1
y1, y2 = y2, y1
sx = -sx
fin
if dx == 0
vspan(y1, y2, x1)#0; return
fin
//
// JIT optimize inner setup
//
vmajorspans(x1, y1, x2, y2, dx, dy, sx)
fin
end
export def setlineplot(p)#0
plot = p
end
export def line(x1, y1, x2, y2)#0
var sx, sy, dx2, dy2
sx = 1
sy = 1
dx2 = (x2 - x1) * 2
if dx2 < 0
sx = -1; dx2 = -dx2
fin
dy2 = (y2 - y1) * 2
if dy2 < 0
sy = -1; dy2 = -dy2
fin
if dx2 >= dy2
if sx < 0
x1, x2 = x2, x1
y1, y2 = y2, y1
sy = -sy
fin
hline(x1, x2, dx2, y1, dy2, sy)
else
if sy < 0
y1, y2 = y2, y1
x1, x2 = x2, x1
sx = -sx
fin
vline(y1, y2, dy2, x1, dx2, sx)
fin
end
//
// Assembly fixups
//
majorspans:1 = @err
majorspans:5 = @shorterr
majorspans:8 = @err
majorspans:11 = @err.1
majorspans:14 = @shorterr.1
majorspans:17 = @err.1
majorspans:22 = @_majorspansA.28
majorspans:25 = @_majorspansE.31
majorspans:30 = @_majorspansA.29
majorspans:33 = @_majorspansE.32
_majorspansB:1 = @err.1
_majorspansC:1 = @err
_majorspansC:5 = @shorterr
_majorspansC:8 = @err
_majorspansC:12 = @shorterr.1
_majorspansC:15 = @err.1
_majorspansC:21 = @shortlen
_majorspansC:28 = @shortlen.1
_majorspansD:1 = @err
_majorspansD:5 = @longerr
_majorspansD:8 = @err
_majorspansD:12 = @longerr.1
_majorspansD:15 = @err.1
_majorspansD:21 = @longlen
_majorspansD:28 = @longlen.1
_majorspansE:1 = @_majorspansA
hline:16 = @err
hline:23 = @err.1
_hlineA:1 = @jmpplot
_hlineA:4 = @err.1
_hlineB:6 = @err
_hlineB:9 = @err
_hlineB:13 = @err.1
_hlineB:16 = @err.1
vline:16 = @err
vline:23 = @err.1
_vlineA:1 = @jmpplot
_vlineA:4 = @err.1
_vlineB:6 = @err
_vlineB:9 = @err
_vlineB:13 = @err.1
_vlineB:16 = @err.1
//
// Keep module in memory
//
return modkeep
done

View File

@@ -60,11 +60,10 @@ export asm throw(env, retval)
DEC DST+1
LDX TMPL
TXS
LDY #$FE
LDY TMPL
- LDA (DST),Y
STA $0100,Y
DEY
CPY TMPL
INY
BNE -
LDX ESP
LDA SRC

View File

@@ -1,91 +0,0 @@
include "inc/cmdsys.plh"
asm incs
!SOURCE "vmsrc/plvmzp.inc"
end
//
// Always forward copy memory - important for overlapping match sequences
//
asm bcpy(dst, src, len)#0
INX
INX
INX
LDA ESTKL-3,X
ORA ESTKH-3,X
BEQ CPYEX
LDA ESTKL-1,X
STA DSTL
LDA ESTKH-1,X
STA DSTH
LDA ESTKL-2,X
STA SRCL
LDA ESTKH-2,X
STA SRCH
LDY ESTKL-3,X
BEQ CPYLP
INC ESTKH-3,X
LDY #$00
CPYLP LDA (SRC),Y
STA (DST),Y
INY
BNE +
INC DSTH
INC SRCH
+ DEC ESTKL-3,X
BNE CPYLP
DEC ESTKH-3,X
BNE CPYLP
CPYEX RTS
end
//
// Unpack LZ4 sequence into buffer, return unpacked length
//
export def lz4Unpack(seq, seqend, buff, buffend)
word data, len, match, i
byte token
data = buff
while isult(seq, seqend)
token = ^seq
seq++
len = token >> 4
if len
//
// Literal sequence
//
if len == 15
while ^seq == 255
len = len + 255
seq++
loop
len = len + ^seq
seq++
fin
if isuge(data + len, buffend); return 0; fin
bcpy(data, seq, len)
data = data + len
seq = seq + len
fin
len = token & $0F
if len or isult(seq, seqend)
//
// Match sequence
//
match = data - *seq
seq = seq + 2
len = len + 4
if len == 19 // $0F + 4
while ^seq == 255
len = len + 255
seq++
loop
len = len + ^seq
seq++
fin
if isuge(data + len, buffend); return 0; fin
bcpy(data, match, len)
data = data + len
fin
loop
return data - buff
end
done

View File

@@ -544,7 +544,7 @@ export def hmemNew(size)
//
// Allocate 3/4 of available heap on 128K machine, 1/2 on 64K machine
//
poolsize = (heapavail >> 1) & $7FFF
poolsize = ((@page - heapmark) >> 1) & $7FFF
if MACHID & $30 == $30
poolsize = poolsize + (poolsize >> 1)
fin
@@ -666,7 +666,7 @@ end
// !!! Does this work on Apple ///???
//
sysbuf = $0800 // heapallocalign(1024, 8, 0)
initdata = heapalloc(t_initdata) // Use data on heap for initialization
initdata = heapmark // Use data at top of heap for initialization
initdata=>volparms.0 = 2
initdata=>volparms.1 = 0
initdata=>volparms:2 = sysbuf
@@ -733,6 +733,5 @@ repeat
fin
until !initdata->filecnt
fileio:close(initdata->catref)
heaprelease(initdata)
//puts(@swapvol); putln
done

View File

@@ -734,21 +734,19 @@ def loadcode(codefile)
ref = fileio:open(strcat(strcpy(@filepath, cmdsys:syspath), codefile))
//puts("ref = "); prbyte(ref); puts(" perr = "); prbyte(perr); putln
if ref
pcode = heapalloc(512)
pcode = heapmark
fileio:read(ref, pcode, 512)
//puts("Read header bytes: "); puti(seglen)
//if seglen == 0; puts(" perr = "); prbyte(perr); fin
//getc; putln
//dumpheader(pcode)
//putname(pcode + segname + 8); putc('='); prword(pcode); putln
heaprelease(pcode + (pcode + t_diskinfo)=>codeaddr) // REserve heap to end of buffer
seglen = fileio:read(ref, pcode, (pcode + t_diskinfo)=>codeaddr)
//puts("Read segment bytes: "); puti(seglen); putln
fileio:close(ref)
if !fp6502 and (MACHID & $F0 == $B0) // 128K Apple //e or //c
seglen = fixup(AUXADDR, pcode + seglen - 2) - pcode
auxmove(AUXADDR, pcode, seglen)
heaprelease(pcode)
pcode = AUXADDR
else
heaprelease(fixup(pcode, pcode + seglen - 2)) // Set heap to beginning of relocation list
@@ -839,8 +837,10 @@ def fpInit()
fpzpsave = heapalloc($0034*2)
(@fixupXS)=>1 = fpzpsave+$34
(@fixupXR)=>1 = fpzpsave+$34
sane[9] = @zpSaveX
sane[10] = @zpRestoreX
zpSaveX // Clear XBYTEs
heaprelease(fpzpsave)
sane[9] = @zpNopSave//zpSaveX
sane[10] = @zpNopRestore//zpRestoreX
else // Apple II
fpzpsave = heapalloc($0034)
sane[9] = @zpSave
@@ -894,8 +894,4 @@ end
def uninit3(op, dst, src, src2)
return uninit
end
//
// Keep module in memory
//
return modkeep
done

993
src/libsrc/wiznet.pla Normal file
View File

@@ -0,0 +1,993 @@
//
// Wiznet 5100 based ethernet card
//
// TCP/IP is built into hardware, so no dependencies on the software
// layers, like the Uthernet
//
include "inc/cmdsys.plh"
//
// Net object
//
import inet
word iNet
end
struc t_inet
word initIP
word serviceIP
word openUDP
word sendUDP
word closeUDP
word listenTCP
word connectTCP
word sendTCP
word closeTCP
word setInterfaceIP
word getInterfaceHA
word setCallback
word setParam
end
//
// Module don't free memory
//
const modkeep = $2000
const modinitkeep = $4000
//
// Wiznet registers
//
const WIZ_MR = $00
const WIZ_GWR = $01
const WIZ_SUBR = $05
const WIZ_SHAR = $09
const WIZ_SIPR = $0F
const WIZ_IR = $15
const WIZ_IMR = $16
const WIZ_RTR = $17
const WIZ_RCR = $19
const WIZ_RMSR = $1A
const WIZ_TMSR = $1B
const WIZ_PATR = $1C
const WIZ_PTMR = $28
const WIZ_PMGC = $29
const WIZ_UIPR = $2A
const WIZ_UPRT = $2E
//
// Wiznet socket registers
//
const WIZ_SREGS = $0400
const WIZ_SSIZE = $0100
const WIZ_SOCK0 = $0400
const WIZ_SOCK1 = $0500
const WIZ_SOCK2 = $0600
const WIZ_SOCK3 = $0700
const WIZ_SnMR = $00
const WIZ_SnCR = $01
const WIZ_SnIR = $02
const WIZ_SnSR = $03
const WIZ_SnPORT = $04
const WIZ_SnDHAR = $06
const WIZ_SnDIPR = $0C
const WIZ_SnDPORT = $10
const WIZ_SnMSSR = $12
const WIZ_SnPROTO = $14
const WIZ_SnTOS = $15
const WIZ_SnTTL = $16
const WIZ_SnFSR = $20
const WIZ_SnTXRD = $22
const WIZ_SnTXWR = $24
const WIZ_SnRSR = $26
const WIZ_SnRXRD = $28
//
// Wiznet socket data
//
const WIZ_TXMEM = $4000
const WIZ_TXSIZE = $0800
const WIZ_TXMASK = WIZ_TXSIZE-1
const WIZ_TXMEM0 = $4000
const WIZ_TXMEM1 = $4800
const WIZ_TXMEM2 = $5000
const WIZ_TXMEM3 = $5800
const WIZ_RXMEM = $6000
const WIZ_RXSIZE = $0800
const WIZ_RXMASK = WIZ_RXSIZE-1
const WIZ_RXMEM0 = $6000
const WIZ_RXMEM1 = $6800
const WIZ_RXMEM2 = $7000
const WIZ_RXMEM3 = $7800
//
// Wiznet indirect registers
//
byte regidx, regdata
word slot, saveidx
//
// Wiznet MAC address
//
byte[6] wizMAC = $00,$0A,$99,$1E,$02,$B0
//
// Wiznet IP addresses
//
byte[4] localip
byte[4] subnet
byte[4] gateway
//
// Predefine service routine
//
predef wizServiceIP
//
// Segment list element
//
struc t_segment
word seg_buf
word seg_len
end
//
// Max Ethernet frame size
//
const MAX_FRAME_SIZE = 1518
const MAC_BROADCAST = $FFFF
const MAC_SIZE = 6
//
// Ethernet header
//
struc t_ethrhdr
byte[MAC_SIZE] ethr_dst
byte[MAC_SIZE] ethr_src
word ethr_payload
end
const PAYLOAD_IP = $0008 // BE format
const PAYLOAD_ARP = $0608 // BE format
//
// IP datagram header
//
const IP4ADR_SIZE = 4
struc t_iphdr
byte ip_vers_hlen
byte ip_service
word ip_length
word ip_id
word ip_flags_fragofst
byte ip_ttl
byte ip_proto
word ip_chksm
byte[IP4ADR_SIZE] ip_src
byte[IP4ADR_SIZE] ip_dst
byte[] ip_options
end
const IP_BROADCAST = $FFFF
const IP_PROTO_ICMP = $01
const IP_PROTO_UDP = $11
const IP_PROTO_TCP = $06
word bcast = IP_BROADCAST, IP_BROADCAST
//
// ICMP type/codes
//
const IP_PROTO_ICMP = 1
const ICMP_ECHO_REQST = 8
const ICMP_ECHO_REPLY = 0
//
// ICMP message format
//
struc t_icmp
byte icmp_type
byte icmp_code
word icmp_chksm
word[2] icmp_header
end
//
// UDP IPv4 psuedo header
//
struc t_piphdr
byte[IP4ADR_SIZE] pip_src
byte[IP4ADR_SIZE] pip_dst
byte pip_zero
byte pip_proto
word pip_len
end
//
// UDP header
//
struc t_udphdr
word udp_src
word udp_dst
word udp_len
word udp_chksm
end
//
// TCP header
//
struc t_tcphdr
word tcp_src
word tcp_dst
word tcp_len
word tcp_chksm
end
//
// Local network parameters
//
const MAX_WIZ_CHANNELS = 4
//
// Channel protocols
//
const WIZ_PROTO_CLOSED = 0
const WIZ_PROTO_TCP = 1
const WIZ_PROTO_UDP = 2
const WIZ_PROTO_IP = 3
const WIZ_PROTO_RAW = 4
//
// State transistions
//
const TCP_STATE_CLOSED = 0
const TCP_STATE_CLOSING = 1
const TCP_STATE_LISTEN = 2
const TCP_STATE_CONNECT = 3
const TCP_STATE_OPEN = 4
//
// HW channels
//
struc t_channel
byte channel_proto
byte channel_state
word channel_regs
word channel_txmem
word channel_rxmem
word channel_lclport
word channel_remport
byte[4] channel_remip
word channel_recv_func
word channel_recv_parm
end
byte[t_channel * MAX_WIZ_CHANNELS] wizChannel
//
// Service ICMP hook
//
export word hookICMP
//
// Defines for ASM routines
//
asm equates
!SOURCE "vmsrc/plvmzp.inc"
end
//
// Swap bytes in word
//
asm swab
LDA ESTKL,X
LDY ESTKH,X
STA ESTKH,X
STY ESTKL,X
RTS
end
//
// Wiznet I/O functions
//
// POKE WORD TO I/O SPACE
// Note: Big Endian format
//
asm _pokeiow
LDA ESTKH,X
end
asm _pokeiowl
STA $C000
LDA ESTKL,X
end
asm _pokeiowh
STA $C000
RTS
end
//
// POKE BYTE TO I/O SPACE
//
asm _pokeio
LDA ESTKL,X
end
asm _pokeiol
STA $C000
RTS
end
//
// PEEK BYTE FROM I/O SPACE
//
asm _peekio
DEX
end
asm _peekiol
LDA $C000
STA ESTKL,X
LDA #$00
STA ESTKH,X
RTS
end
//
// PEEK WORD FROM I/O SPACE
// Note: Big Endian format
//
asm _peekiow
DEX
end
asm _peekiowl
LDA $C000
STA ESTKH,X
end
asm _peekiowh
LDA $C000
STA ESTKL,X
RTS
end
//
// WRITE DATA INTO I/O SPACE
// pokedata(BUF, LEN)
//
asm pokedata
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
STA SRCH
LDY ESTKL,X
BEQ POKELP
LDY #$00
INC ESTKH,X
POKELP LDA (SRC),Y
end
asm _pokedata
STA $C000
INY
BNE +
INC SRCH
+ DEC ESTKL,X
BNE POKELP
DEC ESTKH,X
BNE POKELP
INX
RTS
end
//
// READ DATA FROM I/O SPACE
// peekdata(BUF, LEN)
//
asm peekdata
LDA ESTKL+1,X
STA DSTL
LDA ESTKH+1,X
STA DSTH
LDY ESTKL,X
BEQ PEEKLP
LDY #$00
INC ESTKH,X
end
asm _peekdata
PEEKLP LDA $C000
STA (DST),Y
INY
BNE +
INC DSTH
+ DEC ESTKL,X
BNE PEEKLP
DEC ESTKH,X
BNE PEEKLP
INX
RTS
end
def pokeiow(io, data)
_pokeiowl.1 = io
_pokeiowh.1 = io+1
return _pokeiow(data)
end
def pokeio(io, data)
_pokeiol.1 = io
return _pokeio(data)
end
def peekio(io)
_peekiol.1 = io
return _peekio()
end
def peekiow(io)
_peekiowl.1 = io
_peekiowh.1 = io+1
return _peekiow()
end
def pokereg(reg, data)
_pokeiow(reg)
return _pokeio(data)
end
def peekreg(reg)
_pokeiow(reg)
return _peekio()
end
def pokeregs(reg, buf, len)
// _pokeiow(reg)
// return pokedata(buf, len)
word i
len = len - 1
for i = 0 to len
_pokeiow(reg + i)
_pokeio(buf->[i])
next
end
def peekregs(reg, buf, len)
// _pokeiow(reg)
// return peekdata(buf, len)
// There is an issue missing data on back-to-back reads
word i
len = len - 1
for i = 0 to len
_pokeiow(reg + i)
buf->[i] = _peekio()
next
end
def pokeregw(reg, dataw)
_pokeiow(reg)
_pokeio(dataw.1)
return _pokeio(dataw.0)
end
def peekregw(reg)
word dataw
_pokeiow(reg)
dataw.1 = _peekio()
_pokeiow(reg + 1)
dataw.0 = _peekio()
return dataw
end
//
// DEBUG
//
def putb(hexb)
return call($FDDA, hexb, 0, 0, 0)
end
def puth(hex)
return call($F941, hex >> 8, hex, 0, 0)
end
def putip(ipptr)
byte i
for i = 0 to 2
puti(ipptr->[i]); putc('.')
next
return puti(ipptr->[i])
end
//
// Send UDP datagram
//
def wizSendUDP(wiz, ipdst, portdst, data, len)
word wizregs, wizdata, txrr, txwr, splitlen
wizregs = wiz=>channel_regs
wizdata = wiz=>channel_txmem
if !ipdst
ipdst = @bcast
fin
//
// Wait for Tx room
//
repeat; until peekregw(wizregs + WIZ_SnFSR) >= len
//
// Calc new write ptr, check for split
//
txwr = peekregw(wizregs + WIZ_SnTXWR)
txrr = txwr & WIZ_TXMASK
if txrr + len > WIZ_TXSIZE
splitlen = WIZ_TXSIZE - txrr
pokeregs(wizdata + txrr, data, splitlen)
pokeregs(wizdata, data + splitlen, len - splitlen)
else
pokeregs(wizdata + txrr, data, len)
fin
//
// Set destination address/port
//
pokeregs(wizregs + WIZ_SnDIPR, ipdst, IP4ADR_SIZE)
pokeregw(wizregs + WIZ_SnDPORT, portdst)
//
// Update write pointer and send
//
pokeregw(wizregs + WIZ_SnTXWR, txwr + len)
pokereg(wizregs + WIZ_SnCR, $20) // SEND
end
//
// Open UDP channel and set datagram received callback
//
def wizOpenUDP(localport, callback, param)
word wiz
byte i
if !localport; return -1; fin // invalid port
//
// Look for an existing notification on localport
//
//putc('O')
wiz = @wizChannel
for i = 1 to MAX_WIZ_CHANNELS
if wiz->channel_proto == IP_PROTO_UDP and wiz=>channel_lclport == localport
break
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
//
// Add notification on localport if room
//
wiz = @wizChannel
for i = 1 to MAX_WIZ_CHANNELS
if !wiz->channel_proto
break
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
return 0
fin
fin
//putc('0' + i);putln
//
// Fill in this channel and open it
//
wiz->channel_proto = WIZ_PROTO_UDP
wiz=>channel_lclport = localport
wiz=>channel_recv_func = callback
wiz=>channel_recv_parm = param
pokeregw(wiz=>channel_regs + WIZ_SnPORT, localport)
pokereg(wiz=>channel_regs + WIZ_SnMR, $02) // UDP protocol
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
return wiz
end
//
// Close UDP port
//
def wizCloseUDP(wiz)
//putc('S')
if isuge(wiz, @wizChannel) and isult(wiz, @wizChannel + MAX_WIZ_CHANNELS * t_channel)
//
// Clear notiications on this port
//
if wiz->channel_proto == WIZ_PROTO_UDP
//putc('1' + ((wiz=>channel_regs - WIZ_SREGS) >> 8));putln
wiz->channel_proto = WIZ_PROTO_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
return 0
fin
fin
//putc('!');putln
//
// Invalid port
//
return -1
end
//
// Open TCP socket in SERVER mode
//
def wizListenTCP(lclport, callback, param)
word wiz
byte i
//
// Look for an existing notification on localport
//
//putc('L')
wiz = @wizChannel
for i = 1 to MAX_WIZ_CHANNELS
if wiz->channel_proto == WIZ_PROTO_TCP and wiz->channel_state == TCP_STATE_LISTEN and wiz=>channel_lclport == lclport
break
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
//
// Add notification on localport if room
//
wiz = @wizChannel
for i = 1 to MAX_WIZ_CHANNELS
if !wiz->channel_proto
break
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
return 0
fin
fin
//putc('0' + i);putln
//
// Fill in this channel and open it
//
wiz->channel_proto = WIZ_PROTO_TCP
wiz->channel_state = TCP_STATE_LISTEN
wiz=>channel_remip:0 = 0
wiz=>channel_remip:2 = 0
wiz=>channel_remport = 0
wiz=>channel_lclport = lclport
wiz=>channel_recv_func = callback
wiz=>channel_recv_parm = param
pokereg(wiz=>channel_regs + WIZ_SnMR, $01) // TCP protocol
pokeregw(wiz=>channel_regs + WIZ_SnPORT, lclport)
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
while peekreg(wiz=>channel_regs + WIZ_SnSR) <> $13; loop // Wait for init
pokereg(wiz=>channel_regs + WIZ_SnCR, $02) // LISTEN
return wiz
end
//
// Open TCP socket in CLIENT mode
//
def wizConnectTCP(remip, remport, lclport, callback, param)
word wiz
byte i
//
// Look for an existing notification on localport
//
wiz = @wizChannel
for i = 1 to MAX_WIZ_CHANNELS
if wiz->channel_proto == WIZ_PROTO_TCP and wiz->channel_state == TCP_STATE_CONNECT and wiz=>channel_lclport == lclport
break
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
//
// Add notification on localport if room
//
wiz = @wizChannel
for i = 1 to MAX_WIZ_CHANNELS
if !wiz->channel_proto
break
fin
wiz = wiz + t_channel
next
if i > MAX_WIZ_CHANNELS
return 0
fin
fin
//
// Fill in this channel and open it
//
wiz->channel_proto = WIZ_PROTO_TCP
wiz->channel_state = TCP_STATE_CONNECT
wiz=>channel_remip:0 = remip=>0
wiz=>channel_remip:2 = remip=>2
wiz=>channel_remport = remport
wiz=>channel_lclport = lclport
wiz=>channel_recv_func = callback
wiz=>channel_recv_parm = param
pokereg(wiz=>channel_regs + WIZ_SnMR, $01) // TCP protocol
pokeregs(wiz=>channel_regs + WIZ_SnDIPR, remip, IP4ADR_SIZE)
pokeregw(wiz=>channel_regs + WIZ_SnDPORT, remport)
pokeregw(wiz=>channel_regs + WIZ_SnPORT, lclport)
pokereg(wiz=>channel_regs + WIZ_SnCR, $01) // OPEN
while peekreg(wiz=>channel_regs + WIZ_SnSR) <> $13; loop // Wait for init
pokereg(wiz=>channel_regs + WIZ_SnCR, $04) // CONNECT
return wiz
end
//
// Write to TCP socket
//
def wizSendTCP(wiz, data, len)
word wizregs, wizdata, txrr, txwr, splitlen
if wiz->channel_state <> TCP_STATE_OPEN; return -1; fin
//putc('W');puti(len);putc(':')
wizregs = wiz=>channel_regs
wizdata = wiz=>channel_txmem
//
// Wait for Tx room
//
repeat; until peekregw(wizregs + WIZ_SnFSR) >= len
//
// Calc new write ptr, check for split
//
txwr = peekregw(wizregs + WIZ_SnTXWR)
txrr = txwr & WIZ_TXMASK
if txrr + len > WIZ_TXSIZE
splitlen = WIZ_TXSIZE - txrr
pokeregs(wizdata + txrr, data, splitlen)
pokeregs(wizdata, data + splitlen, len - splitlen)
//putc('(');puti(splitlen);putc(',');puti(len-splitlen);putc(')')
else
pokeregs(wizdata + txrr, data, len)
fin
//puth(txrr);putc('-');putc('>');puth(txwr+len);putln
//
// Update write pointer and send
//
pokeregw(wizregs + WIZ_SnTXWR, txwr + len)
pokereg(wizregs + WIZ_SnCR, $20) // SEND
end
//
// Close TCP socket
//
def wizCloseTCP(wiz)
if isuge(wiz, @wizChannel) and isult(wiz, @wizChannel + MAX_WIZ_CHANNELS * t_channel)
//
// Clear notiications on this port
//
if wiz->channel_proto == WIZ_PROTO_TCP and (wiz->channel_state == TCP_STATE_OPEN or wiz->channel_state == TCP_STATE_CLOSING)
wiz->channel_state = TCP_STATE_CLOSING
pokereg(wiz=>channel_regs + WIZ_SnCR, $08) // DISCON
repeat
wizServiceIP()
until wiz->channel_state == TCP_STATE_CLOSED
wiz->channel_proto = WIZ_PROTO_CLOSED
return 0
fin
fin
//
// Invalid port
//
return -1
end
//
// Update notify callback
//
def wizSetCallback(wiz, callback)
if wiz->channel_proto == WIZ_PROTO_UDP or wiz->channel_proto == WIZ_PROTO_TCP
//
// Update callback on this port
//
wiz=>channel_recv_func = callback
return 0
fin
//
// Invalid port
//
return -1
end
//
// Update notify param
//
def wizSetParam(wiz, param)
if wiz->channel_proto == WIZ_PROTO_UDP or wiz->channel_proto == WIZ_PROTO_TCP
//
// Update param on this port
//
wiz=>channel_recv_parm = param
return 0
fin
//
// Invalid port
//
return -1
end
//
// Service incoming packets
//
def wizServiceIP
word wiz, wizregs, wizdata, rxlen, rxrr, rxwr, rxpkt, splitlen
byte ir, i, sir
ir = peekreg(WIZ_IR)
if ir and ir <> $FF // Ignore spurious read of IR
//putc('I');putb(ir)
wiz = @wizChannel
for i = 0 to 3
when ir & (1 << i)
is 1
is 2
is 4
is 8
wizregs = wiz=>channel_regs
wizdata = wiz=>channel_rxmem
sir = peekreg(wizregs + WIZ_SnIR)
when wiz->channel_proto
is WIZ_PROTO_TCP
if sir & $01
//putc('C')
//
// Connect TCP socket
//
when wiz->channel_state
is TCP_STATE_LISTEN
peekregs(wiz=>channel_regs + WIZ_SnDIPR, @wiz=>channel_remip, IP4ADR_SIZE)
wiz=>channel_remport = peekregw(wiz=>channel_regs + WIZ_SnDPORT)
is TCP_STATE_CONNECT
wiz->channel_state = TCP_STATE_OPEN
break
otherwise
//putc('?')
wend
fin
if sir & $04
//putc('R')
//
// Receive TCP packet
//
rxlen = peekregw(wizregs + WIZ_SnRSR)
rxrr = peekregw(wizregs + WIZ_SnRXRD)
rxwr = rxrr & WIZ_RXMASK
rxpkt = heapalloc(rxlen)
//puti(rxlen);putc(':')
if rxwr + rxlen > WIZ_RXSIZE
splitlen = WIZ_RXSIZE - rxwr
peekregs(wizdata + rxwr, rxpkt, splitlen)
peekregs(wizdata, rxpkt + splitlen, rxlen - splitlen)
//putc('(');puti(splitlen);putc(',');puti(rxlen-splitlen);putc(')')
else
peekregs(wizdata + rxwr, rxpkt, rxlen)
fin
//puth(rxwr);putc('-');putc('>');puth(rxwr+rxlen);putln
pokeregw(wizregs + WIZ_SnRXRD, rxrr + rxlen)
pokereg(wizregs + WIZ_SnCR, $40) // RECV
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,rxpkt,rxlen,wiz=>channel_recv_parm)
heaprelease(rxpkt)
fin
if sir & $02
//putc('S')
//
// Close TCP socket
//
when wiz->channel_state
is TCP_STATE_OPEN
wiz->channel_state = TCP_STATE_CLOSING
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,0,wiz=>channel_lclport,0,wiz=>channel_recv_parm)
break
is TCP_STATE_CLOSING
wiz->channel_state = TCP_STATE_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
break
otherwise
//putc('?')
wend
fin
if sir & $08
//putc('T')
//
// Timeout on TCP socket
//
when wiz->channel_state
is TCP_STATE_OPEN
wiz->channel_state = TCP_STATE_CLOSING
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,0,0,wiz=>channel_recv_parm)
break
is TCP_STATE_CONNECT
wiz=>channel_recv_func(@wiz=>channel_remip,wiz=>channel_remport,wiz=>channel_lclport,0,0,wiz=>channel_recv_parm)
is TCP_STATE_CLOSING
wiz->channel_state = TCP_STATE_CLOSED
pokereg(wiz=>channel_regs + WIZ_SnCR, $10) // CLOSE
break
otherwise
//putc('?')
wend
fin
//if sir & $10
//putc('W');putc('O');putc('K');puth(peekregw(wiz=>channel_regs+WIZ_SnTXWR));putln
//
// Write TCP socket OK
//
//fin
break
is WIZ_PROTO_UDP
//putc('U');putb(sir)
if sir & $04
//putc('R')
//
// Receive UDP packet
//
rxlen = peekregw(wizregs + WIZ_SnRSR)
rxrr = peekregw(wizregs + WIZ_SnRXRD)
rxwr = rxrr & WIZ_RXMASK
rxpkt = heapalloc(rxlen)
if rxwr + rxlen >= WIZ_RXSIZE
//putc('!')
splitlen = WIZ_RXSIZE - rxwr
peekregs(wizdata + rxwr, rxpkt, splitlen)
peekregs(wizdata, rxpkt + splitlen, rxlen - splitlen)
else
peekregs(wizdata + rxwr, rxpkt, rxlen)
fin
//putc('=');putip(rxpkt);putc(' ');puti(rxlen)
//putc('/');puti(swab(rxpkt=>6))
//putc(' ');puth(rxrr);putc(' ');puth(rxwr);putln
pokeregw(wizregs + WIZ_SnRXRD, rxrr + rxlen)
pokereg(wizregs + WIZ_SnCR, $40) // RECV
wiz=>channel_recv_func(rxpkt,swab(rxpkt=>4),rxpkt+8,rxlen-8,wiz=>channel_recv_parm)
heaprelease(rxpkt)
fin
break
otherwise
wend
pokereg(wiz=>channel_regs + WIZ_SnIR, sir) // Clear SnIR
ir = ir ^ (1 << i)
break
wend
wiz = wiz + t_channel
next
if ir
//
// Clear IR for now
//
pokereg(WIZ_IR, ir)
fin
fin
end
//
// Set the local IP addresses
//
def setWizIP(newIP, newSubnet, newGateway)
if newIP
localip:0 = newIP=>0; localip:2 = newIP=>2
pokeregs(WIZ_SIPR, newIP, IP4ADR_SIZE)
fin
if newSubnet
subnet:0 = newSubnet=>0; subnet:2 = newSubnet=>2
pokeregs(WIZ_SUBR, newSubnet, IP4ADR_SIZE)
fin
if newGateway
gateway:0 = newGateway=>0; gateway:2 = newGateway=>2
pokeregs(WIZ_GWR, newGateway, IP4ADR_SIZE)
fin
end
//
// Get the interface hardware address
//
def getWizHA(ha)
if ha
ha=>0 = wizMAC:0; ha=>2 = wizMAC:2; ha=>4 = wizMAC:4
fin
return MAC_SIZE
end
//
// Identify Wiznet card and initialize
//
for slot = $90 to $F0 step $10
regdata = peekio(slot)
if (regdata & $E4) == $00
pokeio(slot, $03) // Try setting auto-increment indirect I/F
if peekio(slot) == $03
saveidx = peekiow(slot + 1)
peekio(slot + 3) // Dummy read to data register should increment index
if peekiow(slot + 1) == saveidx + 1
//
// Good chance this is it
//
pokeio(slot, $80) // RESET
regidx = slot + 1
regdata = slot + 3
_pokedata.1 = regdata
_peekdata.1 = regdata
pokeio(slot, $03) // Auto-increment indirect I/F + enable ping
//
// The following looks redundant, but it sets up the peek/poke locations
// for peekreg(s)/pokereg(s)
//
pokeiow(regidx, WIZ_MR)
pokeio(regdata, $03) // Auto-increment indirect I/F + enable ping
peekio(regdata)
//
// Initialize common registers
//
pokeregs(WIZ_SHAR, @wizMAC, 6) // MAC addr
pokeregw(WIZ_RTR, 5000) // Timeout period to 500ms
pokereg(WIZ_RMSR, $55) // 2K Rx memory/channel
pokereg(WIZ_TMSR, $55) // 2K Tx memory/channel
//
// Fill channel structure
//
saveidx = @wizChannel
for slot = 0 to 3
saveidx=>channel_regs = WIZ_SREGS + (WIZ_SSIZE * slot)
saveidx=>channel_txmem = WIZ_TXMEM + (WIZ_TXSIZE * slot)
saveidx=>channel_rxmem = WIZ_RXMEM + (WIZ_RXSIZE * slot)
saveidx = saveidx + t_channel
next
//
// Fill in Net class
//
iNet:serviceIP = @wizServiceIP
iNet:openUDP = @wizOpenUDP
iNet:sendUDP = @wizSendUDP
iNet:closeUDP = @wizCloseUDP
iNet:listenTCP = @wizListenTCP
iNet:connectTCP = @wizConnectTCP
iNet:sendTCP = @wizSendTCP
iNet:closeTCP = @wizCloseTCP
iNet:setInterfaceIP = @setWizIP
iNet:getInterfaceHA = @getWizHA
iNet:setCallback = @wizSetCallback
iNet:setParam = @wizSetParam
return modkeep
fin
fin
pokeio(slot, regdata) // Restore register
fin
next
//
// Not found
//
return -1
done

View File

@@ -4,33 +4,16 @@ PLVM = plvm
PLVMZP_APL = vmsrc/apple/plvmzp.inc
PLVM01 = rel/apple/A1PLASMA\#060280
PLVM02 = rel/apple/PLASMA.SYSTEM\#FF2000
PLVMJIT = rel/apple/PLVM.128\#FF2000
PLVM802 = rel/apple/PLVM16\#FF2000
PLVM802 = rel/apple/PLASMA16.SYSTEM\#FF2000
PLVM03 = rel/apple/SOS.INTERP\#050000
PLVMJIT03 = rel/apple/SOS.INTERPJIT\#050000
SOSCMD = rel/apple/SOS.CMD\#FE1000
SOSCMDJIT = rel/apple/SOS.CMDJIT\#FE1000
CMD = rel/apple/CMD\#061000
CMDJIT = rel/apple/CMD128\#061000
PLVMZP_C64 = vmsrc/c64/plvmzp.inc
PLVMC64 = rel/c64/PLASMA
ED = rel/ED\#FE1000
ZIPCHIP = rel/apple/ZIPCHIP\#FE1000
JIT = rel/apple/JIT\#FE1000
JIT16 = rel/apple/JIT16\#FE1000
JITUNE = rel/apple/JITUNE\#FE1000
SOS = rel/apple/SOS\#FE1000
ROD = rel/apple/ROD\#FE1000
COPY = rel/apple/COPY\#FE1000
DEL = rel/apple/DEL\#FE1000
REN = rel/apple/REN\#FE1000
CAT = rel/apple/CAT\#FE1000
NEWDIR = rel/apple/NEWDIR\#FE1000
TYPE = rel/apple/TYPE\#FE1000
ROD = rel/ROD\#FE1000
SIEVE = rel/SIEVE\#FE1000
PRIMEGAP = rel/PRIMEGAP\#FE1000
ARGS = rel/ARGS\#FE1000
MATCHFILES = rel/apple/MATCHFILES\#FE1000
SPIPORT = rel/apple/SPIPORT\#FE1000
SDFAT = rel/apple/SDFAT\#FE1000
FATCAT = rel/apple/FATCAT\#FE1000
@@ -40,8 +23,6 @@ FATWDSK = rel/apple/FATWRITEDSK\#FE1000
FATRDSK = rel/apple/FATREADDSK\#FE1000
FILEIO_APL = rel/apple/FILEIO\#FE1000
CONIO_APL = rel/apple/CONIO\#FE1000
INT32 = rel/INT32\#FE1000
INT32TEST = rel/INT32TEST\#FE1000
SANE = rel/SANE\#FE1000
FPSTR = rel/FPSTR\#FE1000
FPU = rel/FPU\#FE1000
@@ -49,8 +30,6 @@ SNDSEQ = rel/apple/SNDSEQ\#FE1000
PLAYSEQ = rel/apple/PLAYSEQ\#FE1000
SANITY = rel/SANITY\#FE1000
RPNCALC = rel/RPNCALC\#FE1000
LZ4 = rel/LZ4\#FE1000
LZ4CAT = rel/LZ4CAT\#FE1000
MOUSE = rel/apple/MOUSE\#FE1000
UTHERNET2 = rel/apple/UTHERNET2\#FE1000
UTHERNET = rel/apple/UTHERNET\#FE1000
@@ -59,16 +38,8 @@ INET = rel/INET\#FE1000
DHCP = rel/DHCP\#FE1000
HTTPD = rel/HTTPD\#FE1000
TFTPD = rel/TFTPD\#FE1000
HGRLIB = rel/apple/HGRLIB\#FE1000
GRLIB = rel/apple/GRLIB\#FE1000
DGRLIB = rel/apple/DGRLIB\#FE1000
HGRSPRITE = rel/apple/HGRSPRITE\#FE1000
HGRTILE = rel/apple/HGRTILE\#FE1000
HGRFONT = rel/apple/HGRFONT\#FE1000
LINES = rel/LINES\#FE1000
DGR = rel/apple/DGR\#FE1000
GRAFIX = rel/apple/GRAFIX\#FE1000
SFM = rel/apple/SFM\#FE1000
SFMSPRT = rel/apple/SFMSPRT\#FE1000
GFXDEMO = rel/apple/GFXDEMO\#FE1000
JOYBUZZ = rel/apple/JOYBUZZ\#FE1000
PORTIO = rel/apple/PORTIO\#FE1000
@@ -76,10 +47,6 @@ ROGUE = rel/ROGUE\#FE1000
ROGUEMAP = rel/ROGUEMAP\#FE1000
ROGUECOMBAT= rel/ROGUECOMBAT\#FE1000
MON = rel/apple/MON\#FE1000
CONIOTEST = rel/apple/CONIOTEST\#FE1000
TILETEST = rel/apple/TILETEST\#FE1000
HGRTEST = rel/apple/HGRTEST\#FE1000
GRTEST = rel/apple/GRTEST\#FE1000
DGRTEST = rel/apple/DGRTEST\#FE1000
MEMMGR = rel/MEMMGR\#FE1000
MEMTEST = rel/MEMTEST\#FE1000
@@ -92,10 +59,6 @@ TESTLIB = TESTLIB\#FE1000
PLASM = plasm
PLASMAPLASM = rel/PLASM\#FE1000
CODEOPT = rel/CODEOPT\#FE1000
PLFORTH = rel/PLFORTH\#FE1000
HRFORTH = rel/HRFORTH\#FE1000
HR2FORTH = rel/HR2FORTH\#FE1000
TX2FORTH = rel/TX2FORTH\#FE1000
INCS = toolsrc/plasm.h toolsrc/tokens.h toolsrc/symbols.h toolsrc/lex.h toolsrc/parse.h toolsrc/codegen.h
OBJS = toolsrc/plasm.c toolsrc/parse.c toolsrc/lex.c toolsrc/codegen.c
#
@@ -114,18 +77,19 @@ TXTTYPE = .TXT
#SYSTYPE = \#FF2000
#TXTTYPE = \#040000
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM802) $(PLVM03) $(PLVMJIT03) $(CMD) $(CMDJIT) $(JIT) $(JIT16) $(JITUNE) $(SOSCMD) $(SOSCMDJIT) $(PLASMAPLASM) $(CODEOPT) $(PLFORTH) $(HRFORTH) $(HR2FORTH) $(TX2FORTH) $(ZIPCHIP) $(MATCHFILES) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(COPY) $(DEL) $(REN) $(CAT) $(NEWDIR) $(TYPE) $(SOS) $(ROD) $(SIEVE) $(PRIMEGAP) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(SFM) $(SFMSPRT) $(GRAFIX) $(GFXDEMO) $(LINES) $(HGRTILE) $(HGRFONT) $(HGRSPRITE) $(HGRLIB) $(TILETEST) $(HGRTEST) $(GRLIB) $(DGRLIB) $(GRTEST) $(DGRTEST) $(HGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(INT32) $(INT32TEST) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(LZ4) $(LZ4CAT) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ) $(CONIOTEST)
apple: $(PLVMZP_APL) $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVM802) $(PLVM03) $(CMD) $(PLASMAPLASM) $(CODEOPT) $(ARGS) $(MEMMGR) $(MEMTEST) $(FIBER) $(FIBERTEST) $(LONGJMP) $(ED) $(MON) $(SOS) $(ROD) $(SIEVE) $(MOUSE) $(UTHERNET2) $(UTHERNET) $(ETHERIP) $(INET) $(DHCP) $(HTTPD) $(TFTPD) $(ROGUE) $(ROGUEMAP) $(ROGUECOMBAT) $(GRAFIX) $(GFXDEMO) $(DGR) $(DGRTEST) $(FILEIO_APL) $(CONIO_APL) $(JOYBUZZ) $(PORTIO) $(SPIPORT) $(SDFAT) $(FATCAT) $(FATGET) $(FATPUT) $(FATWDSK) $(FATRDSK) $(SANE) $(FPSTR) $(FPU) $(SANITY) $(RPNCALC) $(SNDSEQ) $(PLAYSEQ)
-rm vmsrc/plvmzp.inc
c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64)
c64: $(PLVMZP_C64) $(PLASM) $(PLVM) $(PLVMC64)
-rm vmsrc/plvmzp.inc
all: apple c64
clean:
-rm *FE1000 *FF2000 $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVMJIT) $(PLVM03)
-rm -rf rel
-rm *FE1000 *FF2000 $(PLASM) $(PLVM) $(PLVM01) $(PLVM02) $(PLVM03)
-rm rel/*
-rm rel/apple/*
-rm rel/c64/*
-rm samplesrc/*.o samplesrc/*~ samplesrc/*.a
-rm toolsrc/*.o toolsrc/*~ toolsrc/*.a
-rm toolsrc/apple/*.o toolsrc/apple/*~ toolsrc/apple/*.a
@@ -136,9 +100,7 @@ clean:
-rm libsrc/*.o libsrc/*~ libsrc/*.a
-rm libsrc/apple/*.o libsrc/apple/*~ libsrc/apple/*.a
-rm libsrc/c64/*.o libsrc/c64/*~ libsrc/c64/*.a
-rm utilsrc/*.o utilsrc/*~ utilsrc/*.a
-rm utilsrc/apple/*.o utilsrc/apple/*~ utilsrc/apple/*.a
-rm utilsrc/c64/*.o utilsrc/c64/*~ utilsrc/c64/*.a
-rm libsrc/*.o libsrc/*~ libsrc/*.a
#
# PLASMA compiler: plasm
@@ -147,29 +109,13 @@ $(PLASM): $(OBJS) $(INCS)
cc $(OBJS) -o $(PLASM)
$(PLASMAPLASM): toolsrc/plasm.pla toolsrc/lex.pla toolsrc/parse.pla toolsrc/codegen.pla toolsrc/codeseq.plh
./$(PLASM) -AMOW toolsrc/plasm.pla
./$(PLASM) -AMOW < toolsrc/plasm.pla > toolsrc/plasm.a
acme --setpc 4094 -o $(PLASMAPLASM) toolsrc/plasm.a
$(CODEOPT): toolsrc/codeopt.pla toolsrc/codeseq.plh
./$(PLASM) -AMOW toolsrc/codeopt.pla
./$(PLASM) -AMOW < toolsrc/codeopt.pla > toolsrc/codeopt.a
acme --setpc 4094 -o $(CODEOPT) toolsrc/codeopt.a
$(HRFORTH): toolsrc/hrforth.pla
./$(PLASM) -AMOW toolsrc/hrforth.pla
acme --setpc 4094 -o $(HRFORTH) toolsrc/hrforth.a
$(HR2FORTH): toolsrc/hr2forth.pla
./$(PLASM) -AMOW toolsrc/hr2forth.pla
acme --setpc 4094 -o $(HR2FORTH) toolsrc/hr2forth.a
$(TX2FORTH): toolsrc/tx2forth.pla
./$(PLASM) -AMOW toolsrc/tx2forth.pla
acme --setpc 4094 -o $(TX2FORTH) toolsrc/tx2forth.a
$(PLFORTH): toolsrc/plforth.pla
./$(PLASM) -AMOW toolsrc/plforth.pla
acme --setpc 4094 -o $(PLFORTH) toolsrc/plforth.a
#
# PLASMA VMs
#
@@ -180,13 +126,13 @@ $(PLVMZP_APL): FORCE
-mkdir -p rel
-mkdir -p rel/apple
-rm -f vmsrc/plvmzp.inc
-cp vmsrc/apple/plvmzp.inc vmsrc/plvmzp.inc
-ln -s apple/plvmzp.inc vmsrc/plvmzp.inc
$(PLVMZP_C64): FORCE
-mkdir -p rel
-mkdir -p rel/c64
-rm -f vmsrc/plvmzp.inc
-cp vmsrc/c64/plvmzp.inc vmsrc/plvmzp.inc
-ln -s c64/plvmzp.inc vmsrc/plvmzp.inc
FORCE:
@@ -197,354 +143,222 @@ $(PLVMC64): vmsrc/c64/plvmc64.s vmsrc/c64/cmd.a
acme -f cbm -o $(PLVMC64) -l vmsrc/c64/plvmc64.sym vmsrc/c64/plvmc64.s
vmsrc/apple/a1cmd.a: vmsrc/apple/a1cmd.pla $(PLASM)
./$(PLASM) -AOW vmsrc/apple/a1cmd.pla
./$(PLASM) -AOW < vmsrc/apple/a1cmd.pla > vmsrc/apple/a1cmd.a
$(PLVM01): vmsrc/apple/plvm01.s vmsrc/apple/a1cmd.a
acme -o $(PLVM01) -l vmsrc/apple/plvm01.sym vmsrc/apple/plvm01.s
$(CMD): vmsrc/apple/cmd.pla vmsrc/apple/cmdstub.s $(PLVM02) $(PLASM)
./$(PLASM) -AOW vmsrc/apple/cmd.pla
acme --setpc 8192 -o $(CMD) -l vmsrc/apple/cmd.sym vmsrc/apple/cmdstub.s
$(CMDJIT): vmsrc/apple/cmdjit.pla vmsrc/apple/cmdjitstub.s $(PLVMJIT) $(PLASM)
./$(PLASM) -AOW vmsrc/apple/cmdjit.pla
acme --setpc 8192 -o $(CMDJIT) -l vmsrc/apple/cmdjit.sym vmsrc/apple/cmdjitstub.s
$(SOSCMD): vmsrc/apple/soscmd.pla $(PLVM03) $(PLASM)
./$(PLASM) -AMOW vmsrc/apple/soscmd.pla
acme --setpc 4094 -o $(SOSCMD) vmsrc/apple/soscmd.a
$(SOSCMDJIT): vmsrc/apple/soscmdjit.pla libsrc/jitcore.pla $(PLVMJIT03) $(PLASM)
./$(PLASM) -AMOW vmsrc/apple/soscmdjit.pla
acme --setpc 4094 -o $(SOSCMDJIT) vmsrc/apple/soscmdjit.a
./$(PLASM) -AOW < vmsrc/apple/cmd.pla > vmsrc/apple/cmd.a
acme --setpc 8192 -o $(CMD) vmsrc/apple/cmdstub.s
$(PLVM02): vmsrc/apple/plvm02.s
acme -o $(PLVM02) -l vmsrc/apple/plvm02.sym vmsrc/apple/plvm02.s
$(PLVMJIT): vmsrc/apple/plvmjit02.s
acme -o $(PLVMJIT) -l vmsrc/apple/plvmjit02.sym vmsrc/apple/plvmjit02.s
$(PLVM802): vmsrc/apple/plvm802.s
acme -o $(PLVM802) -l vmsrc/apple/plvm802.sym vmsrc/apple/plvm802.s
vmsrc/apple/sossys.a: vmsrc/apple/sossys.pla $(PLASM)
./$(PLASM) -AOW vmsrc/apple/sossys.pla
vmsrc/apple/soscmd.a: vmsrc/apple/soscmd.pla $(PLASM)
./$(PLASM) -AOW < vmsrc/apple/soscmd.pla > vmsrc/apple/soscmd.a
$(PLVM03): vmsrc/apple/plvm03.s vmsrc/apple/sossys.a
$(PLVM03): vmsrc/apple/plvm03.s vmsrc/apple/soscmd.a
acme -o $(PLVM03) -l vmsrc/apple/plvm03.sym vmsrc/apple/plvm03.s
vmsrc/apple/sossysjit.a: vmsrc/apple/sossysjit.pla $(PLASM)
./$(PLASM) -AOW vmsrc/apple/sossysjit.pla
$(PLVMJIT03): vmsrc/apple/plvmjit03.s vmsrc/apple/sossysjit.a
acme -o $(PLVMJIT03) -l vmsrc/apple/plvmjit03.sym vmsrc/apple/plvmjit03.s
#
# Sample code
#
test: samplesrc/test.pla samplesrc/testlib.pla $(PLVM) $(PLASM)
./$(PLASM) -AMOW samplesrc/test.pla
./$(PLASM) -AMOW < samplesrc/test.pla > samplesrc/test.a
acme --setpc 4094 -o $(TEST) samplesrc/test.a
./$(PLASM) -AMOW samplesrc/testlib.pla
./$(PLASM) -AMOW < samplesrc/testlib.pla > samplesrc/testlib.a
acme --setpc 4094 -o $(TESTLIB) samplesrc/testlib.a
./$(PLVM) TEST
$(ED): toolsrc/ed.pla $(PLVM02) $(PLASM) toolsrc/ed.pla
./$(PLASM) -AMOW toolsrc/ed.pla
./$(PLASM) -AMOW < toolsrc/ed.pla > toolsrc/ed.a
acme --setpc 4094 -o $(ED) toolsrc/ed.a
$(MATCHFILES): libsrc/apple/matchfiles.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/matchfiles.pla
acme --setpc 4094 -o $(MATCHFILES) libsrc/apple/matchfiles.a
$(ARGS): libsrc/args.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/args.pla
./$(PLASM) -AMOW < libsrc/args.pla > libsrc/args.a
acme --setpc 4094 -o $(ARGS) libsrc/args.a
$(MEMMGR): libsrc/memmgr.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/memmgr.pla
./$(PLASM) -AMOW < libsrc/memmgr.pla > libsrc/memmgr.a
acme --setpc 4094 -o $(MEMMGR) libsrc/memmgr.a
$(MEMTEST): samplesrc/memtest.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/memtest.pla
./$(PLASM) -AMOW < samplesrc/memtest.pla > samplesrc/memtest.a
acme --setpc 4094 -o $(MEMTEST) samplesrc/memtest.a
$(FIBER): libsrc/fiber.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/fiber.pla
./$(PLASM) -AMOW < libsrc/fiber.pla > libsrc/fiber.a
acme --setpc 4094 -o $(FIBER) libsrc/fiber.a
$(LINES): libsrc/lines.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/lines.pla
acme --setpc 4094 -o $(LINES) libsrc/lines.a
$(FIBERTEST): samplesrc/fibertest.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/fibertest.pla
./$(PLASM) -AMOW < samplesrc/fibertest.pla > samplesrc/fibertest.a
acme --setpc 4094 -o $(FIBERTEST) samplesrc/fibertest.a
$(LONGJMP): libsrc/longjmp.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/longjmp.pla
./$(PLASM) -AMOW < libsrc/longjmp.pla > libsrc/longjmp.a
acme --setpc 4094 -o $(LONGJMP) libsrc/longjmp.a
$(SFM): samplesrc/sfm.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/sfm.pla
acme --setpc 4094 -o $(SFM) samplesrc/sfm.a
$(SFMSPRT): samplesrc/sfmsprt.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/sfmsprt.pla
acme --setpc 4094 -o $(SFMSPRT) samplesrc/sfmsprt.a
$(ROGUE): samplesrc/rogue.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/rogue.pla
./$(PLASM) -AMOW < samplesrc/rogue.pla > samplesrc/rogue.a
acme --setpc 4094 -o $(ROGUE) samplesrc/rogue.a
$(ROGUECOMBAT): samplesrc/rogue.combat.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/rogue.combat.pla
./$(PLASM) -AMOW < samplesrc/rogue.combat.pla > samplesrc/rogue.combat.a
acme --setpc 4094 -o $(ROGUECOMBAT) samplesrc/rogue.combat.a
$(ROGUEMAP): samplesrc/rogue.map.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/rogue.map.pla
./$(PLASM) -AMOW < samplesrc/rogue.map.pla > samplesrc/rogue.map.a
acme --setpc 4094 -o $(ROGUEMAP) samplesrc/rogue.map.a
hello: samplesrc/hello.pla $(PLVM) $(PLASM)
./$(PLASM) -AMOW samplesrc/hello.pla
./$(PLASM) -AMOW < samplesrc/hello.pla > samplesrc/hello.a
acme --setpc 4094 -o $(HELLO) samplesrc/hello.a
./$(PLVM) HELLO
$(CONIOTEST): samplesrc/coniotest.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/coniotest.pla
acme --setpc 4094 -o $(CONIOTEST) samplesrc/coniotest.a
$(ROD): samplesrc/rod.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/rod.pla
./$(PLASM) -AMO < samplesrc/rod.pla > samplesrc/rod.a
acme --setpc 4094 -o $(ROD) samplesrc/rod.a
$(SIEVE): samplesrc/sieve.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMW samplesrc/sieve.pla
./$(PLASM) -AMW < samplesrc/sieve.pla > samplesrc/sieve.a
acme --setpc 4094 -o $(SIEVE) samplesrc/sieve.a
$(PRIMEGAP): samplesrc/primegap.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMW samplesrc/primegap.pla
acme --setpc 4094 -o $(PRIMEGAP) samplesrc/primegap.a
$(INT32): libsrc/int32.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/int32.pla
acme --setpc 4094 -o $(INT32) libsrc/int32.a
$(INT32TEST): samplesrc/int32test.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/int32test.pla
acme --setpc 4094 -o $(INT32TEST) samplesrc/int32test.a
$(SANE): libsrc/sane.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/sane.pla
./$(PLASM) -AMOW < libsrc/sane.pla > libsrc/sane.a
acme --setpc 4094 -o $(SANE) libsrc/sane.a
$(FPSTR): libsrc/fpstr.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/fpstr.pla
./$(PLASM) -AMOW < libsrc/fpstr.pla > libsrc/fpstr.a
acme --setpc 4094 -o $(FPSTR) libsrc/fpstr.a
$(FPU): libsrc/fpu.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/fpu.pla
./$(PLASM) -AMOW < libsrc/fpu.pla > libsrc/fpu.a
acme --setpc 4094 -o $(FPU) libsrc/fpu.a
$(SANITY): samplesrc/sanity.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/sanity.pla
./$(PLASM) -AMOW < samplesrc/sanity.pla > samplesrc/sanity.a
acme --setpc 4094 -o $(SANITY) samplesrc/sanity.a
$(LZ4): libsrc/lz4.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/lz4.pla
acme --setpc 4094 -o $(LZ4) libsrc/lz4.a
$(LZ4CAT): samplesrc/lz4cat.pla inc/lz4.plh $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/lz4cat.pla
acme --setpc 4094 -o $(LZ4CAT) samplesrc/lz4cat.a
$(RPNCALC): samplesrc/rpncalc.pla libsrc/fpu.pla inc/fpu.plh libsrc/fpstr.pla inc/fpstr.plh inc/conio.plh $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/rpncalc.pla
./$(PLASM) -AMOW < samplesrc/rpncalc.pla > samplesrc/rpncalc.a
acme --setpc 4094 -o $(RPNCALC) samplesrc/rpncalc.a
$(ETHERIP): libsrc/etherip.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/etherip.pla
./$(PLASM) -AMOW < libsrc/etherip.pla > libsrc/etherip.a
acme --setpc 4094 -o $(ETHERIP) libsrc/etherip.a
$(INET): libsrc/inet.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/inet.pla
./$(PLASM) -AMOW < libsrc/inet.pla > libsrc/inet.a
acme --setpc 4094 -o $(INET) libsrc/inet.a
$(DHCP): libsrc/dhcp.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/dhcp.pla
./$(PLASM) -AMOW < libsrc/dhcp.pla > libsrc/dhcp.a
acme --setpc 4094 -o $(DHCP) libsrc/dhcp.a
$(HTTPD): samplesrc/httpd.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/httpd.pla
./$(PLASM) -AMOW < samplesrc/httpd.pla > samplesrc/httpd.a
acme --setpc 4094 -o $(HTTPD) samplesrc/httpd.a
$(TFTPD): utilsrc/tftpd.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW utilsrc/tftpd.pla
acme --setpc 4094 -o $(TFTPD) utilsrc/tftpd.a
$(TFTPD): samplesrc/tftpd.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW < samplesrc/tftpd.pla > samplesrc/tftpd.a
acme --setpc 4094 -o $(TFTPD) samplesrc/tftpd.a
$(MOUSE): libsrc/apple/mouse.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/mouse.pla
./$(PLASM) -AMOW < libsrc/apple/mouse.pla > libsrc/apple/mouse.a
acme --setpc 4094 -o $(MOUSE) libsrc/apple/mouse.a
$(UTHERNET): libsrc/apple/uthernet.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/uthernet.pla
./$(PLASM) -AMOW < libsrc/apple/uthernet.pla > libsrc/apple/uthernet.a
acme --setpc 4094 -o $(UTHERNET) libsrc/apple/uthernet.a
$(UTHERNET2): libsrc/apple/uthernet2.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/uthernet2.pla
./$(PLASM) -AMOW < libsrc/apple/uthernet2.pla > libsrc/apple/uthernet2.a
acme --setpc 4094 -o $(UTHERNET2) libsrc/apple/uthernet2.a
$(FILEIO_APL): libsrc/apple/fileio.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/fileio.pla
./$(PLASM) -AMOW < libsrc/apple/fileio.pla > libsrc/apple/fileio.a
acme --setpc 4094 -o $(FILEIO_APL) libsrc/apple/fileio.a
$(CONIO_APL): libsrc/apple/conio.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/conio.pla
./$(PLASM) -AMOW < libsrc/apple/conio.pla > libsrc/apple/conio.a
acme --setpc 4094 -o $(CONIO_APL) libsrc/apple/conio.a
$(FILEIO_C64): libsrc/c64/fileio.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/c64/fileio.pla
./$(PLASM) -AMOW < libsrc/c64/fileio.pla > libsrc/c64/fileio.a
acme --setpc 4094 -o $(FILEIO_C64) libsrc/c64/fileio.a
$(CONIO_C64): libsrc/c64/conio.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/c64/conio.pla
./$(PLASM) -AMOW < libsrc/c64/conio.pla > libsrc/c64/conio.a
acme --setpc 4094 -o $(CONIO_C64) libsrc/c64/conio.a
$(SNDSEQ): libsrc/apple/sndseq.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/sndseq.pla
./$(PLASM) -AMOW < libsrc/apple/sndseq.pla > libsrc/apple/sndseq.a
acme --setpc 4094 -o $(SNDSEQ) libsrc/apple/sndseq.a
$(PLAYSEQ): samplesrc/playseq.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/playseq.pla
./$(PLASM) -AMOW < samplesrc/playseq.pla > samplesrc/playseq.a
acme --setpc 4094 -o $(PLAYSEQ) samplesrc/playseq.a
$(GRAFIX): libsrc/apple/grafix.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/grafix.pla
./$(PLASM) -AMOW < libsrc/apple/grafix.pla > libsrc/apple/grafix.a
acme --setpc 4094 -o $(GRAFIX) libsrc/apple/grafix.a
$(GFXDEMO): samplesrc/gfxdemo.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/gfxdemo.pla
./$(PLASM) -AMOW < samplesrc/gfxdemo.pla > samplesrc/gfxdemo.a
acme --setpc 4094 -o $(GFXDEMO) samplesrc/gfxdemo.a
$(FATCAT): samplesrc/fatcat.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/fatcat.pla
./$(PLASM) -AMOW < samplesrc/fatcat.pla > samplesrc/fatcat.a
acme --setpc 4094 -o $(FATCAT) samplesrc/fatcat.a
$(FATGET): samplesrc/fatget.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/fatget.pla
./$(PLASM) -AMOW < samplesrc/fatget.pla > samplesrc/fatget.a
acme --setpc 4094 -o $(FATGET) samplesrc/fatget.a
$(FATPUT): samplesrc/fatput.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/fatput.pla
./$(PLASM) -AMOW < samplesrc/fatput.pla > samplesrc/fatput.a
acme --setpc 4094 -o $(FATPUT) samplesrc/fatput.a
$(FATWDSK): samplesrc/fatwritedsk.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/fatwritedsk.pla
./$(PLASM) -AMOW < samplesrc/fatwritedsk.pla > samplesrc/fatwritedsk.a
acme --setpc 4094 -o $(FATWDSK) samplesrc/fatwritedsk.a
$(FATRDSK): samplesrc/fatreaddsk.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW samplesrc/fatreaddsk.pla
./$(PLASM) -AMOW < samplesrc/fatreaddsk.pla > samplesrc/fatreaddsk.a
acme --setpc 4094 -o $(FATRDSK) samplesrc/fatreaddsk.a
$(SDFAT): libsrc/apple/sdfat.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/sdfat.pla
./$(PLASM) -AMOW < libsrc/apple/sdfat.pla > libsrc/apple/sdfat.a
acme --setpc 4094 -o $(SDFAT) libsrc/apple/sdfat.a
$(SPIPORT): libsrc/apple/spiport.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/spiport.pla
./$(PLASM) -AMOW < libsrc/apple/spiport.pla > libsrc/apple/spiport.a
acme --setpc 4094 -o $(SPIPORT) libsrc/apple/spiport.a
$(JOYBUZZ): libsrc/apple/joybuzz.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/joybuzz.pla
./$(PLASM) -AMOW < libsrc/apple/joybuzz.pla > libsrc/apple/joybuzz.a
acme --setpc 4094 -o $(JOYBUZZ) libsrc/apple/joybuzz.a
$(PORTIO): libsrc/apple/portio.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/portio.pla
./$(PLASM) -AMOW < libsrc/apple/portio.pla > libsrc/apple/portio.a
acme --setpc 4094 -o $(PORTIO) libsrc/apple/portio.a
$(HGRLIB): libsrc/apple/hgrlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/hgrlib.pla
acme --setpc 4094 -o $(HGRLIB) libsrc/apple/hgrlib.a
$(DGR): libsrc/apple/dgr.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW < libsrc/apple/dgr.pla > libsrc/apple/dgr.a
acme --setpc 4094 -o $(DGR) libsrc/apple/dgr.a
$(GRLIB): libsrc/apple/grlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/grlib.pla
acme --setpc 4094 -o $(GRLIB) libsrc/apple/grlib.a
$(DGRLIB): libsrc/apple/dgrlib.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/dgrlib.pla
acme --setpc 4094 -o $(DGRLIB) libsrc/apple/dgrlib.a
$(TILETEST): samplesrc/tiletest.pla $(PLASM)
./$(PLASM) -AMOW samplesrc/tiletest.pla
acme --setpc 4094 -o $(TILETEST) samplesrc/tiletest.a
$(HGRTILE): libsrc/apple/hgrtile.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/hgrtile.pla
acme --setpc 4094 -o $(HGRTILE) libsrc/apple/hgrtile.a
$(HGRFONT): libsrc/apple/hgrfont.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/hgrfont.pla
acme --setpc 4094 -o $(HGRFONT) libsrc/apple/hgrfont.a
$(HGRSPRITE): libsrc/apple/hgrsprite.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/hgrsprite.pla
acme --setpc 4094 -o $(HGRSPRITE) libsrc/apple/hgrsprite.a
$(HGRTEST): samplesrc/hgrtest.pla $(HGRLIB) $(PLASM)
./$(PLASM) -AMOW samplesrc/hgrtest.pla
acme --setpc 4094 -o $(HGRTEST) samplesrc/hgrtest.a
$(GRTEST): samplesrc/grtest.pla $(GRLIB) $(PLASM)
./$(PLASM) -AMOW samplesrc/grtest.pla
acme --setpc 4094 -o $(GRTEST) samplesrc/grtest.a
$(DGRTEST): samplesrc/dgrtest.pla $(DGRLIB) $(PLASM)
./$(PLASM) -AMOW samplesrc/dgrtest.pla
$(DGRTEST): samplesrc/dgrtest.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW < samplesrc/dgrtest.pla > samplesrc/dgrtest.a
acme --setpc 4094 -o $(DGRTEST) samplesrc/dgrtest.a
$(MON): utilsrc/apple/mon.pla $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/mon.pla
acme --setpc 4094 -o $(MON) utilsrc/apple/mon.a
$(MON): samplesrc/mon.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMOW < samplesrc/mon.pla > samplesrc/mon.a
acme --setpc 4094 -o $(MON) samplesrc/mon.a
$(COPY): utilsrc/apple/copy.pla $(MATCHFILES) $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/copy.pla
acme --setpc 4094 -o $(COPY) utilsrc/apple/copy.a
$(SOS): libsrc/apple/sos.pla $(PLVM02) $(PLASM)
./$(PLASM) -AMO < libsrc/apple/sos.pla > libsrc/apple/sos.a
acme --setpc 4094 -o $(SOS) libsrc/apple/sos.a
$(DEL): utilsrc/apple/del.pla $(MATCHFILES) $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/del.pla
acme --setpc 4094 -o $(DEL) utilsrc/apple/del.a
$(REN): utilsrc/apple/ren.pla $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/ren.pla
acme --setpc 4094 -o $(REN) utilsrc/apple/ren.a
$(CAT): utilsrc/apple/cat.pla $(MATCHFILES) $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/cat.pla
acme --setpc 4094 -o $(CAT) utilsrc/apple/cat.a
$(NEWDIR): utilsrc/apple/newdir.pla $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/newdir.pla
acme --setpc 4094 -o $(NEWDIR) utilsrc/apple/newdir.a
$(TYPE): utilsrc/apple/type.pla $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/type.pla
acme --setpc 4094 -o $(TYPE) utilsrc/apple/type.a
$(SOS): utilsrc/apple/sos.pla $(PLVM03) $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/sos.pla
acme --setpc 4094 -o $(SOS) utilsrc/apple/sos.a
$(ZIPCHIP): utilsrc/apple/zipchip.pla $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/zipchip.pla
acme --setpc 4094 -o $(ZIPCHIP) utilsrc/apple/zipchip.a
$(JIT): libsrc/apple/jit.pla libsrc/jitcore.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/jit.pla
acme --setpc 4094 -o $(JIT) libsrc/apple/jit.a
$(JIT16): libsrc/apple/jit16.pla libsrc/jit16core.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMOW libsrc/apple/jit16.pla
acme --setpc 4094 -o $(JIT16) libsrc/apple/jit16.a
$(JITUNE): utilsrc/apple/jitune.pla $(PLVMJIT) $(PLASM)
./$(PLASM) -AMOW utilsrc/apple/jitune.pla
acme --setpc 4094 -o $(JITUNE) utilsrc/apple/jitune.a

View File

@@ -1,9 +0,0 @@
#!/bin/bash
./mkrel
./mkinst
./mksys
./mkfpsos
./mkbld
./mkinet
./mkdemos

View File

@@ -1,49 +0,0 @@
cp ../sysfiles/BLANK140.po PLFORTH.PO
./ac.jar -n PLFORTH.PO PLFORTH
cat ../sysfiles/PRODOS#FF0000 | ./ac.jar -p PLFORTH.PO PRODOS SYS
cat rel/apple/CMD#061000 | ./ac.jar -p PLFORTH.PO CMD BIN $1000
cat rel/apple/PLASMA.SYSTEM#FF2000 | ./ac.jar -p PLFORTH.PO PLASMA.SYSTEM SYS
cat rel/apple/FILEIO#FE1000 | ./ac.jar -p PLFORTH.PO sys/FILEIO REL
cat rel/apple/CONIO#FE1000 | ./ac.jar -p PLFORTH.PO sys/CONIO REL
cat rel/ARGS#FE1000 | ./ac.jar -p PLFORTH.PO sys/ARGS REL
cat rel/LONGJMP#FE1000 | ./ac.jar -p PLFORTH.PO sys/LONGJMP REL
cat rel/HRFORTH#FE1000 | ./ac.jar -p PLFORTH.PO sys/HRFORTH REL
cat rel/HR2FORTH#FE1000 | ./ac.jar -p PLFORTH.PO sys/HR2FORTH REL
cat rel/TX2FORTH#FE1000 | ./ac.jar -p PLFORTH.PO sys/TX2FORTH REL
cat rel/PLFORTH#FE1000 | ./ac.jar -p PLFORTH.PO sys/PLFORTH REL
cat rel/apple/COPY#FE1000 | ./ac.jar -p PLFORTH.PO sys/COPY REL
cat rel/apple/DEL#FE1000 | ./ac.jar -p PLFORTH.PO sys/DEL REL
cat rel/apple/REN#FE1000 | ./ac.jar -p PLFORTH.PO sys/REN REL
cat rel/apple/CAT#FE1000 | ./ac.jar -p PLFORTH.PO sys/CAT REL
#cat rel/apple/TYPE#FE1000 | ./ac.jar -p PLFORTH.PO sys/TYPE REL
#cat rel/apple/NEWDIR#FE1000 | ./ac.jar -p PLFORTH.PO sys/NEWDIR REL
cat rel/apple/MATCHFILES#FE1000 | ./ac.jar -p PLFORTH.PO sys/MATCHFILES REL
cat rel/INT32#FE1000 | ./ac.jar -p PLFORTH.PO sys/INT32 REL
#cat rel/FPSTR#FE1000 | ./ac.jar -p PLFORTH.PO sys/FPSTR REL
#cat rel/FPU#FE1000 | ./ac.jar -p PLFORTH.PO sys/FPU REL
#cat rel/SANE#FE1000 | ./ac.jar -p PLFORTH.PO sys/SANE REL
#cat ../sysfiles/FP6502.CODE#060000 | ./ac.jar -p PLFORTH.PO sys/FP6502.CODE BIN
#cat ../sysfiles/ELEMS.CODE#060000 | ./ac.jar -p PLFORTH.PO sys/ELEMS.CODE BIN
cat rel/ED#FE1000 | ./ac.jar -p PLFORTH.PO sys/ED REL
cat rel/LINES#FE1000 | ./ac.jar -p PLFORTH.PO sys/LINES REL
cat rel/apple/HGRFONT#FE1000 | ./ac.jar -p PLFORTH.PO sys/HGRFONT REL
cat rel/apple/HGRTILE#FE1000 | ./ac.jar -p PLFORTH.PO sys/HGRTILE REL
cat rel/apple/HGRSPRITE#FE1000 | ./ac.jar -p PLFORTH.PO sys/HGRSPRITE REL
cat rel/apple/HGRLIB#FE1000 | ./ac.jar -p PLFORTH.PO sys/HGRLIB REL
cat rel/apple/GRLIB#FE1000 | ./ac.jar -p PLFORTH.PO sys/GRLIB REL
cat rel/apple/DGRLIB#FE1000 | ./ac.jar -p PLFORTH.PO sys/DGRLIB REL
cat scripts/plasma.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/PLASMA.4TH TXT
cat scripts/machid.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/MACHID.4TH TXT
cat scripts/conio.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/CONIO.4TH TXT
cat scripts/fileio.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/FILEIO.4TH TXT
cat scripts/grlib.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/GRLIB.4TH TXT
cat scripts/dgrlib.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/DGRLIB.4TH TXT
cat scripts/hgrlib.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/HGRLIB.4TH TXT
cat scripts/int32.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/INT32.4TH TXT
#cat scripts/fpu.4th | ./ac.jar -ptx PLFORTH.PO sys/scripts/FPU.4TH TXT
cat scripts/rod.4th | ./ac.jar -ptx PLFORTH.PO scripts/ROD.4TH TXT
cat scripts/bounce.4th | ./ac.jar -ptx PLFORTH.PO scripts/BOUNCE.4TH TXT
cat scripts/dbounce.4th | ./ac.jar -ptx PLFORTH.PO scripts/DBOUNCE.4TH TXT
cat scripts/hrbounce.4th | ./ac.jar -ptx PLFORTH.PO scripts/HRBOUNCE.4TH TXT
#cat scripts/hrplot.4th | ./ac.jar -ptx PLFORTH.PO scripts/HRPLOT.4TH TXT
echo "+PLFORTH PLASMA.4TH" | ./ac.jar -ptx PLFORTH.PO AUTORUN TXT

299
src/mk800
View File

@@ -1,299 +0,0 @@
#!/bin/bash
./mkrel
cp ../sysfiles/BLANK800.po PLASMA-2.1.po
./ac.jar -n PLASMA-2.1.po PLASMA2
cat ../sysfiles/PRODOS#FF0000 | ./ac.jar -p PLASMA-2.1.po PRODOS SYS
cat rel/apple/CMD#061000 | ./ac.jar -p PLASMA-2.1.po CMD BIN $1000
cat rel/apple/CMD128#061000 | ./ac.jar -p PLASMA-2.1.po CMD128 BIN $1000
cat rel/apple/PLASMA.SYSTEM#FF2000 | ./ac.jar -p PLASMA-2.1.po PLASMA.SYSTEM SYS
cat rel/apple/PLVM.128#FF2000 | ./ac.jar -p PLASMA-2.1.po PLVM.128 SYS
cat rel/apple/PLVM16#FF2000 | ./ac.jar -p PLASMA-2.1.po PLVM16 SYS
cat ../doc/Editor.md | ./ac.jar -ptx PLASMA-2.1.po EDITOR.README TXT
#mkdir sys
cat rel/apple/FILEIO#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/FILEIO REL
cat rel/apple/CONIO#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/CONIO REL
cat rel/LINES#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/LINES REL
cat rel/apple/HGRFONT#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/HGRFONT REL
cat rel/apple/HGRTILE#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/HGRTILE REL
cat rel/apple/HGRSPRITE#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/HGRSPRITE REL
cat rel/apple/HGRLIB#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/HGRLIB REL
cat rel/apple/GRLIB#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/GRLIB REL
cat rel/apple/DGRLIB#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/DGRLIB REL
cat rel/apple/COPY#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/COPY REL
cat rel/apple/DEL#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/DEL REL
cat rel/apple/REN#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/REN REL
cat rel/apple/CAT#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/CAT REL
cat rel/apple/NEWDIR#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/NEWDIR REL
cat rel/apple/TYPE#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/TYPE REL
cat rel/apple/MATCHFILES#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/MATCHFILES REL
cat rel/ARGS#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/ARGS REL
cat rel/ED#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/ED REL
cat rel/FIBER#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/FIBER REL
cat rel/LONGJMP#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/LONGJMP REL
cat rel/MEMMGR#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/MEMMGR REL
cat rel/INET#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/INET REL
cat rel/DHCP#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/DHCP REL
cat rel/ETHERIP#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/ETHERIP REL
cat rel/apple/MOUSE#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/MOUSE REL
cat rel/apple/UTHERNET2#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/UTHERNET2 REL
cat rel/apple/UTHERNET#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/UTHERNET REL
cat rel/apple/PORTIO#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/PORTIO REL
cat rel/apple/JOYBUZZ#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/JOYBUZZ REL
cat rel/apple/SNDSEQ#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/SNDSEQ REL
cat rel/apple/JIT#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/JIT REL
cat rel/apple/JIT16#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/JIT16 REL
cat rel/apple/JITUNE#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/JITUNE REL
cat rel/apple/ZIPCHIP#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/ZIPCHIP REL
cat rel/LZ4#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/LZ4 REL
cat rel/TFTPD#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/TFTPD REL
cat rel/INT32#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/INT32 REL
cat rel/FPSTR#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/FPSTR REL
cat rel/FPU#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/FPU REL
cat rel/SANE#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/SANE REL
cat ../sysfiles/FP6502.CODE#060000 | ./ac.jar -p PLASMA-2.1.po sys/FP6502.CODE BIN
cat ../sysfiles/ELEMS.CODE#060000 | ./ac.jar -p PLASMA-2.1.po sys/ELEMS.CODE BIN
cat rel/apple/SOS#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/SOS REL
cat rel/apple/GRAFIX#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/GRAFIX REL
cat rel/HRFORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/HRFORTH REL
cat rel/HR2FORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/HR2FORTH REL
cat rel/TX2FORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/TX2FORTH REL
cat rel/PLFORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sys/PLFORTH REL
#mkdir sys/scripts
cat scripts/hdinstall.4th | ./ac.jar -ptx PLASMA-2.1.po HDINSTALL.4TH TXT
cat scripts/plasma.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/PLASMA.4TH TXT
cat scripts/machid.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/MACHID.4TH TXT
cat scripts/conio.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/CONIO.4TH TXT
cat scripts/fileio.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/FILEIO.4TH TXT
cat scripts/grlib.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/GRLIB.4TH TXT
cat scripts/dgrlib.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/DGRLIB.4TH TXT
cat scripts/hgrlib.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/HGRLIB.4TH TXT
cat scripts/int32.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/INT32.4TH TXT
cat scripts/fpu.4th | ./ac.jar -ptx PLASMA-2.1.po sys/scripts/FPU.4TH TXT
#rm -rf syspro
#mkdir syspro
#cat ../sysfiles/PRODOS#FF0000 | ./ac.jar -p PLASMA-2.1.po syspro/PRODOS SYS
#cat rel/apple/CMD#061000 | ./ac.jar -p PLASMA-2.1.po syspro/CMD BIN
#cat rel/apple/CMD128#061000 | ./ac.jar -p PLASMA-2.1.po syspro/CMD128 BIN
#cat rel/apple/PLASMA.SYSTEM#FF2000 | ./ac.jar -p PLASMA-2.1.po syspro/PLASMA.SYSTEM SYS
#cat rel/apple/PLVM.128#FF2000 | ./ac.jar -p PLASMA-2.1.po syspro/PLVM.128 SYS
#cat rel/apple/PLVM16#FF2000 | ./ac.jar -p PLASMA-2.1.po syspro/PLVM16 SYS
#cat ../doc/Editor.md | ./ac.jar -ptx PLASMA-2.1.po syspro/EDITOR.README TXT
#mkdir syspro/sys
#cat rel/apple/FILEIO#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/FILEIO REL
#cat rel/apple/CONIO#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/CONIO REL
#cat rel/LINES#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/LINES REL
#cat rel/apple/HGRFONT#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/HGRFONT REL
#cat rel/apple/HGRTILE#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/HGRTILE REL
#cat rel/apple/HGRSPRITE#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/HGRSPRITE REL
#cat rel/apple/HGRLIB#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/HGRLIB REL
#cat rel/apple/GRLIB#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/GRLIB REL
#cat rel/apple/DGRLIB#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/DGRLIB REL
#cat rel/apple/COPY#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/COPY REL
#cat rel/apple/DEL#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/DEL REL
#cat rel/apple/REN#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/REN REL
#cat rel/apple/CAT#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/CAT REL
#cat rel/apple/NEWDIR#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/NEWDIR REL
#cat rel/apple/TYPE#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/TYPE REL
#cat rel/apple/MATCHFILES#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/MATCHFILES REL
#cat rel/ARGS#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/ARGS REL
#cat rel/ED#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/ED REL
#cat rel/FIBER#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/FIBER REL
#cat rel/LONGJMP#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/LONGJMP REL
#cat rel/MEMMGR#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/MEMMGR REL
#cat rel/apple/MOUSE#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/MOUSE REL
#cat rel/apple/PORTIO#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/PORTIO REL
#cat rel/apple/JOYBUZZ#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/JOYBUZZ REL
#cat rel/apple/SNDSEQ#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/SNDSEQ REL
#cat rel/apple/JIT#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/JIT REL
#cat rel/apple/JIT16#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/JIT16 REL
#cat rel/apple/JITUNE#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/JITUNE REL
#cat rel/apple/ZIPCHIP#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/ZIPCHIP REL
#cat rel/LZ4#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/LZ4 REL
#cat rel/INT32#FE1000 | ./ac.jar -p PLASMA-2.1.po syspro/sys/INT32 REL
#rm -rf sysforth
#mkdir sysforth
#mkdir sysforth/sys
#cat rel/HRFORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sysforth/sys/HRFORTH REL
#cat rel/HR2FORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sysforth/sys/HR2FORTH REL
#cat rel/PLFORTH#FE1000 | ./ac.jar -p PLASMA-2.1.po sysforth/sys/PLFORTH REL
#mkdir sysforth/sys/scripts
#cat scripts/plasma.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/PLASMA.4TH TXT
#cat scripts/conio.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/CONIO.4TH TXT
#cat scripts/fileio.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/FILEIO.4TH TXT
#cat scripts/grlib.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/GRLIB.4TH TXT
#cat scripts/hgrlib.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/HGRLIB.4TH TXT
#cat scripts/int32.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/INT32.4TH TXT
#cat scripts/fpu.4th | ./ac.jar -ptx PLASMA-2.1.po sysforth/sys/scripts/FPU.4TH TXT
#rm -rf sysinet
#mkdir sysinet
#mkdir sysinet/sys
#cat rel/INET#FE1000 | ./ac.jar -p PLASMA-2.1.po sysinet/sys/INET REL
#cat rel/DHCP#FE1000 | ./ac.jar -p PLASMA-2.1.po sysinet/sys/DHCP REL
#cat rel/ETHERIP#FE1000 | ./ac.jar -p PLASMA-2.1.po sysinet/sys/ETHERIP REL
#cat rel/apple/UTHERNET2#FE1000 | ./ac.jar -p PLASMA-2.1.po sysinet/sys/UTHERNET2 REL
#cat rel/apple/UTHERNET#FE1000 | ./ac.jar -p PLASMA-2.1.po sysinet/sys/UTHERNET REL
#cat rel/TFTPD#FE1000 | ./ac.jar -p PLASMA-2.1.po sysinet/sys/TFTPD REL
#rm -rf fpsos
#mkdir fpsos
#cat ../sysfiles/SOS.KERNEL#0C0000 | ./ac.jar -p PLASMA-2.1.po fpsos/SOS.KERNEL \$0C
#cat ../sysfiles/SOS.DRIVER#0C0000 | ./ac.jar -p PLASMA-2.1.po fpsos/SOS.DRIVER \$0C
#cat rel/apple/SOS.INTERP#050000 | ./ac.jar -p PLASMA-2.1.po fpsos/SOS.INTERP \$05
#cat rel/apple/SOS.CMD#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/SOS.CMD REL
#cat rel/apple/SOS.INTERPJIT#050000 | ./ac.jar -p PLASMA-2.1.po fpsos/SOS.INTERPJIT \$05
#cat rel/apple/SOS.CMDJIT#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/SOS.CMDJIT REL
#mkdir fpsos/sys
#cat rel/apple/SOS#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/SOS REL
#cat rel/apple/GRAFIX#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/GRAFIX REL
#cat rel/FPSTR#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/FPSTR REL
#cat rel/FPU#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/FPU REL
#cat rel/SANE#FE1000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/SANE REL
#cat ../sysfiles/FP6502.CODE#060000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/FP6502.CODE BIN
#cat ../sysfiles/ELEMS.CODE#060000 | ./ac.jar -p PLASMA-2.1.po fpsos/sys/ELEMS.CODE BIN
#rm -rf demos
#mkdir demos
cat rel/INT32TEST#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/INT32TEST REL
cat rel/apple/CONIOTEST#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/CONIOTEST REL
cat rel/apple/ROD#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/ROD REL
cat rel/RPNCALC#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/RPNCALC REL
cat rel/LZ4CAT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/LZ4CAT REL
cat ../doc/ROGUE.LZ4.BIN | ./ac.jar -p PLASMA-2.1.po demos/ROGUE.LZ4 BIN
cat rel/PRIMEGAP#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/PRIMEGAP REL
#mkdir demos/rogue
cat rel/ROGUE#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/rogue/ROGUE REL
cat rel/ROGUECOMBAT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/rogue/ROGUECOMBAT REL
cat rel/ROGUEMAP#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/rogue/ROGUEMAP REL
cat samplesrc/LEVEL0#040000 | ./ac.jar -ptx PLASMA-2.1.po demos/rogue/LEVEL0 TXT
cat samplesrc/LEVEL1#040000 | ./ac.jar -ptx PLASMA-2.1.po demos/rogue/LEVEL1 TXT
#mkdir demos/music
cat rel/apple/PLAYSEQ#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/music/PLAYSEQ REL
cat mockingboard/ultima3.seq | ./ac.jar -p PLASMA-2.1.po demos/music/ULTIMA3.SEQ BIN
cat mockingboard/startrek.seq | ./ac.jar -p PLASMA-2.1.po demos/music/STARTREK.SEQ BIN
#mkdir demos/net
cat rel/HTTPD#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/net/HTTPD REL
cat samplesrc/index.html | ./ac.jar -ptx PLASMA-2.1.po demos/net/INDEX.HTML TXT
#mkdir demos/apple2
cat rel/apple/TILETEST#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/TILETEST REL
cat rel/apple/HGRTEST#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/HGRTEST REL
cat rel/apple/GRTEST#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/GRTEST REL
cat rel/apple/DGRTEST#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/DGRTEST REL
#mkdir demos/apple2/spiders
cat rel/apple/SFM#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/spiders/SFM REL
cat rel/apple/SFMSPRT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/spiders/SFMSPRT REL
#mkdir demos/apple2/sdutils
cat rel/apple/SPIPORT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/SPIPORT REL
cat rel/apple/SDFAT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/SDFAT REL
cat rel/apple/FATCAT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/FATCAT REL
cat rel/apple/FATGET#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/FATGET REL
cat rel/apple/FATPUT#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/FATPUT REL
cat rel/apple/FATREADDSK#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/FATREADDSK REL
cat rel/apple/FATWRITEDSK#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple2/sdutils/FATWRITEDSK REL
#mkdir demos/apple3
cat rel/apple/GFXDEMO#FE1000 | ./ac.jar -p PLASMA-2.1.po demos/apple3/GFXDEMO REL
cat samplesrc/APPLE3.PIX#060000 | ./ac.jar -p PLASMA-2.1.po demos/apple3/APPLE3.PIX BIN
#rm -rf bld
#mkdir bld
cat rel/PLASM#FE1000 | ./ac.jar -p PLASMA-2.1.po bld/PLASM REL
cat rel/CODEOPT#FE1000 | ./ac.jar -p PLASMA-2.1.po bld/CODEOPT REL
#mkdir bld/samples
cat samplesrc/hello.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/HELLO.PLA TXT
cat samplesrc/int32test.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/INT32TEST.PLA TXT
cat samplesrc/coniotest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/CONIOTEST.PLA TXT
cat samplesrc/grtest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/GRTEST.PLA TXT
cat samplesrc/dgrtest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/DGRTEST.PLA TXT
cat samplesrc/hgrtest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/HGRTEST.PLA TXT
cat samplesrc/tiletest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/TILETEST.PLA TXT
cat samplesrc/fibertest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/FIBERTEST.PLA TXT
cat samplesrc/mousetest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/MOUSETEST.PLA TXT
cat samplesrc/memtest.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/MEMTEST.PLA TXT
cat samplesrc/rod.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/ROD.PLA TXT
cat samplesrc/sieve.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/SIEVE.PLA TXT
cat samplesrc/test.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/TEST.PLA TXT
cat samplesrc/testlib.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/TESTLIB.PLA TXT
cat samplesrc/playseq.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/PLAYSEQ.PLA TXT
cat samplesrc/rpncalc.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/RPNCALC.PLA TXT
cat samplesrc/fatcat.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/FATCAT.PLA TXT
#cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/GFXDEMO.PLA TXT
cat samplesrc/lz4cat.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/LZ4CAT.PLA TXT
cat samplesrc/sfm.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/SFM.PLA TXT
cat samplesrc/sfmsprt.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/SFMSPRT.PLA TXT
cat samplesrc/fppow.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/FPPOW.PLA TXT
cat utilsrc/apple/mon.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/MON.PLA TXT
cat utilsrc/apple/zipchip.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/ZIPCHIP.PLA TXT
#mkdir bld/scripts
cat scripts/rod.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/ROD.4TH TXT
cat scripts/bounce.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/BOUNCE.4TH TXT
cat scripts/dbounce.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/DBOUNCE.4TH TXT
cat scripts/hrbounce.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/HRBOUNCE.4TH TXT
cat scripts/plot.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/PLOT.4TH TXT
cat scripts/hrplot.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/HRPLOT.4TH TXT
#mkdir bld/examples
#cat samplesrc/examples/ex.1.pla bld/examples/EX.1.PLA TXT
#cat samplesrc/examples/ex.2.pla bld/examples/EX.2.PLA TXT
#cat samplesrc/examples/ex.3.pla bld/examples/EX.3.PLA TXT
#cat samplesrc/examples/ex.4.pla bld/examples/EX.4.PLA TXT
#cat samplesrc/examples/ex.5.pla bld/examples/EX.5.PLA TXT
#cat samplesrc/examples/ex.6.pla bld/examples/EX.6.PLA TXT
#cat samplesrc/examples/ex.7.pla bld/examples/EX.7.PLA TXT
#cat samplesrc/examples/ex.8.pla bld/examples/EX.8.PLA TXT
#cat samplesrc/examples/ex.9.pla bld/examples/EX.9.PLA TXT
#cat samplesrc/examples/ex.10.pla bld/examples/EX.10.PLA TXT
#cat samplesrc/examples/ex.11.pla bld/examples/EX.11.PLA TXT
#cat samplesrc/examples/ex.12.pla bld/examples/EX.12.PLA TXT
#cat samplesrc/examples/ex.13.pla bld/examples/EX.13.PLA TXT
#cat samplesrc/examples/ex.14.pla bld/examples/EX.14.PLA TXT
#cat samplesrc/examples/ex.15.pla bld/examples/EX.15.PLA TXT
#cat samplesrc/examples/ex.16.pla bld/examples/EX.16.PLA TXT
#cat samplesrc/examples/ex.17.pla bld/examples/EX.17.PLA TXT
#mkdir bld/inc
cat inc/args.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/ARGS.PLH TXT
cat inc/matchfiles.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/MATCHFILES.PLH TXT
cat inc/cmdsys.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/CMDSYS.PLH TXT
cat inc/conio.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/CONIO.PLH TXT
cat inc/lines.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/LINES.PLH TXT
cat inc/hgrfont.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/HGRFONT.PLH TXT
cat inc/hgrtile.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/HGRTILE.PLH TXT
cat inc/hgrsprite.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/HGRSPRITE.PLH TXT
cat inc/hgrlib.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/HGRLIB.PLH TXT
cat inc/grlib.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/GRLIB.PLH TXT
cat inc/dgrlib.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/DGRLIB.PLH TXT
cat inc/fiber.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/FIBER.PLH TXT
cat inc/fileio.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/FILEIO.PLH TXT
cat inc/int32.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/INT32.PLH TXT
cat inc/fpstr.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/FPSTR.PLH TXT
cat inc/fpu.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/FPU.PLH TXT
cat inc/mouse.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/MOUSE.PLH TXT
cat inc/inet.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/INET.PLH TXT
cat inc/longjmp.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/LONGJMP.PLH TXT
cat inc/memmgr.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/MEMMGR.PLH TXT
cat inc/sane.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/SANE.PLH TXT
cat inc/joybuzz.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/JOYBUZZ.PLH TXT
cat inc/portio.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/PORTIO.PLH TXT
cat inc/sdfat.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/SDFAT.PLH TXT
cat inc/sndseq.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/SNDSEQ.PLH TXT
cat inc/spiport.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/SPIPORT.PLH TXT
cat inc/testlib.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/TESTLIB.PLH TXT
cat inc/grafix.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/GRAFIX.PLH TXT
cat inc/lz4.plh | ./ac.jar -ptx PLASMA-2.1.po bld/inc/LZ4.PLH TXT
cat vmsrc/apple/plvmzp.inc | ./ac.jar -ptx PLASMA-2.1.po bld/inc/PLVMZP.INC TXT

View File

@@ -1,66 +0,0 @@
cp ../sysfiles/BLANK140.po PLASMA-2.1-BLD.po
./ac.jar -n PLASMA-2.1-BLD.po PLASMA.BLD
cat rel/PLASM#FE1000 | ./ac.jar -p PLASMA-2.1-BLD.po bld/PLASM REL
cat rel/CODEOPT#FE1000 | ./ac.jar -p PLASMA-2.1-BLD.po bld/CODEOPT REL
cat inc/args.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/ARGS.PLH TXT
cat inc/matchfiles.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/MATCHFILES.PLH TXT
cat inc/cmdsys.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/CMDSYS.PLH TXT
cat inc/conio.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/CONIO.PLH TXT
cat inc/lines.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/LINES.PLH TXT
cat inc/hgrfont.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/HGRFONT.PLH TXT
cat inc/hgrtile.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/HGRTILE.PLH TXT
cat inc/hgrsprite.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/HGRSPRITE.PLH TXT
cat inc/hgrlib.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/HGRLIB.PLH TXT
cat inc/grlib.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/GRLIB.PLH TXT
cat inc/dgrlib.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/DGRLIB.PLH TXT
cat inc/fiber.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/FIBER.PLH TXT
cat inc/fileio.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/FILEIO.PLH TXT
cat inc/int32.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/INT32.PLH TXT
cat inc/fpstr.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/FPSTR.PLH TXT
cat inc/fpu.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/FPU.PLH TXT
cat inc/mouse.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/MOUSE.PLH TXT
cat inc/inet.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/INET.PLH TXT
cat inc/longjmp.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/LONGJMP.PLH TXT
cat inc/memmgr.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/MEMMGR.PLH TXT
cat inc/sane.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/SANE.PLH TXT
cat inc/joybuzz.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/JOYBUZZ.PLH TXT
cat inc/portio.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/PORTIO.PLH TXT
cat inc/sdfat.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/SDFAT.PLH TXT
cat inc/sndseq.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/SNDSEQ.PLH TXT
cat inc/spiport.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/SPIPORT.PLH TXT
cat inc/testlib.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/TESTLIB.PLH TXT
#cat inc/grafix.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/GRAFIX.PLH TXT
cat inc/lz4.plh | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/LZ4.PLH TXT
cat vmsrc/apple/plvmzp.inc | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/inc/PLVMZP.INC TXT
cat samplesrc/hello.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/HELLO.PLA TXT
cat samplesrc/int32test.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/INT32TEST.PLA TXT
cat samplesrc/coniotest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/CONIOTEST.PLA TXT
cat samplesrc/grtest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/GRTEST.PLA TXT
cat samplesrc/dgrtest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/DGRTEST.PLA TXT
cat samplesrc/hgrtest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/HGRTEST.PLA TXT
cat samplesrc/tiletest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/TILETEST.PLA TXT
cat samplesrc/fibertest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/FIBERTEST.PLA TXT
cat samplesrc/mousetest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/MOUSETEST.PLA TXT
cat samplesrc/memtest.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/MEMTEST.PLA TXT
cat samplesrc/rod.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/ROD.PLA TXT
#cat samplesrc/sieve.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/SIEVE.PLA TXT
#cat samplesrc/test.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/TEST.PLA TXT
#cat samplesrc/testlib.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/TESTLIB.PLA TXT
cat samplesrc/playseq.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/PLAYSEQ.PLA TXT
cat samplesrc/rpncalc.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/RPNCALC.PLA TXT
#cat samplesrc/fatcat.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/FATCAT.PLA TXT
#cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/GFXDEMO.PLA TXT
cat samplesrc/lz4cat.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/LZ4CAT.PLA TXT
cat samplesrc/sfm.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/SFM.PLA TXT
cat samplesrc/sfmsprt.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/SFMSPRT.PLA TXT
#cat samplesrc/fppow.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/FPPOW.PLA TXT
cat utilsrc/apple/mon.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/MON.PLA TXT
#cat utilsrc/apple/zipchip.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/ZIPCHIP.PLA TXT
cat scripts/rod.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/ROD.4TH TXT
cat scripts/bounce.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/BOUNCE.4TH TXT
cat scripts/dbounce.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/DBOUNCE.4TH TXT
cat scripts/hrbounce.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/HRBOUNCE.4TH TXT
cat scripts/plot.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/PLOT.4TH TXT
cat scripts/hrplot.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/HRPLOT.4TH TXT

View File

@@ -1,32 +0,0 @@
cp ../sysfiles/BLANK140.po PLASMA-2.1-DEMOS.po
./ac.jar -n PLASMA-2.1-DEMOS.po PLASMA.DEMOS
cat rel/INT32TEST#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/INT32TEST REL
cat rel/apple/CONIOTEST#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/CONIOTEST REL
cat rel/apple/ROD#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/ROD REL
cat rel/RPNCALC#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/RPNCALC REL
cat rel/LZ4CAT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/LZ4CAT REL
cat ../doc/ROGUE.LZ4.BIN | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/ROGUE.LZ4 BIN
cat rel/PRIMEGAP#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/PRIMEGAP REL
cat rel/ROGUE#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/rogue/ROGUE REL
cat rel/ROGUECOMBAT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/rogue/ROGUECOMBAT REL
cat rel/ROGUEMAP#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/rogue/ROGUEMAP REL
cat samplesrc/LEVEL0#040000 | ./ac.jar -ptx PLASMA-2.1-DEMOS.po demos/rogue/LEVEL0 TXT
cat samplesrc/LEVEL1#040000 | ./ac.jar -ptx PLASMA-2.1-DEMOS.po demos/rogue/LEVEL1 TXT
cat rel/apple/PLAYSEQ#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/music/PLAYSEQ REL
cat mockingboard/ultima3.seq | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/music/ULTIMA3.SEQ BIN
cat mockingboard/startrek.seq | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/music/STARTREK.SEQ BIN
cat rel/HTTPD#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/net/HTTPD REL
cat samplesrc/index.html | ./ac.jar -ptx PLASMA-2.1-DEMOS.po demos/net/INDEX.HTML TXT
cat rel/apple/TILETEST#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/TILETEST REL
cat rel/apple/HGRTEST#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/HGRTEST REL
cat rel/apple/GRTEST#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/GRTEST REL
cat rel/apple/DGRTEST#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/DGRTEST REL
cat rel/apple/SFM#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/spiders/SFM REL
cat rel/apple/SFMSPRT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/spiders/SFMSPRT REL
cat rel/apple/SPIPORT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/SPIPORT REL
cat rel/apple/SDFAT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/SDFAT REL
cat rel/apple/FATCAT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/FATCAT REL
cat rel/apple/FATGET#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/FATGET REL
cat rel/apple/FATPUT#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/FATPUT REL
cat rel/apple/FATREADDSK#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/FATREADDSK REL
cat rel/apple/FATWRITEDSK#FE1000 | ./ac.jar -p PLASMA-2.1-DEMOS.po demos/apple2/sdutils/FATWRITEDSK REL

View File

@@ -1,4 +0,0 @@
#!/bin/bash
./mk140
./mk800

View File

@@ -1,21 +0,0 @@
cp ../sysfiles/BLANK140.po PLASMA-2.1-FPSOS.po
./ac.jar -n PLASMA-2.1-FPSOS.po PLASMA.FPSOS
cat ../sysfiles/SOS.KERNEL#0C0000 | ./ac.jar -p PLASMA-2.1-FPSOS.po SOS.KERNEL \$0C
cat ../sysfiles/SOS.DRIVER#0C0000 | ./ac.jar -p PLASMA-2.1-FPSOS.po SOS.DRIVER \$0C
cat rel/apple/SOS.INTERP#050000 | ./ac.jar -p PLASMA-2.1-FPSOS.po SOS.INTERP \$05
cat rel/apple/SOS.CMD#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po SOS.CMD REL
cat rel/apple/SOS.INTERPJIT#050000 | ./ac.jar -p PLASMA-2.1-FPSOS.po SOS.INTERPJIT \$05
cat rel/apple/SOS.CMDJIT#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po SOS.CMDJIT REL
cat rel/apple/SOS#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/SOS REL
cat rel/apple/GRAFIX#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/GRAFIX REL
cat rel/FPSTR#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/FPSTR REL
cat rel/FPU#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/FPU REL
cat rel/SANE#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/SANE REL
cat ../sysfiles/FP6502.CODE#060000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/FP6502.CODE BIN
cat ../sysfiles/ELEMS.CODE#060000 | ./ac.jar -p PLASMA-2.1-FPSOS.po sys/ELEMS.CODE BIN
cat inc/grafix.plh | ./ac.jar -ptx PLASMA-2.1-FPSOS.po bld/inc/GRAFIX.PLH TXT
cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1-FPSOS.po bld/samples/GFXDEMO.PLA TXT
cat scripts/grafix.4th | ./ac.jar -ptx PLASMA-2.1-FPSOS.po sys/scripts/GRAFIX.4TH TXT
cat scripts/gfxplot.4th | ./ac.jar -ptx PLASMA-2.1-FPSOS.po bld/scripts/GFXPLOT.4TH TXT
cat rel/apple/GFXDEMO#FE1000 | ./ac.jar -p PLASMA-2.1-FPSOS.po demos/apple3/GFXDEMO REL
cat samplesrc/APPLE3.PIX#060000 | ./ac.jar -p PLASMA-2.1-FPSOS.po demos/apple3/APPLE3.PIX BIN

View File

@@ -1,8 +0,0 @@
cp ../sysfiles/BLANK140.po PLASMA-2.1-INET.po
./ac.jar -n PLASMA-2.1-INET.po PLASMA.INET
cat rel/INET#FE1000 | ./ac.jar -p PLASMA-2.1-INET.po sys/INET REL
cat rel/DHCP#FE1000 | ./ac.jar -p PLASMA-2.1-INET.po sys/DHCP REL
cat rel/ETHERIP#FE1000 | ./ac.jar -p PLASMA-2.1-INET.po sys/ETHERIP REL
cat rel/apple/UTHERNET2#FE1000 | ./ac.jar -p PLASMA-2.1-INET.po sys/UTHERNET2 REL
cat rel/apple/UTHERNET#FE1000 | ./ac.jar -p PLASMA-2.1-INET.po sys/UTHERNET REL
cat rel/TFTPD#FE1000 | ./ac.jar -p PLASMA-2.1-INET.po sys/TFTPD REL

View File

@@ -1,38 +0,0 @@
cp ../sysfiles/BLANK140.po PLASMA-2.1-INST.po
./ac.jar -n PLASMA-2.1-INST.po PLASMA.INST
cat ../sysfiles/PRODOS#FF0000 | ./ac.jar -p PLASMA-2.1-INST.po PRODOS SYS
cat rel/apple/CMD#061000 | ./ac.jar -p PLASMA-2.1-INST.po CMD BIN $1000
cat rel/apple/CMD128#061000 | ./ac.jar -p PLASMA-2.1-INST.po CMD128 BIN $1000
cat rel/apple/PLASMA.SYSTEM#FF2000 | ./ac.jar -p PLASMA-2.1-INST.po PLASMA.SYSTEM SYS
cat rel/apple/PLVM.128#FF2000 | ./ac.jar -p PLASMA-2.1-INST.po PLVM.128 SYS
cat rel/apple/PLVM16#FF2000 | ./ac.jar -p PLASMA-2.1-INST.po PLVM16 SYS
cat rel/apple/JIT#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/JIT REL
cat rel/apple/JIT16#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/JIT16 REL
cat rel/apple/FILEIO#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/FILEIO REL
cat rel/apple/CONIO#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/CONIO REL
cat rel/apple/COPY#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/COPY REL
cat rel/apple/DEL#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/DEL REL
cat rel/apple/REN#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/REN REL
cat rel/apple/CAT#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/CAT REL
cat rel/apple/TYPE#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/TYPE REL
cat rel/apple/NEWDIR#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/NEWDIR REL
cat rel/apple/MATCHFILES#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/MATCHFILES REL
cat rel/ARGS#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/ARGS REL
cat rel/LONGJMP#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/LONGJMP REL
cat rel/INT32#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/INT32 REL
cat rel/HRFORTH#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/HRFORTH REL
cat rel/HR2FORTH#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/HR2FORTH REL
cat rel/TX2FORTH#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/TX2FORTH REL
cat rel/PLFORTH#FE1000 | ./ac.jar -p PLASMA-2.1-INST.po sys/PLFORTH REL
cat scripts/plasma.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/PLASMA.4TH TXT
cat scripts/machid.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/MACHID.4TH TXT
cat scripts/conio.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/CONIO.4TH TXT
cat scripts/fileio.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/FILEIO.4TH TXT
cat scripts/grlib.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/GRLIB.4TH TXT
cat scripts/dgrlib.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/DGRLIB.4TH TXT
cat scripts/hgrlib.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/HGRLIB.4TH TXT
cat scripts/int32.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/INT32.4TH TXT
cat scripts/fpu.4th | ./ac.jar -ptx PLASMA-2.1-INST.po sys/scripts/FPU.4TH TXT
cat scripts/hdinstall1.4th | ./ac.jar -ptx PLASMA-2.1-INST.po HDINSTALL.4TH TXT
cat scripts/hdinstall2.4th | ./ac.jar -ptx PLASMA-2.1-INST.po HDINSTALL2.4TH TXT
echo "+PLFORTH HDINSTALL.4TH" | ./ac.jar -ptx PLASMA-2.1-INST.po AUTORUN TXT

287
src/mkrel
View File

@@ -1,216 +1,115 @@
#!/bin/bash
make apple
cp rel/apple/CMD#061000 prodos/CMD.BIN
cp rel/apple/CMD128#061000 prodos/CMD128.BIN
cp rel/apple/CMD#061000 prodos/CMD.BIN
cp rel/apple/PLASMA.SYSTEM#FF2000 prodos/PLASMA.SYSTEM.SYS
cp rel/apple/PLVM.128#FF2000 prodos/PLVM.128.SYS
cp rel/apple/PLVM16#FF2000 prodos/PLVM16.SYS
cp ../doc/Editor.md prodos/EDITOR.README.TXT
cp rel/apple/PLASMA16.SYSTEM#FF2000 prodos/PLASMA16.SYSTEM.SYS
cp rel/apple/SOS.INTERP#050000 prodos/SOS.INTERP.\$05
cp ../doc/Editor.md prodos/EDITOR.README.TXT
rm -rf prodos/sys
mkdir prodos/sys
cp rel/apple/FILEIO#FE1000 prodos/sys/FILEIO.REL
cp rel/apple/CONIO#FE1000 prodos/sys/CONIO.REL
cp rel/LINES#FE1000 prodos/sys/LINES.REL
cp rel/apple/HGRFONT#FE1000 prodos/sys/HGRFONT.REL
cp rel/apple/HGRTILE#FE1000 prodos/sys/HGRTILE.REL
cp rel/apple/HGRSPRITE#FE1000 prodos/sys/HGRSPRITE.REL
cp rel/apple/HGRLIB#FE1000 prodos/sys/HGRLIB.REL
cp rel/apple/GRLIB#FE1000 prodos/sys/GRLIB.REL
cp rel/apple/DGRLIB#FE1000 prodos/sys/DGRLIB.REL
cp rel/apple/COPY#FE1000 prodos/sys/COPY.REL
cp rel/apple/DEL#FE1000 prodos/sys/DEL.REL
cp rel/apple/REN#FE1000 prodos/sys/REN.REL
cp rel/apple/CAT#FE1000 prodos/sys/CAT.REL
cp rel/apple/NEWDIR#FE1000 prodos/sys/NEWDIR.REL
cp rel/apple/TYPE#FE1000 prodos/sys/TYPE.REL
cp rel/apple/MATCHFILES#FE1000 prodos/sys/MATCHFILES.REL
cp rel/ARGS#FE1000 prodos/sys/ARGS.REL
cp rel/ED#FE1000 prodos/sys/ED.REL
cp rel/FIBER#FE1000 prodos/sys/FIBER.REL
cp rel/LONGJMP#FE1000 prodos/sys/LONGJMP.REL
cp rel/MEMMGR#FE1000 prodos/sys/MEMMGR.REL
cp rel/INET#FE1000 prodos/sys/INET.REL
cp rel/DHCP#FE1000 prodos/sys/DHCP.REL
cp rel/ETHERIP#FE1000 prodos/sys/ETHERIP.REL
cp rel/apple/MOUSE#FE1000 prodos/sys/MOUSE.REL
cp rel/apple/UTHERNET2#FE1000 prodos/sys/UTHERNET2.REL
cp rel/apple/UTHERNET#FE1000 prodos/sys/UTHERNET.REL
cp rel/apple/PORTIO#FE1000 prodos/sys/PORTIO.REL
cp rel/apple/JOYBUZZ#FE1000 prodos/sys/JOYBUZZ.REL
cp rel/apple/SNDSEQ#FE1000 prodos/sys/SNDSEQ.REL
cp rel/apple/JIT#FE1000 prodos/sys/JIT.REL
cp rel/apple/JIT16#FE1000 prodos/sys/JIT16.REL
cp rel/apple/JITUNE#FE1000 prodos/sys/JITUNE.REL
cp rel/apple/ZIPCHIP#FE1000 prodos/sys/ZIPCHIP.REL
cp rel/LZ4#FE1000 prodos/sys/LZ4.REL
cp rel/TFTPD#FE1000 prodos/sys/TFTPD.REL
cp rel/INT32#FE1000 prodos/sys/INT32.REL
cp rel/FPSTR#FE1000 prodos/sys/FPSTR.REL
cp rel/FPU#FE1000 prodos/sys/FPU.REL
cp rel/SANE#FE1000 prodos/sys/SANE.REL
cp rel/ARGS#FE1000 prodos/sys/ARGS.REL
cp rel/apple/CONIO#FE1000 prodos/sys/CONIO.REL
cp rel/apple/DGR#FE1000 prodos/sys/DGR.REL
cp rel/DHCP#FE1000 prodos/sys/DHCP.REL
cp rel/ED#FE1000 prodos/sys/ED.REL
cp rel/ETHERIP#FE1000 prodos/sys/ETHERIP.REL
cp rel/FIBER#FE1000 prodos/sys/FIBER.REL
cp rel/apple/FILEIO#FE1000 prodos/sys/FILEIO.REL
cp rel/FPSTR#FE1000 prodos/sys/FPSTR.REL
cp rel/FPU#FE1000 prodos/sys/FPU.REL
cp rel/INET#FE1000 prodos/sys/INET.REL
cp rel/LONGJMP#FE1000 prodos/sys/LONGJMP.REL
cp rel/MEMMGR#FE1000 prodos/sys/MEMMGR.REL
cp rel/apple/PORTIO#FE1000 prodos/sys/PORTIO.REL
cp rel/apple/JOYBUZZ#FE1000 prodos/sys/JOYBUZZ.REL
cp rel/SANE#FE1000 prodos/sys/SANE.REL
cp rel/apple/SDFAT#FE1000 prodos/sys/SDFAT.REL
cp rel/apple/SPIPORT#FE1000 prodos/sys/SPIPORT.REL
cp rel/apple/SNDSEQ#FE1000 prodos/sys/SNDSEQ.REL
cp rel/apple/MOUSE#FE1000 prodos/sys/MOUSE.REL
cp rel/apple/UTHERNET#FE1000 prodos/sys/UTHERNET.REL
cp rel/apple/UTHERNET2#FE1000 prodos/sys/UTHERNET2.REL
cp rel/apple/SOS#FE1000 prodos/sys/SOS.REL
cp rel/apple/GRAFIX#FE1000 prodos/sys/GRAFIX.REL
cp ../sysfiles/FP6502.CODE#060000 prodos/sys/FP6502.CODE.BIN
cp ../sysfiles/ELEMS.CODE#060000 prodos/sys/ELEMS.CODE.BIN
cp rel/apple/SOS#FE1000 prodos/sys/SOS.REL
cp rel/apple/GRAFIX#FE1000 prodos/sys/GRAFIX.REL
cp rel/HRFORTH#FE1000 prodos/sys/HRFORTH.REL
cp rel/HR2FORTH#FE1000 prodos/sys/HR2FORTH.REL
cp rel/TX2FORTH#FE1000 prodos/sys/TX2FORTH.REL
cp rel/PLFORTH#FE1000 prodos/sys/PLFORTH.REL
mkdir prodos/sys/scripts
cp scripts/plasma.4th prodos/sys/scripts/PLASMA.4TH.TXT
cp scripts/machid.4th prodos/sys/scripts/MACHID.4TH.TXT
cp scripts/conio.4th prodos/sys/scripts/CONIO.4TH.TXT
cp scripts/fileio.4th prodos/sys/scripts/FILEIO.4TH.TXT
cp scripts/grlib.4th prodos/sys/scripts/GRLIB.4TH.TXT
cp scripts/dgrlib.4th prodos/sys/scripts/DGRLIB.4TH.TXT
cp scripts/hgrlib.4th prodos/sys/scripts/HGRLIB.4TH.TXT
cp scripts/grafix.4th prodos/sys/scripts/GRAFIX.4TH.TXT
cp scripts/int32.4th prodos/sys/scripts/INT32.4TH.TXT
cp scripts/fpu.4th prodos/sys/scripts/FPU.4TH.TXT
cp ../sysfiles/ELEMS.CODE#060000 prodos/sys/ELEMS.CODE.BIN
rm -rf prodos/demos
mkdir prodos/demos
cp rel/INT32TEST#FE1000 prodos/demos/INT32TEST.REL
cp rel/apple/CONIOTEST#FE1000 prodos/demos/CONIOTEST.REL
cp rel/apple/ROD#FE1000 prodos/demos/ROD.REL
cp rel/RPNCALC#FE1000 prodos/demos/RPNCALC.REL
cp rel/LZ4CAT#FE1000 prodos/demos/LZ4CAT.REL
cp ../doc/ROGUE.LZ4.BIN prodos/demos/ROGUE.LZ4.BIN
cp rel/PRIMEGAP#FE1000 prodos/demos/PRIMEGAP.REL
cp rel/apple/DGRTEST#FE1000 prodos/demos/DGRTEST.REL
cp rel/RPNCALC#FE1000 prodos/demos/RPNCALC.REL
cp rel/ROD#FE1000 prodos/demos/ROD.REL
mkdir prodos/demos/rogue
cp rel/ROGUE#FE1000 prodos/demos/rogue/ROGUE.REL
cp rel/ROGUECOMBAT#FE1000 prodos/demos/rogue/ROGUECOMBAT.REL
cp rel/ROGUEMAP#FE1000 prodos/demos/rogue/ROGUEMAP.REL
cp rel/ROGUE#FE1000 prodos/demos/rogue/ROGUE.REL
cp rel/ROGUECOMBAT#FE1000 prodos/demos/rogue/ROGUECOMBAT.REL
cp rel/ROGUEMAP#FE1000 prodos/demos/rogue/ROGUEMAP.REL
cp samplesrc/LEVEL0#040000 prodos/demos/rogue/LEVEL0.TXT
cp samplesrc/LEVEL1#040000 prodos/demos/rogue/LEVEL1.TXT
mkdir prodos/demos/music
cp rel/apple/PLAYSEQ#FE1000 prodos/demos/music/PLAYSEQ.REL
cp mockingboard/ultima3.seq prodos/demos/music/ULTIMA3.SEQ.BIN
cp mockingboard/startrek.seq prodos/demos/music/STARTREK.SEQ.BIN
mkdir prodos/demos/net
cp rel/HTTPD#FE1000 prodos/demos/net/HTTPD.REL
cp samplesrc/index.html prodos/demos/net/INDEX.HTML.TXT
mkdir prodos/demos/apple2
cp rel/apple/TILETEST#FE1000 prodos/demos/apple2/TILETEST.REL
cp rel/apple/HGRTEST#FE1000 prodos/demos/apple2/HGRTEST.REL
cp rel/apple/GRTEST#FE1000 prodos/demos/apple2/GRTEST.REL
cp rel/apple/DGRTEST#FE1000 prodos/demos/apple2/DGRTEST.REL
mkdir prodos/demos/apple2/spiders
cp rel/apple/SFM#FE1000 prodos/demos/apple2/spiders/SFM.REL
cp rel/apple/SFMSPRT#FE1000 prodos/demos/apple2/spiders/SFMSPRT.REL
mkdir prodos/demos/apple2/sdutils
cp rel/apple/SPIPORT#FE1000 prodos/demos/apple2/sdutils/SPIPORT.REL
cp rel/apple/SDFAT#FE1000 prodos/demos/apple2/sdutils/SDFAT.REL
cp rel/apple/FATCAT#FE1000 prodos/demos/apple2/sdutils/FATCAT.REL
cp rel/apple/FATGET#FE1000 prodos/demos/apple2/sdutils/FATGET.REL
cp rel/apple/FATPUT#FE1000 prodos/demos/apple2/sdutils/FATPUT.REL
cp rel/apple/FATREADDSK#FE1000 prodos/demos/apple2/sdutils/FATREADDSK.REL
cp rel/apple/FATWRITEDSK#FE1000 prodos/demos/apple2/sdutils/FATWRITEDSK.REL
mkdir prodos/demos/sdutils
cp rel/apple/FATCAT#FE1000 prodos/demos/sdutils/FATCAT.REL
cp rel/apple/FATGET#FE1000 prodos/demos/sdutils/FATGET.REL
cp rel/apple/FATPUT#FE1000 prodos/demos/sdutils/FATPUT.REL
cp rel/apple/FATREADDSK#FE1000 prodos/demos/sdutils/FATREADDSK.REL
cp rel/apple/FATWRITEDSK#FE1000 prodos/demos/sdutils/FATWRITEDSK.REL
mkdir prodos/demos/apple3
cp rel/apple/GFXDEMO#FE1000 prodos/demos/apple3/GFXDEMO.REL
cp rel/apple/GFXDEMO#FE1000 prodos/demos/apple3/GFXDEMO.REL
cp samplesrc/APPLE3.PIX#060000 prodos/demos/apple3/APPLE3.PIX.BIN
mkdir prodos/demos/net
cp rel/HTTPD#FE1000 prodos/demos/net/HTTPD.REL
cp samplesrc/index.html prodos/demos/net/INDEX.HTML.TXT
cp rel/TFTPD#FE1000 prodos/sys/TFTPD.REL
mkdir prodos/demos/music
cp rel/apple/PLAYSEQ#FE1000 prodos/demos/music/PLAYSEQ.REL
cp mockingboard/ultima3.seq prodos/demos/music/ULTIMA3.SEQ.BIN
cp mockingboard/startrek.seq prodos/demos/music/STARTREK.SEQ.BIN
rm -rf prodos/bld
mkdir prodos/bld
cp rel/PLASM#FE1000 prodos/bld/PLASM.REL
cp rel/CODEOPT#FE1000 prodos/bld/CODEOPT.REL
mkdir prodos/bld/samples
cp samplesrc/hello.pla prodos/bld/samples/HELLO.PLA.TXT
cp samplesrc/int32test.pla prodos/bld/samples/INT32TEST.PLA.TXT
cp samplesrc/coniotest.pla prodos/bld/samples/CONIOTEST.PLA.TXT
cp samplesrc/grtest.pla prodos/bld/samples/GRTEST.PLA.TXT
cp samplesrc/dgrtest.pla prodos/bld/samples/DGRTEST.PLA.TXT
cp samplesrc/hgrtest.pla prodos/bld/samples/HGRTEST.PLA.TXT
cp samplesrc/tiletest.pla prodos/bld/samples/TILETEST.PLA.TXT
cp samplesrc/fibertest.pla prodos/bld/samples/FIBERTEST.PLA.TXT
cp samplesrc/mousetest.pla prodos/bld/samples/MOUSETEST.PLA.TXT
cp samplesrc/memtest.pla prodos/bld/samples/MEMTEST.PLA.TXT
cp samplesrc/rod.pla prodos/bld/samples/ROD.PLA.TXT
cp samplesrc/sieve.pla prodos/bld/samples/SIEVE.PLA.TXT
cp samplesrc/test.pla prodos/bld/samples/TEST.PLA.TXT
cp samplesrc/testlib.pla prodos/bld/samples/TESTLIB.PLA.TXT
cp samplesrc/playseq.pla prodos/bld/samples/PLAYSEQ.PLA.TXT
cp samplesrc/rpncalc.pla prodos/bld/samples/RPNCALC.PLA.TXT
cp samplesrc/fatcat.pla prodos/bld/samples/FATCAT.PLA.TXT
cp samplesrc/gfxdemo.pla prodos/bld/samples/GFXDEMO.PLA.TXT
cp samplesrc/lz4cat.pla prodos/bld/samples/LZ4CAT.PLA.TXT
cp samplesrc/sfm.pla prodos/bld/samples/SFM.PLA.TXT
cp samplesrc/sfmsprt.pla prodos/bld/samples/SFMSPRT.PLA.TXT
cp samplesrc/fppow.pla prodos/bld/samples/FPPOW.PLA.TXT
cp utilsrc/apple/mon.pla prodos/bld/samples/MON.PLA.TXT
cp utilsrc/apple/zipchip.pla prodos/bld/samples/ZIPCHIP.PLA.TXT
mkdir prodos/bld/scripts
cp scripts/rod.4th prodos/bld/scripts/ROD.4TH.TXT
cp scripts/bounce.4th prodos/bld/scripts/BOUNCE.4TH.TXT
cp scripts/dbounce.4th prodos/bld/scripts/DBOUNCE.4TH.TXT
cp scripts/hrbounce.4th prodos/bld/scripts/HRBOUNCE.4TH.TXT
cp scripts/plot.4th prodos/bld/scripts/PLOT.4TH.TXT
cp scripts/hrplot.4th prodos/bld/scripts/HRPLOT.4TH.TXT
cp scripts/gfxplot.4th prodos/bld/scripts/GFXPLOT.4TH.TXT
cp scripts/hdinstall.4th prodos/bld/scripts/HDINSTALL.4TH.TXT
cp scripts/hdinstall1.4th prodos/bld/scripts/HDINSTALL1.4TH.TXT
cp scripts/hdinstall2.4th prodos/bld/scripts/HDINSTALL2.4TH.TXT
#mkdir prodos/bld/examples
#cp samplesrc/examples/ex.1.pla prodos/bld/examples/EX.1.PLA.TXT
#cp samplesrc/examples/ex.2.pla prodos/bld/examples/EX.2.PLA.TXT
#cp samplesrc/examples/ex.3.pla prodos/bld/examples/EX.3.PLA.TXT
#cp samplesrc/examples/ex.4.pla prodos/bld/examples/EX.4.PLA.TXT
#cp samplesrc/examples/ex.5.pla prodos/bld/examples/EX.5.PLA.TXT
#cp samplesrc/examples/ex.6.pla prodos/bld/examples/EX.6.PLA.TXT
#cp samplesrc/examples/ex.7.pla prodos/bld/examples/EX.7.PLA.TXT
#cp samplesrc/examples/ex.8.pla prodos/bld/examples/EX.8.PLA.TXT
#cp samplesrc/examples/ex.9.pla prodos/bld/examples/EX.9.PLA.TXT
#cp samplesrc/examples/ex.10.pla prodos/bld/examples/EX.10.PLA.TXT
#cp samplesrc/examples/ex.11.pla prodos/bld/examples/EX.11.PLA.TXT
#cp samplesrc/examples/ex.12.pla prodos/bld/examples/EX.12.PLA.TXT
#cp samplesrc/examples/ex.13.pla prodos/bld/examples/EX.13.PLA.TXT
#cp samplesrc/examples/ex.14.pla prodos/bld/examples/EX.14.PLA.TXT
#cp samplesrc/examples/ex.15.pla prodos/bld/examples/EX.15.PLA.TXT
#cp samplesrc/examples/ex.16.pla prodos/bld/examples/EX.16.PLA.TXT
#cp samplesrc/examples/ex.17.pla prodos/bld/examples/EX.17.PLA.TXT
cp rel/PLASM#FE1000 prodos/bld/PLASM.REL
cp rel/CODEOPT#FE1000 prodos/bld/CODEOPT.REL
cp samplesrc/dgrtest.pla prodos/bld/DGRTEST.PLA.TXT
cp samplesrc/hello.pla prodos/bld/HELLO.PLA.TXT
cp samplesrc/hgr1test.pla prodos/bld/HGR1TEST.PLA.TXT
cp samplesrc/fibertest.pla prodos/bld/FIBERTEST.PLA.TXT
cp samplesrc/mon.pla prodos/bld/MON.PLA.TXT
cp samplesrc/memtest.pla prodos/bld/MEMTEST.PLA.TXT
cp samplesrc/rod.pla prodos/bld/ROD.PLA.TXT
cp samplesrc/sieve.pla prodos/bld/SIEVE.PLA.TXT
cp samplesrc/test.pla prodos/bld/TEST.PLA.TXT
cp samplesrc/testlib.pla prodos/bld/TESTLIB.PLA.TXT
cp samplesrc/playseq.pla prodos/bld/PLAYSEQ.PLA.TXT
cp samplesrc/rpncalc.pla prodos/bld/RPNCALC.PLA.TXT
cp samplesrc/httpd.pla prodos/bld/HTTPD.PLA.TXT
cp samplesrc/fatcat.pla prodos/bld/FATCAT.PLA.TXT
cp samplesrc/rogue.pla prodos/bld/ROGUE.PLA.TXT
cp samplesrc/rogue.map.pla prodos/bld/ROGUE.MAP.PLA.TXT
cp samplesrc/rogue.combat.pla prodos/bld/ROGUE.COMBAT.PLA.TXT
cp samplesrc/gfxdemo.pla prodos/bld/GFXDEMO.PLA.TXT
cp samplesrc/mousetest.pla prodos/bld/MOUSETEST.PLA.TXT
mkdir prodos/bld/inc
cp inc/args.plh prodos/bld/inc/ARGS.PLH.TXT
cp inc/matchfiles.plh prodos/bld/inc/MATCHFILES.PLH.TXT
cp inc/cmdsys.plh prodos/bld/inc/CMDSYS.PLH.TXT
cp inc/conio.plh prodos/bld/inc/CONIO.PLH.TXT
cp inc/lines.plh prodos/bld/inc/LINES.PLH.TXT
cp inc/hgrfont.plh prodos/bld/inc/HGRFONT.PLH.TXT
cp inc/hgrtile.plh prodos/bld/inc/HGRTILE.PLH.TXT
cp inc/hgrsprite.plh prodos/bld/inc/HGRSPRITE.PLH.TXT
cp inc/hgrlib.plh prodos/bld/inc/HGRLIB.PLH.TXT
cp inc/grlib.plh prodos/bld/inc/GRLIB.PLH.TXT
cp inc/dgrlib.plh prodos/bld/inc/DGRLIB.PLH.TXT
cp inc/fiber.plh prodos/bld/inc/FIBER.PLH.TXT
cp inc/fileio.plh prodos/bld/inc/FILEIO.PLH.TXT
cp inc/int32.plh prodos/bld/inc/INT32.PLH.TXT
cp inc/fpstr.plh prodos/bld/inc/FPSTR.PLH.TXT
cp inc/fpu.plh prodos/bld/inc/FPU.PLH.TXT
cp inc/mouse.plh prodos/bld/inc/MOUSE.PLH.TXT
cp inc/inet.plh prodos/bld/inc/INET.PLH.TXT
cp inc/longjmp.plh prodos/bld/inc/LONGJMP.PLH.TXT
cp inc/memmgr.plh prodos/bld/inc/MEMMGR.PLH.TXT
cp inc/sane.plh prodos/bld/inc/SANE.PLH.TXT
cp inc/joybuzz.plh prodos/bld/inc/JOYBUZZ.PLH.TXT
cp inc/portio.plh prodos/bld/inc/PORTIO.PLH.TXT
cp inc/sdfat.plh prodos/bld/inc/SDFAT.PLH.TXT
cp inc/sndseq.plh prodos/bld/inc/SNDSEQ.PLH.TXT
cp inc/spiport.plh prodos/bld/inc/SPIPORT.PLH.TXT
cp inc/testlib.plh prodos/bld/inc/TESTLIB.PLH.TXT
cp inc/grafix.plh prodos/bld/inc/GRAFIX.PLH.TXT
cp inc/lz4.plh prodos/bld/inc/LZ4.PLH.TXT
cp inc/args.plh prodos/bld/inc/ARGS.PLH.TXT
cp inc/cmdsys.plh prodos/bld/inc/CMDSYS.PLH.TXT
cp inc/conio.plh prodos/bld/inc/CONIO.PLH.TXT
cp inc/dgr.plh prodos/bld/inc/DGR.PLH.TXT
cp inc/fiber.plh prodos/bld/inc/FIBER.PLH.TXT
cp inc/fileio.plh prodos/bld/inc/FILEIO.PLH.TXT
cp inc/fpstr.plh prodos/bld/inc/FPSTR.PLH.TXT
cp inc/fpu.plh prodos/bld/inc/FPU.PLH.TXT
cp inc/inet.plh prodos/bld/inc/INET.PLH.TXT
cp inc/longjmp.plh prodos/bld/inc/LONGJMP.PLH.TXT
cp inc/memmgr.plh prodos/bld/inc/MEMMGR.PLH.TXT
cp inc/sane.plh prodos/bld/inc/SANE.PLH.TXT
cp inc/joybuzz.plh prodos/bld/inc/JOYBUZZ.PLH.TXT
cp inc/portio.plh prodos/bld/inc/PORTIO.PLH.TXT
cp inc/sdfat.plh prodos/bld/inc/SDFAT.PLH.TXT
cp inc/sndseq.plh prodos/bld/inc/SNDSEQ.PLH.TXT
cp inc/spiport.plh prodos/bld/inc/SPIPORT.PLH.TXT
cp inc/testlib.plh prodos/bld/inc/TESTLIB.PLH.TXT
cp inc/grafix.plh prodos/bld/inc/GRAFIX.PLH.TXT
cp inc/mouse.plh prodos/bld/inc/MOUSE.PLH.TXT
cp vmsrc/apple/plvmzp.inc prodos/bld/inc/PLVMZP.INC.TXT

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