summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Sindholt <opensource@zhasha.com>2009-11-08 11:11:21 +0100
committerJoakim Sindholt <opensource@zhasha.com>2009-11-08 11:11:21 +0100
commit485fe570007f56793bb1aa491baf4a5ca92732d3 (patch)
treeb32486ddcf0fa32550fbeec648e42e18a7f0d4ce
Initial commit
-rw-r--r--AUTHORS0
-rw-r--r--COPYING674
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL302
-rw-r--r--Makefile.am49
-rw-r--r--NEWS0
-rw-r--r--README0
-rwxr-xr-xautogen.sh12
-rw-r--r--configure.ac35
-rw-r--r--data/Makefile.am7
-rw-r--r--data/r300reg.xml5243
-rw-r--r--data/rsim.desktop9
-rw-r--r--data/rsim.pngbin0 -> 20463 bytes
-rw-r--r--src/cs.c1036
-rw-r--r--src/cs.vala149
-rw-r--r--src/csimport.c501
-rw-r--r--src/csimport.vala187
-rw-r--r--src/csview.c1755
-rw-r--r--src/csview.vala540
-rw-r--r--src/main.c883
-rw-r--r--src/main.vala171
-rw-r--r--src/registers.c2951
-rw-r--r--src/registers.vala449
23 files changed, 14953 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/AUTHORS
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -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>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..2550dab
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,302 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 6. Often, you can also type `make uninstall' to remove the installed
+ files again.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *Note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..3132e82
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,49 @@
+NULL =
+
+AUTOMAKE_OPTIONS = subdir-objects
+
+SUBDIRS = \
+ data \
+ $(NULL)
+
+INCLUDES = \
+ $(RSIM_CFLAGS) \
+ -include $(CONFIG_HEADER) \
+ $(NULL)
+
+BUILT_SOURCES = src/rsim.vala.stamp
+
+bin_PROGRAMS = rsim
+
+rsim_VALASOURCES = \
+ src/cs.vala \
+ src/csimport.vala \
+ src/csview.vala \
+ src/main.vala \
+ src/registers.vala \
+ $(NULL)
+
+rsim_SOURCES = \
+ $(rsim_VALASOURCES:.vala=.c) \
+ $(NULL)
+
+src/rsim.vala.stamp: $(rsim_VALASOURCES)
+ $(VALAC) -C --pkg libxml-2.0 --pkg gtk+-2.0 --save-temps --basedir $(top_srcdir) $^
+ touch $@
+
+rsim_LDADD = \
+ $(RSIM_LIBS) \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(rsim_VALASOURCES) \
+ src/rsim.vala.stamp \
+ $(NULL)
+
+DISTCLEANFILES = \
+ $(NULL)
+
+MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub \
+ configure depcomp install-sh ltmain.sh \
+ Makefile.in missing config.h.in \
+ mkinstalldirs data/Makefile.in
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..61289aa
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+$srcdir/configure "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..fb36b47
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,35 @@
+AC_INIT([rsim], [0.0.1], [opensource@zhasha.com], [rsim])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS(config.h)
+AM_INIT_AUTOMAKE([dist-bzip2])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_PROG_CC
+AM_PROG_CC_C_O
+
+AC_PATH_PROG(VALAC, valac, valac)
+AC_SUBST(VALAC)
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+
+VALA_REQUIRED=0.7.5
+GLIB_REQUIRED=2.12.0
+GTK_REQUIRED=2.10.0
+LIBXML_REQUIRED=2.0
+
+PKG_CHECK_MODULES(VALA,
+ vala-1.0 >= $VALA_REQUIRED)
+
+PKG_CHECK_MODULES(RSIM,
+ glib-2.0 >= $GLIB_REQUIRED
+ gobject-2.0 >= $GLIB_REQUIRED
+ gtk+-2.0 >= $GTK_REQUIRED
+ libxml-2.0 >= $LIBXML_REQUIRED)
+AC_SUBST(RSIM_CFLAGS)
+AC_SUBST(RSIM_LIBS)
+
+AC_CONFIG_FILES([Makefile data/Makefile])
+
+AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..f36d584
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,7 @@
+dist_pkgdata_DATA = r300reg.xml
+
+desktopdir = $(datadir)/applications
+dist_desktop_DATA = rsim.desktop
+
+appicondir = $(datadir)/pixmaps
+dist_appicon_DATA = rsim.png
diff --git a/data/r300reg.xml b/data/r300reg.xml
new file mode 100644
index 0000000..c752524
--- /dev/null
+++ b/data/r300reg.xml
@@ -0,0 +1,5243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<database xmlns="http://nouveau.freedesktop.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="rules-ng.xsd">
+<domain name="R300" />
+
+<enum name="AARESOLVE_MODE">
+ <value value="0" name="NORMAL"><doc>Normal operation.</doc></value>
+ <value value="1" name="RESOLVE"><doc>Resolve operation.</doc></value>
+</enum>
+<enum name="AARESOLVE_GAMMA">
+ <value value="0" name="1_0"><doc>1.0</doc></value>
+ <value value="1" name="2_2"><doc>2.2</doc></value>
+</enum>
+<enum name="COMBINE_FUNCTION">
+ <value value="0" name="ADD_CLAMP"><doc>Add and Clamp</doc></value>
+ <value value="1" name="ADD"><doc>Add but no Clamp</doc></value>
+ <value value="2" name="SRC_MINUS_DST_CLAMP"><doc>Subtract Dst from Src, and Clamp</doc></value>
+ <value value="3" name="SRC_MINUS_DST"><doc>Subtract Dst from Src, and don't Clamp</doc></value>
+ <value value="4" name="MIN"><doc>Minimum of Src, Dst (the src and dst blend functions are forced to D3D_ONE)</doc></value>
+ <value value="5" name="MAX"><doc>Maximum of Src, Dst (the src and dst blend functions are forced to D3D_ONE)</doc></value>
+ <value value="6" name="DST_MINUS_SRC_CLAMP"><doc>Subtract Src from Dst, and Clamp</doc></value>
+ <value value="7" name="DST_MINUS_SRC"><doc>Subtract Src from Dst, and don't Clamp</doc></value>
+</enum>
+<enum name="BLEND_FUNC_SRC">
+ <value value="1" name="D3D_ZERO" />
+ <value value="2" name="D3D_ONE" />
+ <value value="3" name="D3D_SRCCOLOR" />
+ <value value="4" name="D3D_INVSRCCOLOR" />
+ <value value="5" name="D3D_SRCALPHA" />
+ <value value="6" name="D3D_INVSRCALPHA" />
+ <value value="7" name="D3D_DESTALPHA" />
+ <value value="8" name="D3D_INVDESTALPHA" />
+ <value value="9" name="D3D_DESTCOLOR" />
+ <value value="10" name="D3D_INVDESTCOLOR" />
+ <value value="11" name="D3D_SRCALPHASAT" />
+ <value value="12" name="D3D_BOTHSRCALPHA" />
+ <value value="13" name="D3D_BOTHINVSRCALPHA" />
+ <value value="32" name="GL_ZERO" />
+ <value value="33" name="GL_ONE" />
+ <value value="34" name="GL_SRC_COLOR" />
+ <value value="35" name="GL_ONE_MINUS_SRC_COLOR" />
+ <value value="36" name="GL_DST_COLOR" />
+ <value value="37" name="GL_ONE_MINUS_DST_COLOR" />
+ <value value="38" name="GL_SRC_ALPHA" />
+ <value value="39" name="GL_ONE_MINUS_SRC_ALPHA" />
+ <value value="40" name="GL_DST_ALPHA" />
+ <value value="41" name="GL_ONE_MINUS_DST_ALPHA" />
+ <value value="42" name="GL_SRC_ALPHA_SATURATE" />
+ <value value="43" name="GL_CONSTANT_COLOR" />
+ <value value="44" name="GL_ONE_MINUS_CONSTANT_COLOR" />
+ <value value="45" name="GL_CONSTANT_ALPHA" />
+ <value value="46" name="GL_ONE_MINUS_CONSTANT_ALPHA" />
+</enum>
+<enum name="BLEND_FUNC_DEST">
+ <value value="1" name="D3D_ZERO" />
+ <value value="2" name="D3D_ONE" />
+ <value value="3" name="D3D_SRCCOLOR" />
+ <value value="4" name="D3D_INVSRCCOLOR" />
+ <value value="5" name="D3D_SRCALPHA" />
+ <value value="6" name="D3D_INVSRCALPHA" />
+ <value value="7" name="D3D_DESTALPHA" />
+ <value value="8" name="D3D_INVDESTALPHA" />
+ <value value="9" name="D3D_DESTCOLOR" />
+ <value value="10" name="D3D_INVDESTCOLOR" />
+ <value value="32" name="GL_ZERO" />
+ <value value="33" name="GL_ONE" />
+ <value value="34" name="GL_SRC_COLOR" />
+ <value value="35" name="GL_ONE_MINUS_SRC_COLOR" />
+ <value value="36" name="GL_DST_COLOR" />
+ <value value="37" name="GL_ONE_MINUS_DST_COLOR" />
+ <value value="38" name="GL_SRC_ALPHA" />
+ <value value="39" name="GL_ONE_MINUS_SRC_ALPHA" />
+ <value value="40" name="GL_DST_ALPHA" />
+ <value value="41" name="GL_ONE_MINUS_DST_ALPHA" />
+ <value value="43" name="GL_CONSTANT_COLOR" />
+ <value value="44" name="GL_ONE_MINUS_CONSTANT_COLOR" />
+ <value value="45" name="GL_CONSTANT_ALPHA" />
+ <value value="46" name="GL_ONE_MINUS_CONSTANT_ALPHA" />
+</enum>
+<enum name="ENABLE">
+ <value value="0" name="DISABLE" />
+ <value value="1" name="ENABLE" />
+</enum>
+<enum name="MICROTILE">
+ <value value="0" name="LINEAR"><doc>3D destination is no microtiled</doc></value>
+ <value value="1" name="TILED"><doc>3D destination is microtiled</doc></value>
+ <value value="2" name="TILED_SQUARE"><doc>3D destination is square microtiled. Only available in 16-bit</doc></value>
+</enum>
+<enum name="BYTESWAP">
+ <value value="0" name="NO_SWAP"><doc>No swap</doc></value>
+ <value value="1" name="WORD_SWAP"><doc>Word swap (2 bytes in 16-bit)</doc></value>
+ <value value="2" name="DWORD_SWAP"><doc>Dword swap (4 bytes in a 32-bit)</doc></value>
+ <value value="3" name="HALF_DWORD_SWAP"><doc>Half-Dword swap (2 16-bit in a 32-bit)</doc></value>
+</enum>
+<enum name="DITHER_MODE">
+ <value value="0" name="TRUNCATE"><doc>Truncate</doc></value>
+ <value value="1" name="ROUND"><doc>Round</doc></value>
+ <value value="2" name="LUT"><doc>LUT dither</doc></value>
+</enum>
+<enum name="ALPHACOMPARE_FUNC">
+ <value value="0" name="NEVER"><doc>Never</doc></value>
+ <value value="1" name="LESS"><doc>Less</doc></value>
+ <value value="2" name="EQUAL"><doc>Equal</doc></value>
+ <value value="3" name="LE"><doc>Less or Equal</doc></value>
+ <value value="4" name="GREATER"><doc>Greater Than</doc></value>
+ <value value="5" name="NOTEQUAL"><doc>Not Equal</doc></value>
+ <value value="6" name="GE"><doc>Greater or Equal</doc></value>
+ <value value="7" name="ALWAYS"><doc>Always</doc></value>
+</enum>
+<enum name="DSCOMPARE_FUNC">
+ <value value="0" name="NEVER"><doc>Never</doc></value>
+ <value value="1" name="LESS"><doc>Less</doc></value>
+ <value value="2" name="LE"><doc>Less or Equal</doc></value>
+ <value value="3" name="EQUAL"><doc>Equal</doc></value>
+ <value value="4" name="GE"><doc>Greater or Equal</doc></value>
+ <value value="5" name="GREATER"><doc>Greater Than</doc></value>
+ <value value="6" name="NOTEQUAL"><doc>Not Equal</doc></value>
+ <value value="7" name="ALWAYS"><doc>Always</doc></value>
+</enum>
+<enum name="ALPHA_SUBPIXEL_SAMPLES">
+ <value value="0" name="2_4"><doc>2/4 sub-pixel samples.</doc></value>
+ <value value="1" name="3_6"><doc>3/6 sub-pixel samples.</doc></value>
+</enum>
+<enum name="SHADING">
+ <value value="0" name="SOLID_FILL"><doc>Solid fill color</doc></value>
+ <value value="1" name="FLAT"><doc>Flat shading</doc></value>
+ <value value="2" name="GOURAUD"><doc>Gouraud shading</doc></value>
+</enum>
+<enum name="LINE_END">
+ <value value="0" name="HORIZONTAL"><doc>Horizontal</doc></value>
+ <value value="1" name="VERTICAL"><doc>Vertical</doc></value>
+ <value value="2" name="SQUARE"><doc>Square (horizontal or vertical depending upon slope)</doc></value>
+ <value value="3" name="COMPUTED"><doc>Computed (perpendicular to slope)</doc></value>
+</enum>
+<enum name="POLY_DRAW_TYPE">
+ <value value="0" name="POINTS"><doc>Draw points.</doc></value>
+ <value value="1" name="LINES"><doc>Draw lines.</doc></value>
+ <value value="2" name="TRIANGLES"><doc>Draw triangles.</doc></value>
+</enum>
+<enum name="ROUNDING_MODE">
+ <value value="0" name="TRUNC"><doc>Round to trunc</doc></value>
+ <value value="1" name="NEAREST"><doc>Round to nearest</doc></value>
+</enum>
+<enum name="STENCIL_AUTO_MODE">
+ <value value="0" name="DISABLE"><doc>Disable stencil auto inc/dec (def).</doc></value>
+ <value value="1" name="ENABLE"><doc>Enable stencil auto inc/dec based on triangle cw/ccw, force into dzy low bit.</doc></value>
+ <value value="2" name="FORCE_0"><doc>Force 0 into dzy low bit.</doc></value>
+</enum>
+<enum name="WORDSIZE_16">
+ <value value="0" name="16"><doc>16 words</doc></value>
+ <value value="1" name="32"><doc>32 words</doc></value>
+ <value value="2" name="64"><doc>64 words</doc></value>
+ <value value="3" name="128"><doc>128 words</doc></value>
+</enum>
+<enum name="WORDSIZE_32">
+ <value value="0" name="32"><doc>32 words</doc></value>
+ <value value="1" name="64"><doc>64 words</doc></value>
+ <value value="2" name="128"><doc>128 words</doc></value>
+ <value value="3" name="256"><doc>256 words</doc></value>
+</enum>
+<enum name="WORDSIZE_64">
+ <value value="0" name="64"><doc>64 words</doc></value>
+ <value value="1" name="128"><doc>128 words</doc></value>
+ <value value="2" name="256"><doc>256 words</doc></value>
+ <value value="3" name="512"><doc>512 words</doc></value>
+</enum>
+<enum name="ENUM44">
+ <value value="0" name="0"><doc>0 words</doc></value>
+ <value value="1" name="4"><doc>4 words</doc></value>
+ <value value="2" name="8"><doc>8 words</doc></value>
+ <value value="3" name="12"><doc>12 words</doc></value>
+</enum>
+<enum name="FOG_SELECT">
+ <value value="0" name="C0A"><doc>Select C0A</doc></value>
+ <value value="1" name="C1A"><doc>Select C1A</doc></value>
+ <value value="2" name="C2A"><doc>Select C2A</doc></value>
+ <value value="3" name="C3A"><doc>Select C3A</doc></value>
+ <value value="4" name="1_1_W"><doc>Select 1/(1/W)</doc></value>
+ <value value="5" name="Z"><doc>Select Z</doc></value>
+</enum>
+<enum name="DEPTH_SELECT">
+ <value value="0" name="Z"><doc>Select Z</doc></value>
+ <value value="1" name="1_1_W"><doc>Select 1/(1/W)</doc></value>
+</enum>
+<enum name="W_SELECT">
+ <value value="0" name="1_W"><doc>Select (1/W)</doc></value>
+ <value value="1" name="K1"><doc>Select 1.0</doc></value>
+</enum>
+<enum name="ENUM50">
+ <value value="0" name="1X1_TILE"><doc>1x1 tile (one 1x1).</doc></value>
+ <value value="1" name="2_TILES"><doc>2 tiles (two 1x1 : ST-A,B).</doc></value>
+ <value value="2" name="4_TILES"><doc>4 tiles (one 2x2).</doc></value>
+ <value value="3" name="8_TILES"><doc>8 tiles (two 2x2 : ST-A,B).</doc></value>
+ <value value="4" name="16_TILES"><doc>16 tiles (one 4x4).</doc></value>
+ <value value="5" name="32_TILES"><doc>32 tiles (two 4x4 : ST-A,B).</doc></value>
+ <value value="6" name="64_TILES"><doc>64 tiles (one 8x8).</doc></value>
+ <value value="7" name="128_TILES"><doc>128 tiles (two 8x8 : ST-A,B).</doc></value>
+</enum>
+<enum name="SUPERTILE_LOCATION">
+ <value value="0" name="ST_A"><doc>ST-A tile.</doc></value>
+ <value value="1" name="ST_B"><doc>ST-B tile.</doc></value>
+</enum>
+<enum name="SUBPIXEL_PRECISION">
+ <value value="0" name="1_12"><doc>Select 1/12 subpixel precision.</doc></value>
+ <value value="1" name="1_16"><doc>Select 1/16 subpixel precision.</doc></value>
+</enum>
+<enum name="PIXEL_CENTER">
+ <value value="0" name="REAL"><doc>Sample texture coordinates at real pixel centers</doc></value>
+ <value value="1" name="ADJUSTED"><doc>Sample texture coordinates at adjusted pixel centers</doc></value>
+</enum>
+<enum name="COLFMT">
+ <value value="0" name="RGBA"><doc>Four components (R,G,B,A)</doc></value>
+ <value value="1" name="RGB0"><doc>Three components (R,G,B,0)</doc></value>
+ <value value="2" name="RGB1"><doc>Three components (R,G,B,1)</doc></value>
+ <value value="4" name="000A"><doc>One component (0,0,0,A)</doc></value>
+ <value value="5" name="0000"><doc>Zero components (0,0,0,0)</doc></value>
+ <value value="6" name="0001"><doc>Zero components (0,0,0,1)</doc></value>
+ <value value="8" name="111A"><doc>One component (1,1,1,A)</doc></value>
+ <value value="9" name="1110"><doc>Zero components (1,1,1,0)</doc></value>
+ <value value="10" name="1111"><doc>Zero components (1,1,1,1)</doc></value>
+</enum>
+<enum name="COLOR_COMPONENT">
+ <value value="0" name="C0"><doc>C0 - 1st texture component</doc></value>
+ <value value="1" name="C1"><doc>C1 - 2nd texture component</doc></value>
+ <value value="2" name="C2"><doc>C2 - 3rd texture component</doc></value>
+ <value value="3" name="C3"><doc>C3 - 4th texture component</doc></value>
+ <value value="4" name="K0"><doc>K0 - The value 0.0</doc></value>
+ <value value="5" name="K1"><doc>K1 - The value 1.0</doc></value>
+</enum>
+<enum name="ENUM59">
+ <value value="0" name="L"><doc>L-in,R-in,HT-in,HB-in</doc></value>
+ <value value="1" name="L"><doc>L-in,R-in,HT-in,HB-out</doc></value>
+ <value value="2" name="L"><doc>L-in,R-in,HT-out,HB-in</doc></value>
+ <value value="3" name="L"><doc>L-in,R-in,HT-out,HB-out</doc></value>
+ <value value="4" name="L"><doc>L-in,R-out,HT-in,HB-in</doc></value>
+ <value value="5" name="L"><doc>L-in,R-out,HT-in,HB-out</doc></value>
+ <value value="6" name="L"><doc>L-in,R-out,HT-out,HB-in</doc></value>
+ <value value="7" name="L"><doc>L-in,R-out,HT-out,HB-out</doc></value>
+ <value value="8" name="L"><doc>L-out,R-in,HT-in,HB-in</doc></value>
+ <value value="9" name="L"><doc>L-out,R-in,HT-in,HB-out</doc></value>
+ <value value="10" name="L"><doc>L-out,R-in,HT-out,HB-in</doc></value>
+ <value value="11" name="L"><doc>L-out,R-in,HT-out,HB-out</doc></value>
+ <value value="12" name="L"><doc>L-out,R-out,HT-in,HB-in</doc></value>
+ <value value="13" name="L"><doc>L-out,R-out,HT-in,HB-out</doc></value>
+ <value value="14" name="L"><doc>L-out,R-out,HT-out,HB-in</doc></value>
+ <value value="15" name="L"><doc>L-out,R-out,HT-out,HB-out</doc></value>
+ <value value="16" name="T"><doc>T-in,B-in,VL-in,VR-in</doc></value>
+ <value value="17" name="T"><doc>T-in,B-in,VL-in,VR-out</doc></value>
+ <value value="18" name="T"><doc>T-in,B-in,VL,VR-in</doc></value>
+ <value value="19" name="T"><doc>T-in,B-in,VL-out,VR-out</doc></value>
+ <value value="20" name="T"><doc>T-out,B-in,VL-in,VR-in</doc></value>
+ <value value="21" name="T"><doc>T-out,B-in,VL-in,VR-out</doc></value>
+ <value value="22" name="T"><doc>T-out,B-in,VL-out,VR-in</doc></value>
+ <value value="23" name="T"><doc>T-out,B-in,VL-out,VR-out</doc></value>
+ <value value="24" name="T"><doc>T-in,B-out,VL-in,VR-in</doc></value>
+ <value value="25" name="T"><doc>T-in,B-out,VL-in,VR-out</doc></value>
+ <value value="26" name="T"><doc>T-in,B-out,VL-out,VR-in</doc></value>
+ <value value="27" name="T"><doc>T-in,B-out,VL-out,VR-out</doc></value>
+ <value value="28" name="T"><doc>T-out,B-out,VL-in,VR-in</doc></value>
+ <value value="29" name="T"><doc>T-out,B-out,VL-in,VR-out</doc></value>
+ <value value="30" name="T"><doc>T-out,B-out,VL-out,VR-in</doc></value>
+ <value value="31" name="T"><doc>T-out,B-out,VL-out,VR-out</doc></value>
+</enum>
+<enum name="ENUM60">
+ <value value="0" name="L"><doc>L-in,R-in,HT-in,HB-in</doc></value>
+ <value value="1" name="L"><doc>L-in,R-in,HT-in,HB-out</doc></value>
+ <value value="2" name="L"><doc>L-in,R-in,HT-out,HB-in</doc></value>
+ <value value="3" name="L"><doc>L-in,R-in,HT-out,HB-out</doc></value>
+ <value value="4" name="L"><doc>L-in,R-out,HT-in,HB-in</doc></value>
+ <value value="5" name="L"><doc>L-in,R-out,HT-in,HB-out</doc></value>
+ <value value="6" name="L"><doc>L-in,R-out,HT-out,HB-in</doc></value>
+ <value value="7" name="L"><doc>L-in,R-out,HT-out,HB-out</doc></value>
+ <value value="8" name="L"><doc>L-out,R-in,HT-in,HB-in</doc></value>
+ <value value="9" name="L"><doc>L-out,R-in,HT-in,HB-out</doc></value>
+ <value value="10" name="L"><doc>L-out,R-in,HT-out,HB-in</doc></value>
+ <value value="11" name="L"><doc>L-out,R-in,HT-out,HB-out</doc></value>
+ <value value="12" name="L"><doc>L-out,R-out,HT-in,HB-in</doc></value>
+ <value value="13" name="L"><doc>L-out,R-out,HT-in,HB-out</doc></value>
+ <value value="14" name="L"><doc>L-out,R-out,HT-out,HB-in</doc></value>
+ <value value="15" name="L"><doc>L-out,R-out,HT-out,HB-out</doc></value>
+ <value value="16" name="T"><doc>T-in,B-in,VL-in,VR-in</doc></value>
+ <value value="17" name="T"><doc>T-in,B-in,VL-in,VR-out</doc></value>
+ <value value="18" name="T"><doc>T-in,B-in,VL,VR-in</doc></value>
+ <value value="19" name="T"><doc>T-in,B-in,VL-out,VR-out</doc></value>
+ <value value="20" name="T"><doc>T-in,B-out,VL-in,VR-in</doc></value>
+ <value value="21" name="T"><doc>T-in,B-out,VL-in,VR-out</doc></value>
+ <value value="22" name="T"><doc>T-in,B-out,VL-out,VR-in</doc></value>
+ <value value="23" name="T"><doc>T-in,B-out,VL-out,VR-out</doc></value>
+ <value value="24" name="T"><doc>T-out,B-in,VL-in,VR-in</doc></value>
+ <value value="25" name="T"><doc>T-out,B-in,VL-in,VR-out</doc></value>
+ <value value="26" name="T"><doc>T-out,B-in,VL-out,VR-in</doc></value>
+ <value value="27" name="T"><doc>T-out,B-in,VL-out,VR-out</doc></value>
+ <value value="28" name="T"><doc>T-out,B-out,VL-in,VR-in</doc></value>
+ <value value="29" name="T"><doc>T-out,B-out,VL-in,VR-out</doc></value>
+ <value value="30" name="T"><doc>T-out,B-out,VL-out,VR-in</doc></value>
+ <value value="31" name="T"><doc>T-out,B-out,VL-out,VR-out</doc></value>
+</enum>
+<enum name="TX_FILTER_CLAMP">
+ <value value="0" name="WRAP"><doc>Wrap (repeat)</doc></value>
+ <value value="1" name="MIRROR"><doc>Mirror</doc></value>
+ <value value="2" name="CLAMP_TO_LAST_TEXEL"><doc>Clamp to last texel (0.0 to 1.0)</doc></value>
+ <value value="3" name="MIRRORONCE_TO_LAST_TEXEL"><doc>MirrorOnce to last texel (-1.0 to 1.0)</doc></value>
+ <value value="4" name="CLAMP_HALF_WAY_TO_BORDER_COLOR"><doc>Clamp half way to border color (0.0 to 1.0)</doc></value>
+ <value value="5" name="MIRRORONCE_HALF_WAY_TO_BORDER_COLOR"><doc>MirrorOnce half way to border color (-1.0 to 1.0)</doc></value>
+ <value value="6" name="CLAMP_TO_BORDER_COLOR"><doc>Clamp to border color (0.0 to 1.0)</doc></value>
+ <value value="7" name="MIRRORONCE_TO_BORDER_COLOR"><doc>MirrorOnce to border color (-1.0 to 1.0)</doc></value>
+</enum>
+<enum name="TX_R300MINMAG_FILTER">
+ <value value="1" name="POINT"><doc>Point</doc></value>
+ <value value="2" name="LINEAR"><doc>Linear</doc></value>
+</enum>
+<enum name="TX_FILTER">
+ <value value="0" name="NONE"><doc>None</doc></value>
+ <value value="1" name="POINT"><doc>Point</doc></value>
+ <value value="2" name="LINEAR"><doc>Linear</doc></value>
+</enum>
+<enum name="CHROMA_KEY">
+ <value value="0" name="DISABLE"><doc>Disable</doc></value>
+ <value value="1" name="CHROMAKEY"><doc>ChromaKey (kill pixel if any sample matches chroma key)</doc></value>
+ <value value="2" name="CHROMAKEYBLEND"><doc>ChromaKeyBlend (set sample to 0 if it matches chroma key)</doc></value>
+</enum>
+<enum name="BILINEAR_ROUNDING">
+ <value value="0" name="NORMAL"><doc>Normal rounding on all components (+0.5)</doc></value>
+ <value value="1" name="MPEG4"><doc>MPEG4 rounding on all components (+0.25)</doc></value>
+</enum>
+<enum name="MPEG_TRUNC_MODE">
+ <value value="0" name="DISABLE"><doc>Dont truncate coordinate fractions.</doc></value>
+ <value value="1" name="TRUNCATE"><doc>Truncate coordinate fractions to 0.0 and 0.5 for MPEG</doc></value>
+</enum>
+<enum name="TXWIDTH_OR_PITCH">
+ <value value="0" name="TXWIDTH"><doc>Use TXWIDTH for image addressing</doc></value>
+ <value value="1" name="TXPITCH"><doc>Use TXPITCH for image addressing</doc></value>
+</enum>
+<enum name="YUV_TO_RGB_MODE">
+ <value value="0" name="DISABLE"><doc>Disable YUV to RGB conversion</doc></value>
+ <value value="1" name="ENABLE_CLAMP"><doc>Enable YUV to RGB conversion (with clamp)</doc></value>
+ <value value="2" name="ENABLE"><doc>Enable YUV to RGB conversion (without clamp)</doc></value>
+</enum>
+<enum name="COORD_TYPE">
+ <value value="0" name="2D" />
+ <value value="1" name="3D" />
+ <value value="2" name="CUBE" />
+</enum>
+<enum name="TEXCACHE">
+ <value value="0" name="WHOLE"><doc>WHOLE</doc></value>
+ <value value="2" name="HALF_REGION_0"><doc>HALF_REGION_0</doc></value>
+ <value value="3" name="HALF_REGION_1"><doc>HALF_REGION_1</doc></value>
+ <value value="4" name="FOURTH_REGION_0"><doc>FOURTH_REGION_0</doc></value>
+ <value value="5" name="FOURTH_REGION_1"><doc>FOURTH_REGION_1</doc></value>
+ <value value="6" name="FOURTH_REGION_2"><doc>FOURTH_REGION_2</doc></value>
+ <value value="7" name="FOURTH_REGION_3"><doc>FOURTH_REGION_3</doc></value>
+ <value value="8" name="EIGHTH_REGION_0"><doc>EIGHTH_REGION_0</doc></value>
+ <value value="9" name="EIGHTH_REGION_1"><doc>EIGHTH_REGION_1</doc></value>
+ <value value="10" name="EIGHTH_REGION_2"><doc>EIGHTH_REGION_2</doc></value>
+ <value value="11" name="EIGHTH_REGION_3"><doc>EIGHTH_REGION_3</doc></value>
+ <value value="12" name="EIGHTH_REGION_4"><doc>EIGHTH_REGION_4</doc></value>
+ <value value="13" name="EIGHTH_REGION_5"><doc>EIGHTH_REGION_5</doc></value>
+ <value value="14" name="EIGHTH_REGION_6"><doc>EIGHTH_REGION_6</doc></value>
+ <value value="15" name="EIGHTH_REGION_7"><doc>EIGHTH_REGION_7</doc></value>
+ <value value="16" name="SIXTEENTH_REGION_0"><doc>SIXTEENTH_REGION_0</doc></value>
+ <value value="17" name="SIXTEENTH_REGION_1"><doc>SIXTEENTH_REGION_1</doc></value>
+ <value value="18" name="SIXTEENTH_REGION_2"><doc>SIXTEENTH_REGION_2</doc></value>
+ <value value="19" name="SIXTEENTH_REGION_3"><doc>SIXTEENTH_REGION_3</doc></value>
+ <value value="20" name="SIXTEENTH_REGION_4"><doc>SIXTEENTH_REGION_4</doc></value>
+ <value value="21" name="SIXTEENTH_REGION_5"><doc>SIXTEENTH_REGION_5</doc></value>
+ <value value="22" name="SIXTEENTH_REGION_6"><doc>SIXTEENTH_REGION_6</doc></value>
+ <value value="23" name="SIXTEENTH_REGION_7"><doc>SIXTEENTH_REGION_7</doc></value>
+ <value value="24" name="SIXTEENTH_REGION_8"><doc>SIXTEENTH_REGION_8</doc></value>
+ <value value="25" name="SIXTEENTH_REGION_9"><doc>SIXTEENTH_REGION_9</doc></value>
+ <value value="26" name="SIXTEENTH_REGION_A"><doc>SIXTEENTH_REGION_A</doc></value>
+ <value value="27" name="SIXTEENTH_REGION_B"><doc>SIXTEENTH_REGION_B</doc></value>
+ <value value="28" name="SIXTEENTH_REGION_C"><doc>SIXTEENTH_REGION_C</doc></value>
+ <value value="29" name="SIXTEENTH_REGION_D"><doc>SIXTEENTH_REGION_D</doc></value>
+ <value value="30" name="SIXTEENTH_REGION_E"><doc>SIXTEENTH_REGION_E</doc></value>
+ <value value="31" name="SIXTEENTH_REGION_F"><doc>SIXTEENTH_REGION_F</doc></value>
+</enum>
+<enum name="MACROTILE">
+ <value value="0" name="LINEAR"><doc>2KB page is linear</doc></value>
+ <value value="1" name="TILED"><doc>2KB page is tiled</doc></value>
+</enum>
+<enum name="ALU_ALPHA_SWIZZLE_R300">
+ <value value="0" name="SRC0_R"><doc>src0.r</doc></value>
+ <value value="1" name="SRC0_G"><doc>src0.g</doc></value>
+ <value value="2" name="SRC0_B"><doc>src0.b</doc></value>
+ <value value="3" name="SRC1_R"><doc>src1.r</doc></value>
+ <value value="4" name="SRC1_G"><doc>src1.g</doc></value>
+ <value value="5" name="SRC1_B"><doc>src1.b</doc></value>
+ <value value="6" name="SRC2_R"><doc>src2.r</doc></value>
+ <value value="7" name="SRC2_G"><doc>src2.g</doc></value>
+ <value value="8" name="SRC2_B"><doc>src2.b</doc></value>
+ <value value="9" name="SRC0_A"><doc>src0.a</doc></value>
+ <value value="10" name="SRC1_A"><doc>src1.a</doc></value>
+ <value value="11" name="SRC2_A"><doc>src2.a</doc></value>
+ <value value="12" name="SRCP_R"><doc>srcp.r</doc></value>
+ <value value="13" name="SRCP_G"><doc>srcp.g</doc></value>
+ <value value="14" name="SRCP_B"><doc>srcp.b</doc></value>
+ <value value="15" name="SRCP_A"><doc>srcp.a</doc></value>
+ <value value="16" name="ZERO"><doc>0.0</doc></value>
+ <value value="17" name="ONE"><doc>1.0</doc></value>
+ <value value="18" name="HALF"><doc>0.5</doc></value>
+</enum>
+<enum name="ALU_INPUT_MOD">
+ <value value="0" name="NOP"><doc>Do not modify input</doc></value>
+ <value value="1" name="NEG"><doc>Negate input</doc></value>
+ <value value="2" name="ABS"><doc>Take absolute value of input</doc></value>
+ <value value="3" name="NAB"><doc>Take negative absolute value of input</doc></value>
+</enum>
+<enum name="ENUM99">
+ <value value="0" name="1"><doc>1.0-2.0*A0</doc></value>
+ <value value="1" name="A1"><doc>A1-A0</doc></value>
+ <value value="2" name="A1"><doc>A1+A0</doc></value>
+ <value value="3" name="1"><doc>1.0-A0</doc></value>
+</enum>
+<enum name="ALU_OUTPUT_MOD">
+ <value value="0" name="NONE"><doc>Result</doc></value>
+ <value value="1" name="MUL_2"><doc>Result * 2</doc></value>
+ <value value="2" name="MUL_4"><doc>Result * 4</doc></value>
+ <value value="3" name="MUL_8"><doc>Result * 8</doc></value>
+ <value value="4" name="DIV_2"><doc>Result / 2</doc></value>
+ <value value="5" name="DIV_4"><doc>Result / 4</doc></value>
+ <value value="6" name="DIV_8"><doc>Result / 8</doc></value>
+</enum>
+<enum name="CLAMP_MODE">
+ <value value="0" name="DISABLE"><doc>Do not clamp output.</doc></value>
+ <value value="1" name="CLAMP"><doc>Clamp output to the range [0,1].</doc></value>
+</enum>
+<enum name="WRITE_MASK">
+ <value value="0" name="NONE"><doc>NONE: No not write any output.</doc></value>
+ <value value="1" name="R"><doc>R: Write the red channel only.</doc></value>
+ <value value="2" name="G"><doc>G: Write the green channel only.</doc></value>
+ <value value="3" name="RG"><doc>RG: Write the red and green channels.</doc></value>
+ <value value="4" name="B"><doc>B: Write the blue channel only.</doc></value>
+ <value value="5" name="RB"><doc>RB: Write the red and blue channels.</doc></value>
+ <value value="6" name="GB"><doc>GB: Write the green and blue channels.</doc></value>
+ <value value="7" name="RGB"><doc>RGB: Write the red, green, and blue channels.</doc></value>
+</enum>
+<enum name="ALU_RGB_SWIZZLE_R300">
+ <value value="0" name="SRC0_RGB"><doc>src0.rgb</doc></value>
+ <value value="1" name="SRC0_RRR"><doc>src0.rrr</doc></value>
+ <value value="2" name="SRC0_GGG"><doc>src0.ggg</doc></value>
+ <value value="3" name="SRC0_BBB"><doc>src0.bbb</doc></value>
+ <value value="4" name="SRC1_RGB"><doc>src1.rgb</doc></value>
+ <value value="5" name="SRC1_RRR"><doc>src1.rrr</doc></value>
+ <value value="6" name="SRC1_GGG"><doc>src1.ggg</doc></value>
+ <value value="7" name="SRC1_BBB"><doc>src1.bbb</doc></value>
+ <value value="8" name="SRC2_RGB"><doc>src2.rgb</doc></value>
+ <value value="9" name="SRC2_RRR"><doc>src2.rrr</doc></value>
+ <value value="10" name="SRC2_GGG"><doc>src2.ggg</doc></value>
+ <value value="11" name="SRC2_BBB"><doc>src2.bbb</doc></value>
+ <value value="12" name="SRC0_AAA"><doc>src0.aaa</doc></value>
+ <value value="13" name="SRC1_AAA"><doc>src1.aaa</doc></value>
+ <value value="14" name="SRC2_AAA"><doc>src2.aaa</doc></value>
+ <value value="15" name="SRCP_RGB"><doc>srcp.rgb</doc></value>
+ <value value="16" name="SRCP_RRR"><doc>srcp.rrr</doc></value>
+ <value value="17" name="SRCP_GGG"><doc>srcp.ggg</doc></value>
+ <value value="18" name="SRCP_BBB"><doc>srcp.bbb</doc></value>
+ <value value="19" name="SRCP_AAA"><doc>srcp.aaa</doc></value>
+ <value value="20" name="ZERO"><doc>0.0</doc></value>
+ <value value="21" name="ONE"><doc>1.0</doc></value>
+ <value value="22" name="HALF"><doc>0.5</doc></value>
+ <value value="23" name="SRC0_GBR"><doc>src0.gbr</doc></value>
+ <value value="24" name="SRC1_GBR"><doc>src1.gbr</doc></value>
+ <value value="25" name="SRC2_GBR"><doc>src2.gbr</doc></value>
+ <value value="26" name="SRC0_BRG"><doc>src0.brg</doc></value>
+ <value value="27" name="SRC1_BRG"><doc>src1.brg</doc></value>
+ <value value="28" name="SRC2_BRG"><doc>src2.brg</doc></value>
+ <value value="29" name="SRC0_ABG"><doc>src0.abg</doc></value>
+ <value value="30" name="SRC1_ABG"><doc>src1.abg</doc></value>
+ <value value="31" name="SRC2_ABG"><doc>src2.abg</doc></value>
+</enum>
+<enum name="ENUM105">
+ <value value="0" name="1"><doc>1.0-2.0*RGB0</doc></value>
+ <value value="1" name="RGB1"><doc>RGB1-RGB0</doc></value>
+ <value value="2" name="RGB1"><doc>RGB1+RGB0</doc></value>
+ <value value="3" name="1"><doc>1.0-RGB0</doc></value>
+</enum>
+<enum name="COLOR_FORMAT">
+ <value value="0" name="C4_8"><doc>C4_8 (S/U)</doc></value>
+ <value value="1" name="C4_10"><doc>C4_10 (U)</doc></value>
+ <value value="2" name="C4_10_GAMMA"><doc>C4_10_GAMMA - (U)</doc></value>
+ <value value="3" name="C_16"><doc>C_16 - (S/U)</doc></value>
+ <value value="4" name="C2_16"><doc>C2_16 - (S/U)</doc></value>
+ <value value="5" name="C4_16"><doc>C4_16 - (S/U)</doc></value>
+ <value value="6" name="C_16_MPEG"><doc>C_16_MPEG - (S)</doc></value>
+ <value value="7" name="C2_16_MPEG"><doc>C2_16_MPEG - (S)</doc></value>
+ <value value="8" name="C2_4"><doc>C2_4 - (U)</doc></value>
+ <value value="9" name="C_3_3_2"><doc>C_3_3_2 - (U)</doc></value>
+ <value value="10" name="C_6_5_6"><doc>C_6_5_6 - (S/U)</doc></value>
+ <value value="11" name="C_11_11_10"><doc>C_11_11_10 - (S/U)</doc></value>
+ <value value="12" name="C_10_11_11"><doc>C_10_11_11 - (S/U)</doc></value>
+ <value value="13" name="C_2_10_10_10"><doc>C_2_10_10_10 - (S/U)</doc></value>
+ <value value="15" name="UNUSED"><doc>UNUSED - Render target is not used</doc></value>
+ <value value="16" name="C_16_FP"><doc>C_16_FP - (S10E5)</doc></value>
+ <value value="17" name="C2_16_FP"><doc>C2_16_FP - (S10E5)</doc></value>
+ <value value="18" name="C4_16_FP"><doc>C4_16_FP - (S10E5)</doc></value>
+ <value value="19" name="C_32_FP"><doc>C_32_FP - (S23E8)</doc></value>
+ <value value="20" name="C2_32_FP"><doc>C2_32_FP - (S23E8)</doc></value>
+ <value value="21" name="C4_32_FP"><doc>C4_32_FP - (S23E8)</doc></value>
+</enum>
+<enum name="CHANNEL_ARGB">
+ <value value="0" name="ALPHA"><doc>Alpha</doc></value>
+ <value value="1" name="RED"><doc>Red</doc></value>
+ <value value="2" name="GREEN"><doc>Green</doc></value>
+ <value value="3" name="BLUE"><doc>Blue</doc></value>
+</enum>
+<enum name="CHANNEL_RGBA">
+ <value value="0" name="RED"><doc>Red</doc></value>
+ <value value="1" name="GREEN"><doc>Green</doc></value>
+ <value value="2" name="BLUE"><doc>Blue</doc></value>
+ <value value="3" name="ALPHA"><doc>Alpha</doc></value>
+</enum>
+<enum name="WSRC">
+ <value value="0" name="WSRC_US"><doc>WSRC_US - W comes from shader instruction</doc></value>
+ <value value="1" name="WSRC_RAS"><doc>WSRC_RAS - W comes from rasterizer</doc></value>
+</enum>
+<enum name="CLIP_SPACE">
+ <value value="0" name="GL"><doc>-W &lt; X &lt; W, -W &lt; Y &lt; W, -W &lt; Z &lt; W (OpenGL Definition)</doc></value>
+ <value value="1" name="D3D"><doc>-W &lt; X &lt; W, -W &lt; Y &lt; W, 0 &lt; Z &lt; W (DirectX Definition)</doc></value>
+</enum>
+<enum name="PRIM_TYPE">
+ <value value="0" name="NONE"><doc>None (will not trigger Setup Engine to run)</doc></value>
+ <value value="1" name="POINT_LIST"><doc>Point List</doc></value>
+ <value value="2" name="LINE_LIST"><doc>Line List</doc></value>
+ <value value="3" name="LINE_STRIP"><doc>Line Strip</doc></value>
+ <value value="4" name="TRIANGLE_LIST"><doc>Triangle List</doc></value>
+ <value value="5" name="TRIANGLE_FAN"><doc>Triangle Fan</doc></value>
+ <value value="6" name="TRIANGLE_STRIP"><doc>Triangle Strip</doc></value>
+ <value value="7" name="TRIANGLE_WITH_WFLAGS"><doc>Triangle with wFlags (aka, Rage128 'Type-2' triangles) * 8-</doc></value>
+ <value value="11" name="UNUSED"><doc>Unused</doc></value>
+ <value value="12" name="LINE_LOOP"><doc>Line Loop</doc></value>
+ <value value="13" name="QUAD_LIST"><doc>Quad List</doc></value>
+ <value value="14" name="QUAD_STRIP"><doc>Quad Strip</doc></value>
+ <value value="15" name="POLYGON"><doc>Polygon *Encoding 7 indicates whether a 16-bit word of wFlags is present in the stream of indices arriving when the VTX_AMODE is programmed as a '0'. The Setup Engine just steps over the wFlags word; ignoring it. 0 = Stream contains just indices, as: [ Index1, Index0] [ Index3, Index2] [ Index5, Index4 ] etc... 1 = Stream contains indices and wFlags: [ Index1, Index0] [ wFlags,Index 2 ] [ Index4, Index3] [ wFlags, Index5 ] etc...</doc></value>
+</enum>
+<enum name="VERTEX_DATA_PASS_MODE">
+ <value value="0" name="STATE"><doc>State-Based Vertex Data. (Vertex data and tokens embedded in command stream.)</doc></value>
+ <value value="1" name="INDEXES"><doc>Indexes (Indices embedded in command stream; vertex data to be fetched from memory.)</doc></value>
+ <value value="2" name="VERTEX_LIST"><doc>Vertex List (Vertex data to be fetched from memory.)</doc></value>
+ <value value="3" name="VERTEX_DATA"><doc>Vertex Data (Vertex data embedded in command stream.)</doc></value>
+</enum>
+<enum name="COLOR_SELECT">
+ <value value="0" name="THIS"><doc>Select this color</doc></value>
+ <value value="1" name="USER_0"><doc>Select User Color 0</doc></value>
+ <value value="2" name="USER_1"><doc>Select User Color 1</doc></value>
+</enum>
+<enum name="ENUM127">
+ <value value="0" name="USER_COLOR_0_STATE_IS_NOT_UPDATED_WHEN_USER_COLOR_0_IS_WRITTEN"><doc>User Color 0 State is NOT updated when User Color 0 is written.</doc></value>
+ <value value="1" name="USER_COLOR_1_STATE_IS_UPDATED_WHEN_USER_COLOR_0_IS_WRITTEN"><doc>User Color 1 State IS updated when User Color 0 is written.</doc></value>
+</enum>
+<enum name="HZ_UPDATE_VAL">
+ <value value="0" name="MAX"><doc>Update Hierarchical Z with Max value</doc></value>
+ <value value="1" name="MIN"><doc>Update Hierarchical Z with Min value</doc></value>
+</enum>
+<enum name="ENUM130">
+ <value value="0" name="Z_UNIT_CACHE_CONTROLLER_DOES_RMW"><doc>Z unit cache controller does RMW</doc></value>
+ <value value="1" name="Z_UNIT_CACHE_CONTROLLER_DOES_CACHE"><doc>Z unit cache controller does cache-line granular Write only</doc></value>
+</enum>
+<enum name="DSFORMAT">
+ <value value="0" name="16Z"><doc>16-bit Integer Z</doc></value>
+ <value value="1" name="16Z_13E3"><doc>16-bit compressed 13E3</doc></value>
+ <value value="2" name="24Z_8S"><doc>24-bit Integer Z, 8 bit Stencil (LSBs)</doc></value>
+</enum>
+<enum name="STENCILFAIL_VAL">
+ <value value="0" name="KEEP"><doc>Keep: New value = Old value</doc></value>
+ <value value="1" name="ZERO"><doc>Zero: New value = 0</doc></value>
+ <value value="2" name="REPLACE"><doc>Replace: New value = STENCILREF</doc></value>
+ <value value="3" name="INCREMENT_CLAMP"><doc>Increment: New value++ (clamp)</doc></value>
+ <value value="4" name="DECREMENT_CLAMP"><doc>Decrement: New value-- (clamp)</doc></value>
+ <value value="5" name="INVERT"><doc>Invert new value: New value = !Old value</doc></value>
+ <value value="6" name="INCREMENT"><doc>Increment: New value++ (wrap)</doc></value>
+ <value value="7" name="DECREMENT"><doc>Decrement: New value-- (wrap)</doc></value>
+</enum>
+<enum name="CSQ_MODE">
+ <value value="0" name="PIO" />
+ <value value="1" name="BM" />
+</enum>
+<enum name="VP_ADDR_MODE">
+ <value value="0" name="PHYSICAL"><doc>Physical (Default)</doc></value>
+ <value value="1" name="VIRTUAL"><doc>Virtual</doc></value>
+</enum>
+<enum name="FIFO_SIZE">
+ <value value="0" name="FULL"><doc>Full size</doc></value>
+ <value value="1" name="HALF"><doc>1/2 size</doc></value>
+ <value value="2" name="FOURTH"><doc>1/4 size</doc></value>
+ <value value="3" name="EIGHTH"><doc>1/8 size</doc></value>
+</enum>
+<enum name="COLOR_TEX_OVERRIDE">
+ <value value="0" name="DISABLE"><doc>No override</doc></value>
+ <value value="1" name="TEXTURE0"><doc>Stuff texture 0</doc></value>
+ <value value="2" name="TEXTURE1"><doc>Stuff texture 1</doc></value>
+ <value value="3" name="TEXTURE2"><doc>Stuff texture 2</doc></value>
+ <value value="4" name="TEXTURE3"><doc>Stuff texture 3</doc></value>
+ <value value="5" name="TEXTURE4"><doc>Stuff texture 4</doc></value>
+ <value value="6" name="TEXTURE5"><doc>Stuff texture 5</doc></value>
+ <value value="7" name="TEXTURE6"><doc>Stuff texture 6</doc></value>
+ <value value="8" name="TEXTURE7"><doc>Stuff texture 7</doc></value>
+ <value value="9" name="TEXTURE8_C2"><doc>Stuff texture 8/C2</doc></value>
+ <value value="10" name="TEXTURE9_C3"><doc>Stuff texture 9/C3</doc></value>
+</enum>
+<enum name="TEX_COORD_SRC">
+ <value value="0" name="VAP"><doc>Replicate VAP source texture coordinates (S,T,[R,Q]).</doc></value>
+ <value value="1" name="SOURCE_ST"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="SOURCE_STR"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+</enum>
+<enum name="ENUM177">
+ <value value="0" name="NOT_ACTIVE"><doc>Not active</doc></value>
+ <value value="1" name="1_COMPONENT"><doc>1 component (VAP/GA), 2 component (GA/SU)</doc></value>
+ <value value="2" name="2_COMPONENT"><doc>2 component (VAP/GA), 2 component (GA/SU)</doc></value>
+ <value value="3" name="3_COMPONENT"><doc>3 component (VAP/GA), 3 component (GA/SU)</doc></value>
+ <value value="4" name="4_COMPONENT"><doc>4 component (VAP/GA), 4 component (GA/SU)</doc></value>
+</enum>
+<enum name="TX_FILTER_R500">
+ <value value="0" name="FILTER4"><doc>Filter4</doc></value>
+ <value value="1" name="POINT"><doc>Point</doc></value>
+ <value value="2" name="LINEAR"><doc>Linear</doc></value>
+</enum>
+<enum name="TEXEL_SIGNATION">
+ <value value="0" name="UNSIGNED"><doc>Component filter should interpret texel data as unsigned</doc></value>
+ <value value="1" name="SIGNED"><doc>Component filter should interpret texel data as signed</doc></value>
+</enum>
+<enum name="SEL_OPERAND">
+ <value value="0" name="SRC0"><doc>src0</doc></value>
+ <value value="1" name="SRC1"><doc>src1</doc></value>
+ <value value="2" name="SRC2"><doc>src2</doc></value>
+ <value value="3" name="SRCP"><doc>srcp</doc></value>
+</enum>
+<enum name="SEL_SRC">
+ <value value="0" name="RED"><doc>Red</doc></value>
+ <value value="1" name="GREEN"><doc>Green</doc></value>
+ <value value="2" name="BLUE"><doc>Blue</doc></value>
+ <value value="3" name="ALPHA"><doc>Alpha</doc></value>
+ <value value="4" name="ZERO"><doc>Zero</doc></value>
+ <value value="5" name="HALF"><doc>Half</doc></value>
+ <value value="6" name="ONE"><doc>One</doc></value>
+ <value value="7" name="UNUSED"><doc>Unused</doc></value>
+</enum>
+<enum name="ALU_ALPHA_OUTPUT_MOD">
+ <value value="0" name="NONE"><doc>Result</doc></value>
+ <value value="1" name="MUL_2"><doc>Result * 2</doc></value>
+ <value value="2" name="MUL_4"><doc>Result * 4</doc></value>
+ <value value="3" name="MUL_8"><doc>Result * 8</doc></value>
+ <value value="4" name="DIV_2"><doc>Result / 2</doc></value>
+ <value value="5" name="DIV_4"><doc>Result / 4</doc></value>
+ <value value="6" name="DIV_8"><doc>Result / 8</doc></value>
+ <value value="7" name="DISABLE"><doc>Disable output modifier and clamping (result is copied exactly; only valid for MIN/MAX/CMP/CND)</doc></value>
+</enum>
+<enum name="ALU_PREDICATE_COMPARE">
+ <value value="0" name="EQUAL"><doc>Predicate == (ALU)</doc></value>
+ <value value="1" name="LESS"><doc>Predicate &lt; (ALU)</doc></value>
+ <value value="2" name="GE"><doc>Predicate &gt;= (ALU)</doc></value>
+ <value value="3" name="NOTEQUAL"><doc>Predicate != (ALU)</doc></value>
+</enum>
+
+<group name="rX00_regs" prepend="R300_">
+ <reg32 name="RB3D_AARESOLVE_OFFSET" access="rw" offset="0x4E80">
+ <doc>Resolve buffer destination address. The cache must be empty before changing this register if the cb is in resolve mode. Unpipelined</doc>
+ <bitfield name="AARESOLVE_OFFSET" high="31" low="5"><doc>256-bit aligned 3D resolve destination offset.</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_AARESOLVE_PITCH" access="rw" offset="0x4E84">
+ <doc>Resolve Buffer Pitch and Tiling Control. The cache must be empty before changing this register if the cb is in resolve mode. Unpipelined</doc>
+ <bitfield name="AARESOLVE_PITCH" high="13" low="1"><doc>3D destination pitch in multiples of 2-pixels.</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_ABLENDCNTL" access="rw" offset="0x4E08">
+ <doc>Alpha Blend Control for Alpha Channel. Pipelined through the blender.</doc>
+ <bitfield name="COMB_FCN" high="14" low="12">
+ <doc>Combine Function , Allows modification of how the SRCBLEND and DESTBLEND are combined.</doc>
+ <use-enum ref="COMBINE_FUNCTION" />
+ </bitfield>
+ <bitfield name="SRCBLEND" high="21" low="16">
+ <doc>Source Blend Function , Alpha blending function (SRC).</doc>
+ <use-enum ref="BLEND_FUNC_SRC" />
+ </bitfield>
+ <bitfield name="DESTBLEND" high="29" low="24">
+ <doc>Destination Blend Function , Alpha blending function (DST).</doc>
+ <use-enum ref="BLEND_FUNC_DEST" />
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_CLRCMP_CLR" access="rw" offset="0x4E20">
+ <doc>Color Compare Color. Stalls the 2d/3d datapath until it is idle. Like RB2D_CLRCMP_CLR, but a separate register is provided to keep 2D and 3D state separate.</doc>
+ </reg32>
+ <reg32 name="RB3D_CLRCMP_FLIPE" access="rw" offset="0x4E1C">
+ <doc>Color Compare Flip. Stalls the 2d/3d datapath until it is idle. Like RB2D_CLRCMP_FLIPE, but a separate register is provided to keep 2D and 3D state separate.</doc>
+ </reg32>
+ <reg32 name="RB3D_CLRCMP_MSK" access="rw" offset="0x4E24">
+ <doc>Color Compare Mask. Stalls the 2d/3d datapath until it is idle. Like RB2D_CLRCMP_CLR, but separate registers provided to keep 2D and 3D state separate.</doc>
+ </reg32>
+ <stripe offset="0x4E28" stride="0x0004" length="4">
+ <reg32 name="RB3D_COLOROFFSET" access="rw" offset="0x0000">
+ <doc>Color Buffer Address Offset of multibuffer 0. Unpipelined.</doc>
+ <bitfield name="COLOROFFSET" high="31" low="5"><doc>256-bit aligned 3D destination offset address. The cache must be empty before this is changed.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="RB3D_DITHER_CTL" access="rw" offset="0x4E50">
+ <doc>Dithering control register. Pipelined through the blender.</doc>
+ <bitfield name="DITHER_MODE" high="1" low="0">
+ <doc>Dither mode</doc>
+ <use-enum ref="DITHER_MODE" />
+ </bitfield>
+ <bitfield name="ALPHA_DITHER_MODE" high="3" low="2"><use-enum ref="DITHER_MODE" /></bitfield>
+ </reg32>
+ <reg32 name="RB3D_DSTCACHE_CTLSTAT" access="rw" offset="0x4E4C">
+ <doc>Destination Color Buffer Cache Control/Status. If the cb is in e2 mode, then a flush or free will not occur upon a write to this register, but a sync will be immediately sent if one is requested. If both DC_FLUSH and DC_FREE are zero but DC_FINISH is one, then a sync will be sent immediately -- the cb will not wait for all the previous operations to complete before sending the sync. Unpipelined except when DC_FINISH and DC_FREE are both set to zero.</doc>
+ <bitfield name="DC_FLUSH" high="1" low="0">
+ <doc>Setting this bit flushes dirty data from the 3D Dst Cache. Unless the DC_FREE bits are also set, the tags in the cache remain valid. A purge is achieved by setting both DC_FLUSH and DC_FREE.</doc>
+ <value value="0" name="NO_EFFECT"><doc>No effect</doc></value>
+ <value value="1" name="NO_EFFECT"><doc>No effect</doc></value>
+ <value value="2" name="FLUSHES_DIRTY_3D_DATA"><doc>Flushes dirty 3D data</doc></value>
+ <value value="3" name="FLUSHES_DIRTY_3D_DATA"><doc>Flushes dirty 3D data</doc></value>
+ </bitfield>
+ <bitfield name="DC_FREE" high="3" low="2">
+ <doc>Setting this bit invalidates the 3D Dst Cache tags. Unless the DC_FLUSH bit is also set, the cache lines are not written to memory. A purge is achieved by setting both DC_FLUSH and DC_FREE.</doc>
+ <value value="0" name="NO_EFFECT"><doc>No effect</doc></value>
+ <value value="1" name="NO_EFFECT"><doc>No effect</doc></value>
+ <value value="2" name="FREE_3D_TAGS"><doc>Free 3D tags</doc></value>
+ <value value="3" name="FREE_3D_TAGS"><doc>Free 3D tags</doc></value>
+ </bitfield>
+ <bitfield name="DC_FINISH" high="4" low="4">
+ <value value="0" name="DO_NOT_SEND_A_FINISH_SIGNAL_TO_THE_CP"><doc>do not send a finish signal to the CP</doc></value>
+ <value value="1" name="SEND_A_FINISH_SIGNAL_TO_THE_CP_AFTER_THE_END_OF_OPERATION"><doc>send a finish signal to the CP after the end of operation</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_ROPCNTL" access="rw" offset="0x4E18">
+ <doc>3D ROP Control. Stalls the 2d/3d datapath until it is idle.</doc>
+ <bitfield name="ROP_ENABLE" high="2" low="2"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="ROP" high="11" low="8"><doc>ROP2 code for 3D fragments. This value is replicated into 2 nibbles to form the equivalent ROP3 code to control the ROP3 logic. These are the GDI ROP2 codes.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_DEPTH_SRC" access="rw" offset="0x4BD8">
+ <doc>Where does depth come from?</doc>
+ <bitfield name="DEPTH_SRC" high="0" low="0">
+ <value value="0" name="DEPTH_COMES_FROM_SCAN_CONVERTER_AS_PLANE_EQUATION"><doc>Depth comes from scan converter as plane equation.</doc></value>
+ <value value="1" name="DEPTH_COMES_FROM_SHADER_AS_FOUR_DISCRETE_VALUES"><doc>Depth comes from shader as four discrete values.</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_BLEND" access="rw" offset="0x4BC0">
+ <doc>Fog Blending Enable</doc>
+ <bitfield name="ENABLE" high="0" low="0">
+ <doc>Enable for fog blending</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="FN" high="2" low="1">
+ <doc>Fog generation function</doc>
+ <value value="0" name="FOG_FUNCTION_IS_LINEAR"><doc>Fog function is linear</doc></value>
+ <value value="1" name="FOG_FUNCTION_IS_EXPONENTIAL"><doc>Fog function is exponential</doc></value>
+ <value value="2" name="FOG_FUNCTION_IS_EXPONENTIAL_SQUARED"><doc>Fog function is exponential squared</doc></value>
+ <value value="3" name="FOG_IS_DERIVED_FROM_CONSTANT_FOG_FACTOR"><doc>Fog is derived from constant fog factor</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_COLOR_CONTROL" access="rw" offset="0x4278">
+ <doc>Specifies per RGB or Alpha shading method.</doc>
+ <bitfield name="RGB0_SHADING" high="1" low="0">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="ALPHA0_SHADING" high="3" low="2">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="RGB1_SHADING" high="5" low="4">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="ALPHA1_SHADING" high="7" low="6">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="RGB2_SHADING" high="9" low="8">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="ALPHA2_SHADING" high="11" low="10">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="RGB3_SHADING" high="13" low="12">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="ALPHA3_SHADING" high="15" low="14">
+ <doc>Specifies solid, flat or Gouraud shading.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="PROVOKING_VERTEX" high="17" low="16">
+ <doc>Specifies, for flat shaded polygons, which vertex holds the polygon color.</doc>
+ <value value="0" name="PROVOKING_IS_FIRST_VERTEX"><doc>Provoking is first vertex</doc></value>
+ <value value="1" name="PROVOKING_IS_SECOND_VERTEX"><doc>Provoking is second vertex</doc></value>
+ <value value="2" name="PROVOKING_IS_THIRD_VERTEX"><doc>Provoking is third vertex</doc></value>
+ <value value="3" name="PROVOKING_IS_ALWAYS_LAST_VERTEX"><doc>Provoking is always last vertex</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_FOG_OFFSET" access="rw" offset="0x4298">
+ <doc>Specifies the offset to apply to fog. 32b SPFP scale value.</doc>
+ </reg32>
+ <reg32 name="GA_FOG_SCALE" access="rw" offset="0x4294">
+ <doc>Specifies the scale to apply to fog. 32b SPFP scale value.</doc>
+ </reg32>
+ <reg32 name="GA_LINE_S0" access="rw" offset="0x4264">
+ <doc>S Texture Coordinate Value for Vertex 0 of Line (stuff textures -- i.e. AA). S texture coordinate value generated for vertex 0 of an antialiased line; 32-bit IEEE float format. Typical 0.0.</doc>
+ </reg32>
+ <reg32 name="GA_LINE_S1" access="rw" offset="0x4268">
+ <doc>S Texture Coordinate Value for Vertex 1 of Lines (V2 of parallelogram -- stuff textures -- i.e. AA). S texture coordinate value generated for vertex 1 of an antialiased line; 32-bit IEEE float format. Typical 1.0.</doc>
+ </reg32>
+ <reg32 name="GA_LINE_STIPPLE_CONFIG" access="rw" offset="0x4238">
+ <doc>Line Stipple configuration information.</doc>
+ <bitfield name="LINE_RESET" high="1" low="0">
+ <doc>Specify type of reset to use for stipple accumulation.</doc>
+ <value value="0" name="NO_RESETING"><doc>No reseting</doc></value>
+ <value value="1" name="RESET_PER_LINE"><doc>Reset per line</doc></value>
+ <value value="2" name="RESET_PER_PACKET"><doc>Reset per packet</doc></value>
+ </bitfield>
+ <bitfield name="STIPPLE_SCALE" high="31" low="2"><doc>Specifies, in truncated (30b) floating point, scale to apply to generated texture coordinates.</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_POINT_MINMAX" access="rw" offset="0x4230">
+ <doc>Specifies maximum and minimum point &amp; sprite sizes for per vertex size specification.</doc>
+ <bitfield name="MIN_SIZE" high="15" low="0"><doc>Minimum point &amp; sprite radius (in subsamples) size to allow.</doc></bitfield>
+ <bitfield name="MAX_SIZE" high="31" low="16"><doc>Maximum point &amp; sprite radius (in subsamples) size to allow.</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_POINT_S0" access="rw" offset="0x4200">
+ <doc>S Texture Coordinate of Vertex 0 for Point texture stuffing (LLC). S texture coordinate of vertex 0 for point; 32-bit IEEE float format.</doc>
+ </reg32>
+ <reg32 name="GA_POINT_S1" access="rw" offset="0x4208">
+ <doc>S Texture Coordinate of Vertex 2 for Point texture stuffing (URC). S texture coordinate of vertex 2 for point; 32-bit IEEE float format.</doc>
+ </reg32>
+ <reg32 name="GA_POINT_T0" access="rw" offset="0x4204">
+ <doc>T Texture Coordinate of Vertex 0 for Point texture stuffing (LLC). T texture coordinate of vertex 0 for point; 32-bit IEEE float format.</doc>
+ </reg32>
+ <reg32 name="GA_POINT_T1" access="rw" offset="0x420C">
+ <doc>T Texture Coordinate of Vertex 2 for Point texture stuffing (URC). T texture coordinate of vertex 2 for point; 32-bit IEEE float format.</doc>
+ </reg32>
+ <reg32 name="GA_POLY_MODE" access="rw" offset="0x4288">
+ <doc>Polygon Mode</doc>
+ <bitfield name="POLY_MODE" high="1" low="0">
+ <doc>Polygon mode enable.</doc>
+ <value value="0" name="DISABLE_POLY_MODE"><doc>Disable poly mode (render triangles).</doc></value>
+ <value value="1" name="DUAL_MODE"><doc>Dual mode (send 2 sets of 3 polys with specified poly type).</doc></value>
+ </bitfield>
+ <bitfield name="FRONT_PTYPE" high="6" low="4">
+ <doc>Specifies how to render front-facing polygons.</doc>
+ <use-enum ref="POLY_DRAW_TYPE" />
+ </bitfield>
+ <bitfield name="BACK_PTYPE" high="9" low="7">
+ <doc>Specifies how to render back-facing polygons.</doc>
+ <use-enum ref="POLY_DRAW_TYPE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_TRIANGLE_STIPPLE" access="rw" offset="0x4214">
+ <doc>Specifies amount to shift integer position of vertex (screen space) before converting to float for triangle stipple.</doc>
+ <bitfield name="X_SHIFT" high="3" low="0"><doc>Amount to shift x position before conversion to SPFP.</doc></bitfield>
+ <bitfield name="Y_SHIFT" high="19" low="16"><doc>Amount to shift y position before conversion to SPFP.</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_AA_CONFIG" access="rw" offset="0x4020">
+ <doc>Specifies the graphics pipeline configuration for antialiasing.</doc>
+ <bitfield name="AA_ENABLE" high="0" low="0">
+ <doc>Enables antialiasing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="NUM_AA_SUBSAMPLES" high="2" low="1">
+ <doc>Specifies the number of subsamples to use while antialiasing.</doc>
+ <value value="0" name="2_SUBSAMPLES"><doc>2 subsamples</doc></value>
+ <value value="1" name="3_SUBSAMPLES"><doc>3 subsamples</doc></value>
+ <value value="2" name="4_SUBSAMPLES"><doc>4 subsamples</doc></value>
+ <value value="3" name="6_SUBSAMPLES"><doc>6 subsamples</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="SC_CLIP_0_A" access="rw" offset="0x43B0">
+ <doc>OpenGL Clip rectangles</doc>
+ <bitfield name="XS0" high="12" low="0"><doc>Left hand edge of clip rectangle</doc></bitfield>
+ <bitfield name="YS0" high="25" low="13"><doc>Upper edge of clip rectangle</doc></bitfield>
+ </reg32>
+ <reg32 name="SC_CLIP_0_B" access="rw" offset="0x43B4">
+ <doc>OpenGL Clip rectangles</doc>
+ <bitfield name="XS1" high="12" low="0"><doc>Right hand edge of clip rectangle</doc></bitfield>
+ <bitfield name="YS1" high="25" low="13"><doc>Lower edge of clip rectangle</doc></bitfield>
+ </reg32>
+ <reg32 name="SC_CLIP_1_A" access="rw" offset="0x43B8" />
+ <reg32 name="SC_CLIP_1_B" access="rw" offset="0x43BC" />
+ <reg32 name="SC_CLIP_2_A" access="rw" offset="0x43C0" />
+ <reg32 name="SC_CLIP_2_B" access="rw" offset="0x43C4" />
+ <reg32 name="SC_CLIP_3_A" access="rw" offset="0x43C8" />
+ <reg32 name="SC_CLIP_3_B" access="rw" offset="0x43CC" />
+ <reg32 name="SC_CLIP_RULE" access="rw" offset="0x43D0">
+ <doc>OpenGL Clip boolean function</doc>
+ <bitfield name="CLIP_RULE" high="15" low="0"><doc>OpenGL Clip boolean function. The 'inside' flags for each of the four clip rectangles form a 4-bit binary number. The corresponding bit in this 16-bit number specifies whether the pixel is visible.</doc></bitfield>
+ </reg32>
+ <reg32 name="SC_HYPERZ_EN" access="rw" offset="0x43A4">
+ <doc>Hierarchical Z Enable</doc>
+ <bitfield name="HZ_EN" high="0" low="0">
+ <doc>Enable for hierarchical Z.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="HZ_MAX" high="1" low="1">
+ <doc>Specifies whether to compute min or max z value</doc>
+ <value value="0" name="HZ_BLOCK_COMPUTES_MINIMUM_Z_VALUE"><doc>HZ block computes minimum z value</doc></value>
+ <value value="1" name="HZ_BLOCK_COMPUTES_MAXIMUM_Z_VALUE"><doc>HZ block computes maximum z value</doc></value>
+ </bitfield>
+ <bitfield name="HZ_ADJ" high="4" low="2">
+ <doc>Specifies adjustment to get added or subtracted from computed z value</doc>
+ <value value="0" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/256 &lt;&lt; ze</doc></value>
+ <value value="1" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/128 &lt;&lt; ze</doc></value>
+ <value value="2" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/64 &lt;&lt; ze</doc></value>
+ <value value="3" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/32 &lt;&lt; ze</doc></value>
+ <value value="4" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/16 &lt;&lt; ze</doc></value>
+ <value value="5" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/8 &lt;&lt; ze</doc></value>
+ <value value="6" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/4 &lt;&lt; ze</doc></value>
+ <value value="7" name="ADD_OR_SUBTRACT_1"><doc>Add or Subtract 1/2 &lt;&lt; ze</doc></value>
+ </bitfield>
+ <bitfield name="HZ_Z0MIN" high="5" low="5">
+ <doc>Specifies whether vertex 0 z contains minimum z value</doc>
+ <value value="0" name="VERTEX_0_DOES_NOT_CONTAIN_MINIMUM_Z_VALUE"><doc>Vertex 0 does not contain minimum z value</doc></value>
+ <value value="1" name="VERTEX_0_DOES_CONTAIN_MINIMUM_Z_VALUE"><doc>Vertex 0 does contain minimum z value</doc></value>
+ </bitfield>
+ <bitfield name="HZ_Z0MAX" high="6" low="6">
+ <doc>Specifies whether vertex 0 z contains maximum z value</doc>
+ <value value="0" name="VERTEX_0_DOES_NOT_CONTAIN_MAXIMUM_Z_VALUE"><doc>Vertex 0 does not contain maximum z value</doc></value>
+ <value value="1" name="VERTEX_0_DOES_CONTAIN_MAXIMUM_Z_VALUE"><doc>Vertex 0 does contain maximum z value</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="SC_SCISSOR0" access="rw" offset="0x43E0">
+ <doc>Scissor rectangle specification</doc>
+ <bitfield name="XS0" high="12" low="0"><doc>Left hand edge of scissor rectangle</doc></bitfield>
+ <bitfield name="YS0" high="25" low="13"><doc>Upper edge of scissor rectangle</doc></bitfield>
+ </reg32>
+ <reg32 name="SC_SCISSOR1" access="rw" offset="0x43E4">
+ <doc>Scissor rectangle specification</doc>
+ <bitfield name="XS1" high="12" low="0"><doc>Right hand edge of scissor rectangle</doc></bitfield>
+ <bitfield name="YS1" high="25" low="13"><doc>Lower edge of scissor rectangle</doc></bitfield>
+ </reg32>
+ <reg32 name="SC_SCREENDOOR" access="rw" offset="0x43E8">
+ <doc>Screen door sample mask</doc>
+ <bitfield name="SCREENDOOR" high="23" low="0"><doc>Screen door sample mask - 1 means sample may be covered, 0 means sample is not covered</doc></bitfield>
+ </reg32>
+ <reg32 name="SU_CULL_MODE" access="rw" offset="0x42B8">
+ <doc>Culling Enables</doc>
+ <bitfield name="CULL_FRONT" high="0" low="0">
+ <doc>Enable for front-face culling.</doc>
+ <value value="0" name="DO_NOT_CULL_FRONT"><doc>Do not cull front-facing triangles.</doc></value>
+ <value value="1" name="CULL_FRONT"><doc>Cull front-facing triangles.</doc></value>
+ </bitfield>
+ <bitfield name="CULL_BACK" high="1" low="1">
+ <doc>Enable for back-face culling.</doc>
+ <value value="0" name="DO_NOT_CULL_BACK"><doc>Do not cull back-facing triangles.</doc></value>
+ <value value="1" name="CULL_BACK"><doc>Cull back-facing triangles.</doc></value>
+ </bitfield>
+ <bitfield name="FACE" high="2" low="2">
+ <doc>X-Ored with cross product sign to determine positive facing</doc>
+ <value value="0" name="POSITIVE_CROSS_PRODUCT_IS_FRONT"><doc>Positive cross product is front (CCW).</doc></value>
+ <value value="1" name="NEGATIVE_CROSS_PRODUCT_IS_FRONT"><doc>Negative cross product is front (CW).</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_DEPTH_OFFSET" access="rw" offset="0x42C4">
+ <doc>SU Depth Offset value. SPFP Floating point applied to depth before conversion to FXP.</doc>
+ </reg32>
+ <reg32 name="SU_DEPTH_SCALE" access="rw" offset="0x42C0">
+ <doc>SU Depth Scale value. SPFP Floating point applied to depth before conversion to FXP.</doc>
+ </reg32>
+ <reg32 name="SU_POLY_OFFSET_BACK_OFFSET" access="rw" offset="0x42B0">
+ <doc>Back-Facing Polygon Offset Offset. Specifies polygon offset offset for back-facing polygons; 32b IEEE float format; applied after Z scale &amp; offset (0 to 2^24-1 range)</doc>
+ </reg32>
+ <reg32 name="SU_POLY_OFFSET_BACK_SCALE" access="rw" offset="0x42AC">
+ <doc>Back-Facing Polygon Offset Scale. Specifies polygon offset scale for back-facing polygons; 32-bit IEEE float format; applied after Z scale &amp; offset (0 to 2^24-1 range); slope computed in subpixels (1/12 or 1/16)</doc>
+ </reg32>
+ <reg32 name="SU_POLY_OFFSET_ENABLE" access="rw" offset="0x42B4">
+ <doc>Enables for polygon offset</doc>
+ <bitfield name="FRONT_ENABLE" high="0" low="0">
+ <doc>Enables front facing polygon's offset.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="BACK_ENABLE" high="1" low="1">
+ <doc>Enables back facing polygon's offset.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="PARA_ENABLE" high="2" low="2">
+ <doc>Forces all parallelograms to have FRONT_FACING for poly offset -- Need to have FRONT_ENABLE also set to have Z offset for parallelograms.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_POLY_OFFSET_FRONT_OFFSET" access="rw" offset="0x42A8">
+ <doc>Front-Facing Polygon Offset Offset. Specifies polygon offset offset for front-facing polygons; 32b IEEE float format; applied after Z scale &amp; offset (0 to 2^24-1 range)</doc>
+ </reg32>
+ <reg32 name="SU_POLY_OFFSET_FRONT_SCALE" access="rw" offset="0x42A4">
+ <doc>Front-Facing Polygon Offset Scale. Specifies polygon offset scale for front-facing polygons; 32b IEEE float format; applied after Z scale &amp; offset (0 to 2^24-1 range); slope computed in subpixels (1/12 or 1/16)</doc>
+ </reg32>
+ <reg32 name="VAP_GB_HORZ_CLIP_ADJ" access="rw" offset="0x2228">
+ <doc>Horizontal Guard Band Clip Adjust Register. 32-bit floating point value. Should be set to 1.0 for no guard band.</doc>
+ </reg32>
+ <reg32 name="VAP_GB_HORZ_DISC_ADJ" access="rw" offset="0x222C">
+ <doc>Horizontal Guard Band Discard Adjust Register. 32-bit floating point value. Should be set to 1.0 for no guard band.</doc>
+ </reg32>
+ <reg32 name="VAP_GB_VERT_CLIP_ADJ" access="rw" offset="0x2220">
+ <doc>Vertical Guard Band Clip Adjust Register. 32-bit floating point value. Should be set to 1.0 for no guard band.</doc>
+ </reg32>
+ <reg32 name="VAP_GB_VERT_DISC_ADJ" access="rw" offset="0x2224">
+ <doc>Vertical Guard Band Discard Adjust Register. 32-bit floating point value. Should be set to 1.0 for no guard band.</doc>
+ </reg32>
+ <reg32 name="VAP_OUT_VTX_FMT_0" access="rw" offset="0x2090">
+ <doc>VAP Out/GA Vertex Format Register 0</doc>
+ <bitfield name="VTX_POS_PRESENT" high="0" low="0"><doc>Output the Position Vector</doc></bitfield>
+ <bitfield name="VTX_COLOR_0_PRESENT" high="1" low="1"><doc>Output Color 0 Vector</doc></bitfield>
+ <bitfield name="VTX_COLOR_1_PRESENT" high="2" low="2"><doc>Output Color 1 Vector</doc></bitfield>
+ <bitfield name="VTX_COLOR_2_PRESENT" high="3" low="3"><doc>Output Color 2 Vector</doc></bitfield>
+ <bitfield name="VTX_COLOR_3_PRESENT" high="4" low="4"><doc>Output Color 3 Vector</doc></bitfield>
+ <bitfield name="VTX_PT_SIZE_PRESENT" high="16" low="16"><doc>Output Point Size Vector</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_OUT_VTX_FMT_1" access="rw" offset="0x2094">
+ <doc>VAP Out/GA Vertex Format Register 1</doc>
+ <bitfield name="TEX_0_COMP_CNT" high="2" low="0"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_1_COMP_CNT" high="5" low="3"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_2_COMP_CNT" high="8" low="6"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_3_COMP_CNT" high="11" low="9"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_4_COMP_CNT" high="14" low="12"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_5_COMP_CNT" high="17" low="15"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_6_COMP_CNT" high="20" low="18"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ <bitfield name="TEX_7_COMP_CNT" high="23" low="21"><doc>Number of words in texture 0 = Not Present 1 = 1 component 2 = 2 components 3 = 3 components 4 = 4 components</doc></bitfield>
+ </reg32>
+ <stripe offset="0x2000" stride="0x0004" length="16">
+ <reg32 name="VAP_PORT_DATA" access="w" offset="0x0000">
+ <doc>Setup Engine Data Port 0 through 15. 1st of 16 consecutive dwords for writing vertex data</doc>
+ </reg32>
+ </stripe>
+ <reg32 name="VAP_PORT_DATA_IDX_128" access="w" offset="0x20B8">
+ <doc>128-bit Data Port for Indexed Primitives. 128-bit Data Port for Indexed Primitives. Write-only.</doc>
+ </reg32>
+ <stripe offset="0x2040" stride="0x0004" length="16">
+ <reg32 name="VAP_PORT_IDX" access="w" offset="0x0000">
+ <doc>Setup Engine Index Port 0 through 15. 1st of 16 consecutive dwords for writing vertex index</doc>
+ </reg32>
+ </stripe>
+ <stripe offset="0x21E0" stride="0x0004" length="8">
+ <reg32 name="VAP_PROG_STREAM_CNTL_EXT" access="rw" offset="0x0000">
+ <doc>Programmable Stream Control Extension Word 0</doc>
+ <bitfield name="SWIZZLE_SELECT_X_0" high="2" low="0"><doc>X-Component Swizzle Select 0 = SELECT_X 1 = SELECT_Y 2 = SELECT_Z 3 = SELECT_W 4 = SELECT_FP_ZERO (Floating Point 0.0) 5 = SELECT_FP_ONE (Floating Point 1.0) 6,7 RESERVED</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_Y_0" high="5" low="3"><doc>Y-Component Swizzle Select (See Above)</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_Z_0" high="8" low="6"><doc>Z-Component Swizzle Select (See Above)</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_W_0" high="11" low="9"><doc>W-Component Swizzle Select (See Above)</doc></bitfield>
+ <bitfield name="WRITE_ENA_0" high="15" low="12"><doc>4-bit write enable. Bit 0 maps to X Bit 1 maps to Y Bit 2 maps to Z Bit 3 maps to W</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_X_1" high="18" low="16"><doc>See SWIZZLE_SELECT_X_0</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_Y_1" high="21" low="19"><doc>See SWIZZLE_SELECT_Y_0</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_Z_1" high="24" low="22"><doc>See SWIZZLE_SELECT_Z_0</doc></bitfield>
+ <bitfield name="SWIZZLE_SELECT_W_1" high="27" low="25"><doc>See SWIZZLE_SELECT_W_0</doc></bitfield>
+ <bitfield name="WRITE_ENA_1" high="31" low="28"><doc>See WRITE_ENA_0</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="VAP_PSC_SGN_NORM_CNTL" access="rw" offset="0x21DC">
+ <doc>Programmable Stream Control Signed Normalize Control</doc>
+ <bitfield name="SGN_NORM_METHOD_0" high="1" low="0">
+ <doc>There are 3 methods of normalizing signed numbers:</doc>
+ <value value="0" name="SGN_NORM_ZERO"><doc>SGN_NORM_ZERO : value / (2^(n-1)-1), so - 128/127 will be less that -1.0, -127/127 will yeild -1.0, 0/127 will yield 0, and 127/127 will yield 1.0 for 8-bit numbers.</doc></value>
+ <value value="1" name="SGN_NORM_ZERO_CLAMP_MINUS_ONE"><doc>SGN_NORM_ZERO_CLAMP_MINUS_ONE: Same as SGN_NORM_ZERO except -128/127 will yield -1.0 for 8-bit numbers.</doc></value>
+ <value value="2" name="SGN_NORM_NO_ZERO"><doc>SGN_NORM_NO_ZERO: (2 * value + 1)/2^n, so - 128 will yield -255/255 = -1.0, 127 will yield 255/255 = 1.0, but 0 will yield 1/255 != 0.</doc></value>
+ </bitfield>
+ <bitfield name="SGN_NORM_METHOD_1" high="3" low="2"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_2" high="5" low="4"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_3" high="7" low="6"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_4" high="9" low="8"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_5" high="11" low="10"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_6" high="13" low="12"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_7" high="15" low="14"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_8" high="17" low="16"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_9" high="19" low="18"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_10" high="21" low="20"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_11" high="23" low="22"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_12" high="25" low="24"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_13" high="27" low="26"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_14" high="29" low="28"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ <bitfield name="SGN_NORM_METHOD_15" high="31" low="30"><doc>See SGN_NORM_METHOD_0</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_PVS_CODE_CNTL_0" access="rw" offset="0x22D0">
+ <doc>Programmable Vertex Shader Code Control Register 0</doc>
+ <bitfield name="PVS_FIRST_INST" high="9" low="0"><doc>First Instruction to Execute in PVS.</doc></bitfield>
+ <bitfield name="PVS_XYZW_VALID_INST" high="19" low="10"><doc>The PVS Instruction which updates the clip coordinate position for the last time. This value is used to lower the processing priority while trivial clip and back-face culling decisions are made. This field must be set to valid instruction.</doc></bitfield>
+ <bitfield name="PVS_LAST_INST" high="29" low="20"><doc>Last Instruction (Inclusive) for the PVS to execute.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_PVS_CODE_CNTL_1" access="rw" offset="0x22D8">
+ <doc>Programmable Vertex Shader Code Control Register 1</doc>
+ <bitfield name="PVS_LAST_VTX_SRC_INST" high="9" low="0"><doc>The PVS Instruction which uses the Input Vertex Memory for the last time. This value is used to free up the Input Vertex Slots ASAP. This field must be set to a valid instruction.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_PVS_CONST_CNTL" access="rw" offset="0x22D4">
+ <doc>Programmable Vertex Shader Constant Control Register</doc>
+ <bitfield name="PVS_CONST_BASE_OFFSET" high="7" low="0"><doc>Vector Offset into PVS constant memory to the start of the constants for the current shader</doc></bitfield>
+ <bitfield name="PVS_MAX_CONST_ADDR" high="23" low="16"><doc>The maximum constant address which should be generated by the shader (Inst Const Addr + Addr Register). If the address which is generated by the shader is outside the range of 0 to PVS_MAX_CONST_ADDR, then (0,0,0,0) is returned as the source operand data.</doc></bitfield>
+ </reg32>
+ <stripe offset="0x2230" stride="0x0004" length="16">
+ <reg32 name="VAP_PVS_FLOW_CNTL_ADDRS" access="rw" offset="0x0000">
+ <doc>Programmable Vertex Shader Flow Control Addresses Register 0</doc>
+ <bitfield name="PVS_FC_ACT_ADRS_0" high="7" low="0"><doc>This field defines the last PVS instruction to execute prior to the control flow redirection. JUMP - The last instruction executed prior to the jump LOOP - The last instruction executed prior to the loop (init loop counter/inc) JSR - The last instruction executed prior to the jump to the subroutine.</doc></bitfield>
+ <bitfield name="PVS_FC_LOOP_CNT_JMP_INST_0" high="15" low="8"><doc>This field has multiple definitions as follows: JUMP - The instruction address to jump to. LOOP - The loop count. *Note loop count of 0 must be replaced by a jump. JSR - The instruction address to jump to (first inst of subroutine).</doc></bitfield>
+ <bitfield name="PVS_FC_LAST_INST_0" high="23" low="16"><doc>This field has multiple definitions as follows: JUMP - Not Applicable LOOP - The last instruction of the loop. JSR - The last instruction of the subroutine.</doc></bitfield>
+ <bitfield name="PVS_FC_RTN_INST_0" high="31" low="24"><doc>This field has multiple definitions as follows: JUMP - Not Applicable LOOP - First Instruction of Loop (Typically ACT_ADRS + 1) JSR - First Instruction After JSR (Typically ACT_ADRS + 1)</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="VAP_PVS_FLOW_CNTL_OPC" access="rw" offset="0x22DC">
+ <doc>Programmable Vertex Shader Flow Control Opcode Register</doc>
+ <bitfield name="PVS_FC_OPC_0" high="1" low="0"><doc>This opcode field determines what type of control flow instruction to execute. 0 = NO_OP 1 = JUMP 2 = LOOP 3 = JSR (Jump to Subroutine)</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_1" high="3" low="2"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_2" high="5" low="4"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_3" high="7" low="6"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_4" high="9" low="8"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_5" high="11" low="10"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_6" high="13" low="12"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_7" high="15" low="14"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_8" high="17" low="16"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_9" high="19" low="18"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_10" high="21" low="20"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_11" high="23" low="22"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_12" high="25" low="24"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_13" high="27" low="26"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_14" high="29" low="28"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ <bitfield name="PVS_FC_OPC_15" high="31" low="30"><doc>See PVS_FC_OPC_0.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_PVS_STATE_FLUSH_REG" access="rw" offset="0x2284">
+ <doc>This register is used to force a flush of the PVS block when single-buffered updates are performed. The multi- state control of PVS Code and Const memories by the driver is primarily for more flexible PVS state control and for performance testing. When this register address is written, the State Block will force a flush of PVS processing so that both versions of PVS state are available before updates are processed. This register is write only, and the data that is written is unused.</doc>
+ </reg32>
+ <reg32 name="VAP_PVS_VECTOR_DATA_REG" access="rw" offset="0x2204">
+ <doc>32-bit data to write to Vector Memory. Used for PVS code and Constant updates.</doc>
+ </reg32>
+ <reg32 name="VAP_PVS_VECTOR_DATA_REG_128" access="w" offset="0x2208">
+ <doc>128-bit data path to write to Vector Memory. Used for PVS code and Constant updates.</doc>
+ </reg32>
+ <reg32 name="VAP_PVS_VECTOR_INDX_REG" access="rw" offset="0x2200">
+ <bitfield name="OCTWORD_OFFSET" high="10" low="0"><doc>Octword offset to begin writing.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_PVS_VTX_TIMEOUT_REG" access="rw" offset="0x2288">
+ <doc>This register is used to define the number of core clocks to wait for a vertex to be received by the VAP input controller (while the primitive path is backed up) before forcing any accumulated vertices to be submitted to the vertex processing path.</doc>
+ </reg32>
+ <reg32 name="VAP_VF_MAX_VTX_INDX" access="rw" offset="0x2134">
+ <doc>Maximum Vertex Indx Clamp</doc>
+ <bitfield name="MAX_INDX" high="23" low="0"><doc>If index to be fetched is larger than this value, the fetch indx is set to MAX_INDX</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VF_MIN_VTX_INDX" access="rw" offset="0x2138">
+ <doc>Minimum Vertex Indx Clamp</doc>
+ <bitfield name="MIN_INDX" high="23" low="0"><doc>If index to be fetched is smaller than this value, the fetch indx is set to MIN_INDX</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VPORT_XOFFSET" access="rw" offset="0x209C">
+ <doc>Viewport Transform X Offset. Viewport Offset for X coordinates. An IEEE float.</doc>
+ </reg32>
+ <reg32 name="VAP_VPORT_XSCALE" access="rw" offset="0x2098">
+ <doc>Viewport Transform X Scale Factor. Viewport Scale Factor for X coordinates. An IEEE float.</doc>
+ </reg32>
+ <reg32 name="VAP_VPORT_YOFFSET" access="rw" offset="0x20A4">
+ <doc>Viewport Transform Y Offset. Viewport Offset for Y coordinates. An IEEE float.</doc>
+ </reg32>
+ <reg32 name="VAP_VPORT_YSCALE" access="rw" offset="0x20A0">
+ <doc>Viewport Transform Y Scale Factor. Viewport Scale Factor for Y coordinates. An IEEE float.</doc>
+ </reg32>
+ <reg32 name="VAP_VPORT_ZOFFSET" access="rw" offset="0x20AC">
+ <doc>Viewport Transform Z Offset. Viewport Offset for Z coordinates. An IEEE float.</doc>
+ </reg32>
+ <reg32 name="VAP_VPORT_ZSCALE" access="rw" offset="0x20A8">
+ <doc>Viewport Transform Z Scale Factor. Viewport Scale Factor for Z coordinates. An IEEE float.</doc>
+ </reg32>
+ <reg32 name="VAP_VTE_CNTL" access="rw" offset="0x20B0">
+ <doc>Viewport Transform Engine Control</doc>
+ <bitfield name="VPORT_X_SCALE_ENA" high="0" low="0"><doc>Viewport Transform Scale Enable for X component</doc></bitfield>
+ <bitfield name="VPORT_X_OFFSET_ENA" high="1" low="1"><doc>Viewport Transform Offset Enable for X component</doc></bitfield>
+ <bitfield name="VPORT_Y_SCALE_ENA" high="2" low="2"><doc>Viewport Transform Scale Enable for Y component</doc></bitfield>
+ <bitfield name="VPORT_Y_OFFSET_ENA" high="3" low="3"><doc>Viewport Transform Offset Enable for Y component</doc></bitfield>
+ <bitfield name="VPORT_Z_SCALE_ENA" high="4" low="4"><doc>Viewport Transform Scale Enable for Z component</doc></bitfield>
+ <bitfield name="VPORT_Z_OFFSET_ENA" high="5" low="5"><doc>Viewport Transform Offset Enable for Z component</doc></bitfield>
+ <bitfield name="VTX_XY_FMT" high="8" low="8"><doc>Indicates that the incoming X, Y have already been multiplied by 1/W0. If OFF, the Setup Engine will bultiply the X, Y coordinates by 1/W0.,</doc></bitfield>
+ <bitfield name="VTX_Z_FMT" high="9" low="9"><doc>Indicates that the incoming Z has already been multiplied by 1/W0. If OFF, the Setup Engine will multiply the Z coordinate by 1/W0.</doc></bitfield>
+ <bitfield name="VTX_W0_FMT" high="10" low="10"><doc>Indicates that the incoming W0 is not 1/W0. If ON, the Setup Engine will perform the reciprocal to get 1/W0.</doc></bitfield>
+ <bitfield name="SERIAL_PROC_ENA" high="11" low="11"><doc>If set, x,y,z viewport transform are performed serially through a single pipeline instead of in parallel. Used to mimic RL300 design.</doc></bitfield>
+ </reg32>
+ <stripe offset="0x20C4" stride="0x000C" length="8">
+ <reg32 name="VAP_VTX_AOS_ATTR" access="rw" offset="0x0000">
+ <doc>Array-of-Structures Attributes 0 &amp; 1</doc>
+ <bitfield name="VTX_AOS_COUNT0" high="6" low="0"><doc>Number of dwords in this structure.</doc></bitfield>
+ <bitfield name="VTX_AOS_STRIDE0" high="14" low="8"><doc>Number of dwords from one array element to the next.</doc></bitfield>
+ <bitfield name="VTX_AOS_COUNT1" high="22" low="16"><doc>Number of dwords in this structure.</doc></bitfield>
+ <bitfield name="VTX_AOS_STRIDE1" high="30" low="24"><doc>Number of dwords from one array element to the next.</doc></bitfield>
+ </reg32>
+ <stripe offset="0x0004" stride="0x0004" length="2">
+ <reg32 name="VAP_VTX_AOS_ADDR" access="rw" offset="0x0000">
+ <doc>Array-of-Structures Address</doc>
+ <bitfield name="VTX_AOS_ADDR" high="31" low="2"><doc>Base Address of the Array of Structures.</doc></bitfield>
+ </reg32>
+ </stripe>
+ </stripe>
+ <reg32 name="VAP_VTX_SIZE" access="rw" offset="0x20B4">
+ <doc>Vertex Size Specification Register</doc>
+ <bitfield name="DWORDS_PER_VTX" high="6" low="0"><doc>This field specifies the number of DWORDS per vertex to expect when VAP_VF_CNTL.PRIM_WALK is set to Vertex Data (vertex data embedded in command stream). This field is not used for any other PRIM_WALK settings. This field replaces the usage of the VAP_VTX_FMT_0/1 for this purpose in prior implementations.</doc></bitfield>
+ </reg32>
+ <stripe offset="0x2430" stride="0x0004" length="4">
+ <reg32 name="VAP_VTX_ST_BLND_WT" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x232C" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_CLR_A" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x2328" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_CLR_B" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x2324" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_CLR_G" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x2470" stride="0x0004" length="8">
+ <reg32 name="VAP_VTX_ST_CLR_PKD" access="w" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x2320" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_CLR_R" access="rw" offset="0x0000" />
+ </stripe>
+ <reg32 name="VAP_VTX_ST_DISC_FOG" access="rw" offset="0x2424" />
+ <reg32 name="VAP_VTX_ST_END_OF_PKT" access="w" offset="0x24AC" />
+ <reg32 name="VAP_VTX_ST_NORM_0_PKD" access="w" offset="0x2498" />
+ <reg32 name="VAP_VTX_ST_NORM_0_X" access="rw" offset="0x2310" />
+ <reg32 name="VAP_VTX_ST_NORM_0_Y" access="rw" offset="0x2314" />
+ <reg32 name="VAP_VTX_ST_NORM_0_Z" access="rw" offset="0x2318" />
+ <reg32 name="VAP_VTX_ST_NORM_1_X" access="rw" offset="0x2450" />
+ <reg32 name="VAP_VTX_ST_NORM_1_Y" access="rw" offset="0x2454" />
+ <reg32 name="VAP_VTX_ST_NORM_1_Z" access="rw" offset="0x2458" />
+ <reg32 name="VAP_VTX_ST_PNT_SPRT_SZ" access="rw" offset="0x2420" />
+ <reg32 name="VAP_VTX_ST_POS_0_W_4" access="rw" offset="0x230C" />
+ <reg32 name="VAP_VTX_ST_POS_0_X_2" access="w" offset="0x2490" />
+ <reg32 name="VAP_VTX_ST_POS_0_X_3" access="w" offset="0x24A0" />
+ <reg32 name="VAP_VTX_ST_POS_0_X_4" access="rw" offset="0x2300" />
+ <reg32 name="VAP_VTX_ST_POS_0_Y_2" access="w" offset="0x2494" />
+ <reg32 name="VAP_VTX_ST_POS_0_Y_3" access="w" offset="0x24A4" />
+ <reg32 name="VAP_VTX_ST_POS_0_Y_4" access="rw" offset="0x2304" />
+ <reg32 name="VAP_VTX_ST_POS_0_Z_3" access="w" offset="0x24A8" />
+ <reg32 name="VAP_VTX_ST_POS_0_Z_4" access="rw" offset="0x2308" />
+ <reg32 name="VAP_VTX_ST_POS_1_W" access="rw" offset="0x244C" />
+ <reg32 name="VAP_VTX_ST_POS_1_X" access="rw" offset="0x2440" />
+ <reg32 name="VAP_VTX_ST_POS_1_Y" access="rw" offset="0x2444" />
+ <reg32 name="VAP_VTX_ST_POS_1_Z" access="rw" offset="0x2448" />
+ <reg32 name="VAP_VTX_ST_PVMS" access="rw" offset="0x231C" />
+ <reg32 name="VAP_VTX_ST_SHININESS_0" access="rw" offset="0x2428" />
+ <reg32 name="VAP_VTX_ST_SHININESS_1" access="rw" offset="0x242C" />
+ <stripe offset="0x23AC" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_TEX_Q" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x23A8" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_TEX_R" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x23A0" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_TEX_S" access="rw" offset="0x0000" />
+ </stripe>
+ <stripe offset="0x23A4" stride="0x0010" length="8">
+ <reg32 name="VAP_VTX_ST_TEX_T" access="rw" offset="0x0000" />
+ </stripe>
+ <reg32 name="VAP_VTX_ST_USR_CLR_A" access="rw" offset="0x246C" />
+ <reg32 name="VAP_VTX_ST_USR_CLR_B" access="rw" offset="0x2468" />
+ <reg32 name="VAP_VTX_ST_USR_CLR_G" access="rw" offset="0x2464" />
+ <reg32 name="VAP_VTX_ST_USR_CLR_PKD" access="w" offset="0x249C" />
+ <reg32 name="VAP_VTX_ST_USR_CLR_R" access="rw" offset="0x2460" />
+ <reg32 name="ZB_DEPTHCLEARVALUE" access="rw" offset="0x4F28">
+ <doc>Z Buffer Clear Value. When a block has a Z Mask value of 0, all Z values in that block are cleared to this value. In 24bpp, the stencil value is also updated regardless of whether it is enabled or not.</doc>
+ </reg32>
+ <reg32 name="ZB_DEPTHOFFSET" access="rw" offset="0x4F20">
+ <doc>Z Buffer Address Offset</doc>
+ <bitfield name="DEPTHOFFSET" high="31" low="5"><doc>2K aligned Z buffer address offset for macro tiles.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_DEPTHPITCH" access="rw" offset="0x4F24">
+ <doc>Z Buffer Pitch and Endian Control</doc>
+ <bitfield name="DEPTHPITCH" high="13" low="2"><doc>Z buffer pitch in multiples of 4 pixels.</doc></bitfield>
+ <bitfield name="DEPTHMACROTILE" high="16" low="16">
+ <doc>Specifies whether Z buffer is macro-tiled. macro-tiles are 2K aligned</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DEPTHMICROTILE" high="18" low="17">
+ <doc>Specifies whether Z buffer is micro-tiled. micro-tiles is 32 bytes</doc>
+ <use-enum ref="MICROTILE" />
+ </bitfield>
+ <bitfield name="DEPTHENDIAN" high="20" low="19">
+ <doc>Specifies endian control for the Z buffer.</doc>
+ <use-enum ref="BYTESWAP" />
+ </bitfield>
+ </reg32>
+ <reg32 name="ZB_DEPTHXY_OFFSET" access="rw" offset="0x4F60">
+ <doc>Depth buffer X and Y coordinate offset</doc>
+ <bitfield name="DEPTHX_OFFSET" high="11" low="1"><doc>X coordinate offset. multiple of 32 . Bits 4:0 have to be zero</doc></bitfield>
+ <bitfield name="DEPTHY_OFFSET" high="27" low="17"><doc>Y coordinate offset. multiple of 32 . Bits 4:0 have to be zero</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_PITCH" access="rw" offset="0x4F54">
+ <doc>Hierarchical Z Pitch</doc>
+ <bitfield name="HIZ_PITCH" high="13" low="4"><doc>Pitch used in HiZ address computation.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_STENCILREFMASK" access="rw" offset="0x4F08">
+ <doc>Stencil Reference Value and Mask</doc>
+ <bitfield name="STENCILREF" high="7" low="0"><doc>Specifies the reference stencil value.</doc></bitfield>
+ <bitfield name="STENCILMASK" high="15" low="8"><doc>This value is ANDed with both the reference and the current stencil value prior to the stencil test.</doc></bitfield>
+ <bitfield name="STENCILWRITEMASK" high="23" low="16"><doc>Specifies the write mask for the stencil planes.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_ZCACHE_CTLSTAT" access="rw" offset="0x4F18">
+ <doc>Z Buffer Cache Control/Status</doc>
+ <bitfield name="ZC_FLUSH" high="0" low="0">
+ <doc>Setting this bit flushes the dirty data from the Z cache. Unless ZC_FREE bit is also set, the tags in the cache remain valid. A purge is achieved by setting both ZC_FLUSH and ZC_FREE. This is a sticky bit and it clears itself at the end of the operation.</doc>
+ <value value="0" name="NO_EFFECT"><doc>No effect</doc></value>
+ <value value="1" name="FLUSH_AND_FREE_Z_CACHE_LINES"><doc>Flush and Free Z cache lines</doc></value>
+ </bitfield>
+ <bitfield name="ZC_FREE" high="1" low="1">
+ <doc>Setting this bit invalidates the Z cache tags. Unless ZC_FLUSH bit is also set, the cachelines are not written to memory. A purge is achieved by setting both ZC_FLUSH and ZC_FREE. This is a sticky bit that clears itself at the end of the operation.</doc>
+ <value value="0" name="NO_EFFECT"><doc>No effect</doc></value>
+ <value value="1" name="FREE_Z_CACHE_LINES"><doc>Free Z cache lines (invalidate)</doc></value>
+ </bitfield>
+ <bitfield name="ZC_BUSY" high="31" low="31">
+ <doc>This bit is unused ...</doc>
+ <value value="0" name="IDLE"><doc>Idle</doc></value>
+ <value value="1" name="BUSY"><doc>Busy</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="ZB_ZPASS_ADDR" access="rw" offset="0x4F5C">
+ <doc>Z Buffer Z Pass Counter Address</doc>
+ <bitfield name="ZPASS_ADDR" high="31" low="2"><doc>Writing this location with a DWORD address causes the value in ZB_ZPASS_DATA to be written to main memory at the location pointed to by this address. NOTE: R300 has 2 pixel pipes. Broadcasting this address causes both pipes to write their ZPASS value to the same address. There is no guarantee which pipe will write last. So when writing to this register, the GA needs to be programmed to send the write command to pipe 0. Then a different address needs to be written to pipe 1. Then both pipes should be enabled for further register writes.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_ZTOP" access="rw" offset="0x4F14">
+ <bitfield name="ZTOP" high="0" low="0">
+ <value value="0" name="Z_IS_AT_THE_BOTTOM_OF_THE_PIPE"><doc>Z is at the bottom of the pipe, after the fog unit.</doc></value>
+ <value value="1" name="Z_IS_AT_THE_TOP_OF_THE_PIPE"><doc>Z is at the top of the pipe, after the scan unit.</doc></value>
+ </bitfield>
+ </reg32>
+</group>
+
+<group name="r300_regs" prepend="R300_">
+ <reg32 name="RB3D_AARESOLVE_CTL" access="rw" offset="0x4E88">
+ <doc>Resolve Buffer Control. Unpipelined</doc>
+ <bitfield name="AARESOLVE_MODE" high="0" low="0">
+ <doc>Specifies if the color buffer is in resolve mode. The cache must be empty before changing this register.</doc>
+ <use-enum ref="AARESOLVE_MODE" />
+ </bitfield>
+ <bitfield name="AARESOLVE_GAMMA" high="1" low="1">
+ <doc>Specifies the gamma and degamma to be applied to the samples before and after filtering, respectively.</doc>
+ <use-enum ref="AARESOLVE_GAMMA" />
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_BLENDCNTL" access="rw" offset="0x4E04">
+ <doc>Alpha Blend Control for Color Channels. Pipelined through the blender.</doc>
+ <bitfield name="ALPHA_BLEND_ENABLE" high="0" low="0">
+ <doc>Allow alpha blending with the destination.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SEPARATE_ALPHA_ENABLE" high="1" low="1">
+ <doc>Enables use of RB3D_ABLENDCNTL</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="READ_ENABLE" high="2" low="2">
+ <doc>When blending is enabled, this enables memory reads. Memory reads will still occur when this is disabled if they are for reasons not related to blending.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DISCARD_SRC_PIXELS" high="5" low="3">
+ <doc>Discard pixels when blending is enabled based on the src color.</doc>
+ <value value="0" name="DISABLE"><doc>Disable</doc></value>
+ <value value="1" name="DISCARD_PIXELS_IF_SRC_ALPHA"><doc>Discard pixels if src alpha == 0</doc></value>
+ <value value="2" name="DISCARD_PIXELS_IF_SRC_COLOR"><doc>Discard pixels if src color == 0</doc></value>
+ <value value="3" name="DISCARD_PIXELS_IF"><doc>Discard pixels if (src alpha == 0) &amp;&amp; (src color == 0)</doc></value>
+ <value value="4" name="DISCARD_PIXELS_IF_SRC_ALPHA"><doc>Discard pixels if src alpha == 1</doc></value>
+ <value value="5" name="DISCARD_PIXELS_IF_SRC_COLOR"><doc>Discard pixels if src color == 1</doc></value>
+ <value value="6" name="DISCARD_PIXELS_IF"><doc>Discard pixels if (src alpha == 1) &amp;&amp; (src color == 1)</doc></value>
+ </bitfield>
+ <bitfield name="COMB_FCN" high="14" low="12">
+ <doc>Combine Function , Allows modification of how the SRCBLEND and DESTBLEND are combined.</doc>
+ <use-enum ref="COMBINE_FUNCTION" />
+ </bitfield>
+ <bitfield name="SRCBLEND" high="21" low="16">
+ <doc>Source Blend Function , Alpha blending function (SRC).</doc>
+ <use-enum ref="BLEND_FUNC_SRC" />
+ </bitfield>
+ <bitfield name="DESTBLEND" high="29" low="24">
+ <doc>Destination Blend Function , Alpha blending function (DST).</doc>
+ <use-enum ref="BLEND_FUNC_DEST" />
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_CCTL" access="rw" offset="0x4E00">
+ <doc>Unpipelined.</doc>
+ <bitfield name="NUM_MULTIWRITES" high="6" low="5"><doc>A quad is replicated and written to this many + 1 buffers. 0 (1 buffer) is the only mode where the cb processes the end of packet command.</doc></bitfield>
+ <bitfield name="CLRCMP_FLIPE_ENABLE" high="7" low="7">
+ <doc>Enables equivalent of rage128 CMP_EQ_FLIP color compare mode. This is used to ensure 3D data does not get chromakeyed away by logic in the backend.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="AA_COMPRESSION_ENABLE" high="9" low="9">
+ <doc>Enables AA color compression. The cache must be empty before this is changed.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="Reserved" high="10" low="10"><doc>Set to 0</doc></bitfield>
+ </reg32>
+ <stripe offset="0x4E38" stride="0x0004" length="4">
+ <reg32 name="RB3D_COLORPITCH" access="rw" offset="0x0000">
+ <doc>Color buffer format and tiling control for all the multibuffers and the pitch of multibuffer 0. Unpipelined. The cache must be empty before any of the registers are changed.</doc>
+ <bitfield name="COLORPITCH" high="13" low="1"><doc>3D destination pitch in multiples of 2-pixels.</doc></bitfield>
+ <bitfield name="COLORTILE" high="16" low="16">
+ <doc>Denotes whether the 3D destination is in macrotiled format.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="COLORMICROTILE" high="18" low="17">
+ <doc>Denotes whether the 3D destination is in microtiled format.</doc>
+ <use-enum ref="MICROTILE" />
+ </bitfield>
+ <bitfield name="COLORENDIAN" high="20" low="19">
+ <doc>Specifies endian control for the color buffer.</doc>
+ <use-enum ref="BYTESWAP" />
+ </bitfield>
+ <bitfield name="COLORFORMAT" high="24" low="21">
+ <doc>3D destination color format.</doc>
+ <value value="3" name="ARGB1555"><doc>ARGB1555</doc></value>
+ <value value="4" name="RGB565"><doc>RGB565</doc></value>
+ <value value="6" name="ARGB8888"><doc>ARGB8888</doc></value>
+ <value value="7" name="ARGB32323232"><doc>ARGB32323232</doc></value>
+ <value value="9" name="I8"><doc>I8</doc></value>
+ <value value="10" name="ARGB16161616"><doc>ARGB16161616</doc></value>
+ <value value="11" name="YUV422_PACKED"><doc>YUV422 packed (VYUY)</doc></value>
+ <value value="12" name="YUV422_PACKED"><doc>YUV422 packed (YVYU)</doc></value>
+ <value value="13" name="UV88"><doc>UV88</doc></value>
+ <value value="15" name="ARGB4444"><doc>ARGB4444</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="RB3D_COLOR_CHANNEL_MASK" access="rw" offset="0x4E0C">
+ <doc>3D Color Channel Mask. If all the channels used in the current color format are disabled, then the cb will discard all the incoming quads. Pipelined through the blender.</doc>
+ <bitfield name="BLUE_MASK" high="0" low="0">
+ <doc>mask bit for blue channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="GREEN_MASK" high="1" low="1">
+ <doc>mask bit for green channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="RED_MASK" high="2" low="2">
+ <doc>mask bit for red channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALPHA_MASK" high="3" low="3">
+ <doc>mask bit for alpha channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_COLOR_CLEAR_VALUE" access="rw" offset="0x4E14">
+ <doc>Clear color that is used when the color mask is set to 00. Unpipelined.</doc>
+ </reg32>
+ <reg32 name="RB3D_CONSTANT_COLOR" access="rw" offset="0x4E10">
+ <doc>Constant color used by the blender. Pipelined through the blender.</doc>
+ <bitfield name="BLUE" high="7" low="0"><doc>blue constant color</doc></bitfield>
+ <bitfield name="GREEN" high="15" low="8"><doc>green constant color</doc></bitfield>
+ <bitfield name="RED" high="23" low="16"><doc>red constant color</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="24"><doc>alpha constant color</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_ALPHA_FUNC" access="rw" offset="0x4BD4">
+ <doc>Alpha Function</doc>
+ <bitfield name="AF_VAL" high="7" low="0"><doc>Specifies the alpha compare value.</doc></bitfield>
+ <bitfield name="AF_FUNC" high="10" low="8">
+ <doc>Specifies the alpha compare function.</doc>
+ <use-enum ref="ALPHACOMPARE_FUNC" />
+ </bitfield>
+ <bitfield name="AF_EN" high="11" low="11">
+ <doc>Enables/Disables alpha compare function.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="AM_EN" high="16" low="16">
+ <doc>Enables/Disables alpha-to-mask function.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="AM_CFG" high="17" low="17">
+ <doc>Specfies number of sub-pixel samples for alpha-to-mask function.</doc>
+ <use-enum ref="ALPHA_SUBPIXEL_SAMPLES" />
+ </bitfield>
+ <bitfield name="DITH_EN" high="20" low="20">
+ <doc>Enables/Disables RGB Dithering.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_COLOR_B" access="rw" offset="0x4BD0">
+ <doc>Blue Component of Fog Color</doc>
+ <bitfield name="BLUE" high="9" low="0"><doc>Blue component of fog color; (0.9) fixed format.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_COLOR_G" access="rw" offset="0x4BCC">
+ <doc>Green Component of Fog Color</doc>
+ <bitfield name="GREEN" high="9" low="0"><doc>Green component of fog color; (0.9) fixed format.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_COLOR_R" access="rw" offset="0x4BC8">
+ <doc>Red Component of Fog Color</doc>
+ <bitfield name="RED" high="9" low="0"><doc>Red component of fog color; (0.9) fixed format.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_FACTOR" access="rw" offset="0x4BC4">
+ <doc>Constant Factor for Fog Blending</doc>
+ <bitfield name="FACTOR" high="9" low="0"><doc>Constant fog factor; fixed (0.9) format.</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_ENHANCE" access="rw" offset="0x4274">
+ <doc>GA Enhancement Register</doc>
+ <bitfield name="DEADLOCK_CNTL" high="0" low="0">
+ <doc>TCL/GA Deadlock control. Prevents TCL interface from deadlocking on GA side.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="FASTSYNC_CNTL" high="1" low="1">
+ <doc>Enables Fast register/primitive switching</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_LINE_CNTL" access="rw" offset="0x4234">
+ <doc>Line control</doc>
+ <bitfield name="WIDTH" high="15" low="0"><doc>1/2 width of line, in subpixels; (16.0) fixed format.</doc></bitfield>
+ <bitfield name="END_TYPE" high="17" low="16">
+ <doc>Specifies how ends of lines should be drawn.</doc>
+ <use-enum ref="LINE_END" />
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_LINE_STIPPLE_VALUE" access="rw" offset="0x4260">
+ <doc>Current value of stipple accumulator. 24b Integer, measuring stipple accumulation in subpixels. (note: field is 32b, but only lower 24b used)</doc>
+ </reg32>
+ <reg32 name="GA_OFFSET" access="rw" offset="0x4290">
+ <doc>Specifies x &amp; y offsets for vertex data after conversion to FP.</doc>
+ <bitfield name="X_OFFSET" high="15" low="0"><doc>Specifies X offset in S15 format (subpixels).</doc></bitfield>
+ <bitfield name="Y_OFFSET" high="31" low="16"><doc>Specifies Y offset in S15 format (subpixels).</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_POINT_SIZE" access="rw" offset="0x421C">
+ <doc>Dimensions for Points</doc>
+ <bitfield name="HEIGHT" high="15" low="0"><doc>1/2 Height of point; fixed (16.0), subpixel format.</doc></bitfield>
+ <bitfield name="WIDTH" high="31" low="16"><doc>1/2 Width of point; fixed (16.0), subpixel format.</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_ROUND_MODE" access="rw" offset="0x428C">
+ <doc>Specifies the rouding mode for geometry &amp; color SPFP to FP conversions.</doc>
+ <bitfield name="GEOMETRY_ROUND" high="1" low="0">
+ <doc>Trunc (0) or round to nearest (1) for geometry (XY).</doc>
+ <use-enum ref="ROUNDING_MODE" />
+ </bitfield>
+ <bitfield name="COLOR_ROUND" high="3" low="2">
+ <doc>Trunc (0) or round to nearest (1) for colors (RGBA).</doc>
+ <use-enum ref="ROUNDING_MODE" />
+ </bitfield>
+ <bitfield name="RGB_CLAMP" high="4" low="4">
+ <doc>Specifies SPFP color clamp range of [0,1] or [-8,8] for RGB.</doc>
+ <value value="0" name="CLAMP_TO"><doc>Clamp to [0,1.0] for RGB</doc></value>
+ <value value="1" name="CLAMP_TO"><doc>Clamp to [-7.9999, 7.9999] for RGB</doc></value>
+ </bitfield>
+ <bitfield name="ALPHA_CLAMP" high="5" low="5">
+ <doc>Specifies SPFP alpha clamp range of [0,1] or [-8,8].</doc>
+ <value value="0" name="CLAMP_TO"><doc>Clamp to [0,1.0] for Alpha</doc></value>
+ <value value="1" name="CLAMP_TO"><doc>Clamp to [-7.9999, 7.9999] for Alpha</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_SOFT_RESET" access="rw" offset="0x429C">
+ <doc>Specifies number of cycles to assert reset, and also causes RB3D soft reset to assert.</doc>
+ <bitfield name="SOFT_RESET_COUNT" high="15" low="0"><doc>Count in cycles (def 256).</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_SOLID_BA" access="rw" offset="0x4280">
+ <doc>Specifies blue &amp; alpha components of fill color.</doc>
+ <bitfield name="COLOR_ALPHA" high="15" low="0"><doc>Component alpha value. (S3.12)</doc></bitfield>
+ <bitfield name="COLOR_BLUE" high="31" low="16"><doc>Component blue value. (S3.12)</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_SOLID_RG" access="rw" offset="0x427C">
+ <doc>Specifies red &amp; green components of fill color.</doc>
+ <bitfield name="COLOR_GREEN" high="15" low="0"><doc>Component green value (S3.12).</doc></bitfield>
+ <bitfield name="COLOR_RED" high="31" low="16"><doc>Component red value (S3.12).</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_ENABLE" access="rw" offset="0x4008">
+ <doc>Specifies top of Raster pipe specific enable controls.</doc>
+ <bitfield name="POINT_STUFF_ENABLE" high="0" low="0">
+ <doc>Specifies if points will have stuffed texture coordinates.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="LINE_STUFF_ENABLE" high="1" low="1">
+ <doc>Specifies if lines will have stuffed texture coordinates.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TRIANGLE_STUFF_ENABLE" high="2" low="2">
+ <doc>Specifies if triangles will have stuffed texture coordinates.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="STENCIL_AUTO" high="5" low="4">
+ <doc>Specifies if the auto dec/inc stencil mode should be enabled, and how.</doc>
+ <use-enum ref="STENCIL_AUTO_MODE" />
+ </bitfield>
+ <bitfield name="TEX0_SOURCE" high="17" low="16">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_0"><doc>Replicate VAP source texture coordinates 0 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX1_SOURCE" high="19" low="18">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_1"><doc>Replicate VAP source texture coordinates 1 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX2_SOURCE" high="21" low="20">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_2"><doc>Replicate VAP source texture coordinates 2 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX3_SOURCE" high="23" low="22">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_3"><doc>Replicate VAP source texture coordinates 3 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX4_SOURCE" high="25" low="24">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_4"><doc>Replicate VAP source texture coordinates 4 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX5_SOURCE" high="27" low="26">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_5"><doc>Replicate VAP source texture coordinates 5 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX6_SOURCE" high="29" low="28">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_6"><doc>Replicate VAP source texture coordinates 6 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ <bitfield name="TEX7_SOURCE" high="31" low="30">
+ <doc>Specifies the source of the texture coordinates for this texture.</doc>
+ <value value="0" name="REPLICATE_VAP_SOURCE_TEXTURE_COORDINATES_7"><doc>Replicate VAP source texture coordinates 7 (S,T,[R,Q]).</doc></value>
+ <value value="1" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T).</doc></value>
+ <value value="2" name="STUFF_WITH_SOURCE_TEXTURE_COORDINATES"><doc>Stuff with source texture coordinates (S,T,R).</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GB_FIFO_SIZE" access="rw" offset="0x4024">
+ <doc>Specifies the sizes of the various FIFO's in the sc/rs/us. This register must be the first one written</doc>
+ <bitfield name="SC_IFIFO_SIZE" high="1" low="0">
+ <doc>Size of scan converter input FIFO (XYZ)</doc>
+ <use-enum ref="WORDSIZE_32" />
+ </bitfield>
+ <bitfield name="SC_TZFIFO_SIZE" high="3" low="2">
+ <doc>Size of scan converter top-of-pipe Z FIFO</doc>
+ <use-enum ref="WORDSIZE_16" />
+ </bitfield>
+ <bitfield name="SC_BFIFO_SIZE" high="5" low="4">
+ <doc>Size of scan converter input FIFO (B)</doc>
+ <use-enum ref="WORDSIZE_32" />
+ </bitfield>
+ <bitfield name="RS_TFIFO_SIZE" high="7" low="6">
+ <doc>Size of ras input FIFO (Texture)</doc>
+ <use-enum ref="WORDSIZE_64" />
+ </bitfield>
+ <bitfield name="RS_CFIFO_SIZE" high="9" low="8">
+ <doc>Size of ras input FIFO (Color)</doc>
+ <use-enum ref="WORDSIZE_64" />
+ </bitfield>
+ <bitfield name="US_RAM_SIZE" high="11" low="10">
+ <doc>Size of us RAM</doc>
+ <use-enum ref="WORDSIZE_64" />
+ </bitfield>
+ <bitfield name="US_OFIFO_SIZE" high="13" low="12">
+ <doc>Size of us output FIFO (RGBA)</doc>
+ <use-enum ref="WORDSIZE_16" />
+ </bitfield>
+ <bitfield name="US_WFIFO_SIZE" high="15" low="14">
+ <doc>Size of us output FIFO (W)</doc>
+ <use-enum ref="WORDSIZE_16" />
+ </bitfield>
+ <bitfield name="RS_HIGHWATER_COL" high="18" low="16"><doc>High water mark for RS color FIFO (0-7, default 7)</doc></bitfield>
+ <bitfield name="RS_HIGHWATER_TEX" high="21" low="19"><doc>High water mark for RS texture FIFO (0-7, default 7)</doc></bitfield>
+ <bitfield name="US_OFIFO_HIGHWATER" high="23" low="22">
+ <doc>High water mark for US output FIFO (0-12, default 4)</doc>
+ <use-enum ref="ENUM44" />
+ </bitfield>
+ <bitfield name="US_CUBE_FIFO_HIGHWATER" high="27" low="24"><doc>High water mark for US texture output FIFO (0-15, default 11)</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_MSPOS0" access="rw" offset="0x4010">
+ <doc>Specifies the position of multisamples 0 through 2</doc>
+ <bitfield name="MS_X0" high="3" low="0"><doc>Specifies the x and y position (in subpixels) of multisample 0</doc></bitfield>
+ <bitfield name="MS_Y0" high="7" low="4"><doc>Specifies the x and y position (in subpixels) of multisample 0</doc></bitfield>
+ <bitfield name="MS_X1" high="11" low="8"><doc>Specifies the x and y position (in subpixels) of multisample 1</doc></bitfield>
+ <bitfield name="MS_Y1" high="15" low="12"><doc>Specifies the x and y position (in subpixels) of multisample 1</doc></bitfield>
+ <bitfield name="MS_X2" high="19" low="16"><doc>Specifies the x and y position (in subpixels) of multisample 2</doc></bitfield>
+ <bitfield name="MS_Y2" high="23" low="20"><doc>Specifies the x and y position (in subpixels) of multisample 2</doc></bitfield>
+ <bitfield name="MSBD0_Y" high="27" low="24"><doc>Specifies the minimum y distance (in subpixels) between the pixel edge and the multisample bounding box. This value is used in the tile scan converter</doc></bitfield>
+ <bitfield name="MSBD0_X" high="31" low="28"><doc>msbd0_x[2:0] specifies the minimum x distance (in subpixels) between the pixel edge and the multisample bounding box. This value is used in the tile scan converter. The special case value of 8 is represented by msbd0_x[2:0]=7. msbd0_x[3] is used to force a bounding box based tile scan conversion instead of an intercept based one. This value should always be set to 0.</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_MSPOS1" access="rw" offset="0x4014">
+ <doc>Specifies the position of multisamples 3 through 5</doc>
+ <bitfield name="MS_X3" high="3" low="0"><doc>Specifies the x and y position (in subpixels) of multisample 3</doc></bitfield>
+ <bitfield name="MS_Y3" high="7" low="4"><doc>Specifies the x and y position (in subpixels) of multisample 3</doc></bitfield>
+ <bitfield name="MS_X4" high="11" low="8"><doc>Specifies the x and y position (in subpixels) of multisample 4</doc></bitfield>
+ <bitfield name="MS_Y4" high="15" low="12"><doc>Specifies the x and y position (in subpixels) of multisample 4</doc></bitfield>
+ <bitfield name="MS_X5" high="19" low="16"><doc>Specifies the x and y position (in subpixels) of multisample 5</doc></bitfield>
+ <bitfield name="MS_Y5" high="23" low="20"><doc>Specifies the x and y position (in subpixels) of multisample 5</doc></bitfield>
+ <bitfield name="MSBD1" high="27" low="24"><doc>Specifies the minimum distance (in subpixels) between the pixel edge and the multisample bounding box. This value is used in the quad scan converter</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_SELECT" access="rw" offset="0x401C">
+ <doc>Specifies various polygon specific selects (fog, depth, perspective).</doc>
+ <bitfield name="FOG_SELECT" high="2" low="0">
+ <doc>Specifies source for outgoing (GA to SU) fog value.</doc>
+ <use-enum ref="FOG_SELECT" />
+ </bitfield>
+ <bitfield name="DEPTH_SELECT" high="3" low="3">
+ <doc>Specifies source for outgoing (GA/SU &amp; SU/RAS) depth value.</doc>
+ <use-enum ref="DEPTH_SELECT" />
+ </bitfield>
+ <bitfield name="W_SELECT" high="4" low="4">
+ <doc>Specifies source for outgoing (1/W) value, used to disable perspective correct colors/textures.</doc>
+ <use-enum ref="W_SELECT" />
+ </bitfield>
+ </reg32>
+ <reg32 name="GB_TILE_CONFIG" access="rw" offset="0x4018">
+ <doc>Specifies the graphics pipeline configuration for rasterization</doc>
+ <bitfield name="ENABLE" high="0" low="0">
+ <doc>Enables tiling, otherwise all tiles receive all polygons.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="PIPE_COUNT" high="3" low="1">
+ <doc>Specifies the number of active pipes and contexts.</doc>
+ <value value="0" name="RV350"><doc>RV350</doc></value>
+ <value value="3" name="R300"><doc>R300</doc></value>
+ </bitfield>
+ <bitfield name="TILE_SIZE" high="5" low="4">
+ <doc>Specifies width &amp; height (square), in pixels.</doc>
+ <value value="0" name="8_PIXELS"><doc>8 pixels (not supported by zb/cb)</doc></value>
+ <value value="1" name="16_PIXELS"><doc>16 pixels</doc></value>
+ <value value="2" name="32_PIXELS"><doc>32 pixels (not supported by zb/cb)</doc></value>
+ </bitfield>
+ <bitfield name="SUPER_SIZE" high="8" low="6">
+ <doc>Specifies number of tiles and config in super chip configuration.</doc>
+ <use-enum ref="ENUM50" />
+ </bitfield>
+ <bitfield name="SUPER_X" high="11" low="9"><doc>X Location of chip within super tile.</doc></bitfield>
+ <bitfield name="SUPER_Y" high="14" low="12"><doc>Y Location of chip within super tile.</doc></bitfield>
+ <bitfield name="SUPER_TILE" high="15" low="15">
+ <doc>Tile location of chip in a multi super tile config (Super size of 2,8,32 or 128).</doc>
+ <use-enum ref="SUPERTILE_LOCATION" />
+ </bitfield>
+ <bitfield name="SUBPIXEL" high="16" low="16">
+ <doc>Specifies the subpixel precision.</doc>
+ <use-enum ref="SUBPIXEL_PRECISION" />
+ </bitfield>
+ <bitfield name="QUADS_PER_RAS" high="18" low="17"><doc>unused</doc></bitfield>
+ <bitfield name="BB_SCAN" high="19" low="19"><doc>unused</doc></bitfield>
+ </reg32>
+ <reg32 name="RS_COUNT" access="rw" offset="0x4300">
+ <doc>This register specifies the rasterizer input packet configuration</doc>
+ <bitfield name="IT_COUNT" high="6" low="0"><doc>Specifies the total number of texture address components contained in the rasterizer input packet (0:32).</doc></bitfield>
+ <bitfield name="IC_COUNT" high="10" low="7"><doc>Specifies the total number of colors contained in the rasterizer input packet (0:4).</doc></bitfield>
+ <bitfield name="W_COUNT" high="11" low="11"><doc>Specifies the total number of w values contained in the rasterizer input packet (0 or 1).</doc></bitfield>
+ <bitfield name="W_ADDR" high="17" low="12"><doc>Specifies the relative rasterizer input packet location of w (if w_count==1)</doc></bitfield>
+ <bitfield name="HIRES_EN" high="18" low="18"><doc>Enable high resolution texture coordinate output when q is equal to 1</doc></bitfield>
+ </reg32>
+ <stripe offset="0x4330" stride="0x0004" length="16">
+ <reg32 name="RS_INST" access="rw" offset="0x0000">
+ <doc>This table specifies what happens during each rasterizer instruction</doc>
+ <bitfield name="TEX_ID" high="2" low="0"><doc>Specifies the index (into the RS_IP table) of the texture address output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="TEX_CN" high="5" low="3">
+ <doc>Write enable for texture address</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_ADDR" high="10" low="6"><doc>Specifies the destination address (within the current pixel stack frame) of the texture address output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="COL_ID" high="13" low="11"><doc>Specifies the index (into the RS_IP table) of the color output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="COL_CN" high="16" low="14">
+ <doc>Write enable for color</doc>
+ <value value="0" name="NO_WRITE"><doc>No write - color not valid</doc></value>
+ <value value="1" name="WRITE"><doc>write - color valid</doc></value>
+ </bitfield>
+ <bitfield name="COL_ADDR" high="21" low="17"><doc>Specifies the destination address (within the current pixel stack frame) of the color output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="TEX_ADJ" high="22" low="22">
+ <doc>Specifies whether to sample texture coordinates at the real or adjusted pixel centers</doc>
+ <use-enum ref="PIXEL_CENTER" />
+ </bitfield>
+ <bitfield name="COL_BIAS" high="24" low="23"><doc>unused</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="RS_INST_COUNT" access="rw" offset="0x4304">
+ <doc>This register specifies the number of rasterizer instructions</doc>
+ <bitfield name="INST_COUNT" high="3" low="0"><doc>Number of rasterizer instructions (1:16)</doc></bitfield>
+ <bitfield name="W_EN" high="4" low="4"><doc>Specifies that the rasterizer needs to generate w</doc></bitfield>
+ <bitfield name="TX_OFFSET" high="7" low="5">
+ <doc>Defines texture coordinate offset (based on min/max coordinate range of triangle) used to minimize or eliminate peroidic errors on texels sampled right on their edges</doc>
+ <value value="0" name="0"><doc>0.0</doc></value>
+ <value value="1" name="RANGE"><doc>range/8K</doc></value>
+ <value value="2" name="RANGE"><doc>range/16K</doc></value>
+ <value value="3" name="RANGE"><doc>range/32K</doc></value>
+ <value value="4" name="RANGE"><doc>range/64K</doc></value>
+ <value value="5" name="RANGE"><doc>range/128K</doc></value>
+ <value value="6" name="RANGE"><doc>range/256K</doc></value>
+ <value value="7" name="RANGE"><doc>range/512K</doc></value>
+ </bitfield>
+ </reg32>
+ <stripe offset="0x4310" stride="0x0000" length="8">
+ <reg32 name="RS_IP" access="rw" offset="0x0000">
+ <doc>This table specifies the source location and format for up to 8 texture addresses (i[0]:i[7]) and four colors (c[0]:c[3])</doc>
+ <bitfield name="TEX_PTR" high="5" low="0"><doc>Specifies the relative rasterizer input packet location of texture address (i[i]).</doc></bitfield>
+ <bitfield name="COL_PTR" high="8" low="6"><doc>Specifies the relative rasterizer input packet location of the color (c[i]).</doc></bitfield>
+ <bitfield name="COL_FMT" high="12" low="9">
+ <doc>Specifies the format of the color (c[i]).</doc>
+ <use-enum ref="COLFMT" />
+ </bitfield>
+ <bitfield name="SEL_S" high="15" low="13">
+ <doc>Source select for S, T, R, and Q</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="SEL_T" high="18" low="16">
+ <doc>Source select for S, T, R, and Q</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="SEL_R" high="21" low="19">
+ <doc>Source select for S, T, R, and Q</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="SEL_Q" high="24" low="22">
+ <doc>Source select for S, T, R, and Q</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="SC_EDGERULE" access="rw" offset="0x43A8">
+ <doc>Edge rules - what happens when an edge falls exactly on a sample point</doc>
+ <bitfield name="ER_TRI" high="4" low="0">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ <bitfield name="ER_POINT" high="9" low="5">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM60" />
+ </bitfield>
+ <bitfield name="ER_LINE_LR" high="14" low="10">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM60" />
+ </bitfield>
+ <bitfield name="ER_LINE_RL" high="19" low="15">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM60" />
+ </bitfield>
+ <bitfield name="ER_LINE_TB" high="24" low="20">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM60" />
+ </bitfield>
+ <bitfield name="ER_LINE_BT" high="29" low="25">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM60" />
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_REG_DEST" access="rw" offset="0x42C8">
+ <doc>SU Raster pipe destination select for registers</doc>
+ <bitfield name="SELECT" high="3" low="0">
+ <doc>Select which of the 2 pipes (enable per pipe) to send register read/write to. b0: P0 enable, b3: P1 enable</doc>
+ <value value="0" name="P0_ENABLE"><doc>P0 enable, b</doc></value>
+ <value value="3" name="P1_ENABLE"><doc>P1 enable</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_TEX_WRAP" access="rw" offset="0x42A0">
+ <doc>Enables for Cylindrical Wrapping</doc>
+ <bitfield name="T0C0" high="0" low="0"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T0C1" high="1" low="1"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T0C2" high="2" low="2"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T0C3" high="3" low="3"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T1C0" high="4" low="4"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T1C1" high="5" low="5"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T1C2" high="6" low="6"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T1C3" high="7" low="7"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T2C0" high="8" low="8"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T2C1" high="9" low="9"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T2C2" high="10" low="10"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T2C3" high="11" low="11"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T3C0" high="12" low="12"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T3C1" high="13" low="13"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T3C2" high="14" low="14"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T3C3" high="15" low="15"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T4C0" high="16" low="16"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T4C1" high="17" low="17"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T4C2" high="18" low="18"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T4C3" high="19" low="19"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T5C0" high="20" low="20"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T5C1" high="21" low="21"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T5C2" high="22" low="22"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T5C3" high="23" low="23"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T6C0" high="24" low="24"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T6C1" high="25" low="25"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T6C2" high="26" low="26"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T6C3" high="27" low="27"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T7C0" high="28" low="28"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T7C1" high="29" low="29"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T7C2" high="30" low="30"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="T7C3" high="31" low="31"><use-enum ref="ENABLE" /></bitfield>
+ </reg32>
+ <stripe offset="0x45C0" stride="0x0004" length="16">
+ <reg32 name="TX_BORDER_COLOR" access="rw" offset="0x0000">
+ <doc>Border Color for Map 0. Color used for borders. Format is the same as the texture being bordered.</doc>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4580" stride="0x0004" length="16">
+ <reg32 name="TX_CHROMA_KEY" access="rw" offset="0x0000">
+ <doc>Texture Chroma Key for Map 0. Color used for chroma key compare. Format is the same as the texture being keyed.</doc>
+ </reg32>
+ </stripe>
+ <reg32 name="TX_ENABLE" access="rw" offset="0x4104">
+ <doc>Texture Enables for Maps 0 to 15</doc>
+ <bitfield name="TEX_0_ENABLE" high="0" low="0">
+ <doc>Texture Map 0 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_1_ENABLE" high="1" low="1">
+ <doc>Texture Map 1 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_2_ENABLE" high="2" low="2">
+ <doc>Texture Map 2 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_3_ENABLE" high="3" low="3">
+ <doc>Texture Map 3 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_4_ENABLE" high="4" low="4">
+ <doc>Texture Map 4 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_5_ENABLE" high="5" low="5">
+ <doc>Texture Map 5 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_6_ENABLE" high="6" low="6">
+ <doc>Texture Map 6 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_7_ENABLE" high="7" low="7">
+ <doc>Texture Map 7 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_8_ENABLE" high="8" low="8">
+ <doc>Texture Map 8 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_9_ENABLE" high="9" low="9">
+ <doc>Texture Map 9 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_10_ENABLE" high="10" low="10">
+ <doc>Texture Map 10 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_11_ENABLE" high="11" low="11">
+ <doc>Texture Map 11 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_12_ENABLE" high="12" low="12">
+ <doc>Texture Map 12 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_13_ENABLE" high="13" low="13">
+ <doc>Texture Map 13 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_14_ENABLE" high="14" low="14">
+ <doc>Texture Map 14 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_15_ENABLE" high="15" low="15">
+ <doc>Texture Map 15 Enable.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <stripe offset="0x4400" stride="0x0004" length="16">
+ <reg32 name="TX_FILTER0" access="rw" offset="0x0000">
+ <doc>Texture Filter State for Map 0</doc>
+ <bitfield name="CLAMP_S" high="2" low="0">
+ <doc>Clamp mode for first texture coordinate</doc>
+ <use-enum ref="TX_FILTER_CLAMP" />
+ </bitfield>
+ <bitfield name="CLAMP_T" high="5" low="3">
+ <doc>Clamp mode for second texture coordinate</doc>
+ <use-enum ref="TX_FILTER_CLAMP" />
+ </bitfield>
+ <bitfield name="CLAMP_R" high="8" low="6">
+ <doc>Clamp mode for third texture coordinate</doc>
+ <use-enum ref="TX_FILTER_CLAMP" />
+ </bitfield>
+ <bitfield name="MAG_FILTER" high="10" low="9">
+ <doc>Filter used when texture is magnified</doc>
+ <use-enum ref="TX_R300MINMAG_FILTER" />
+ </bitfield>
+ <bitfield name="MIN_FILTER" high="12" low="11">
+ <doc>Filter used when texture is minified</doc>
+ <use-enum ref="TX_R300MINMAG_FILTER" />
+ </bitfield>
+ <bitfield name="MIP_FILTER" high="14" low="13">
+ <doc>Filter used between mipmap levels</doc>
+ <use-enum ref="TX_FILTER" />
+ </bitfield>
+ <bitfield name="VOL_FILTER" high="16" low="15">
+ <doc>Filter used between layers of a volume. (if no filter is specifed, select from MIN/MAG filters)</doc>
+ <use-enum ref="TX_FILTER" />
+ </bitfield>
+ <bitfield name="MAX_MIP_LEVEL" high="20" low="17"><doc>LOD index of largest (finest) mipmap to use (0 is largest). Ranges from 0 to NUM_LEVELS.</doc></bitfield>
+ <bitfield name="ID" high="31" low="28"><doc>Logical id for this physical texture</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4440" stride="0x0004" length="16">
+ <reg32 name="TX_FILTER1" access="rw" offset="0x0000">
+ <doc>Texture Filter State for Map 0</doc>
+ <bitfield name="CHROMA_KEY_MODE" high="1" low="0">
+ <doc>Chroma Key Mode</doc>
+ <use-enum ref="CHROMA_KEY" />
+ </bitfield>
+ <bitfield name="MC_ROUND" high="2" low="2">
+ <doc>Bilinear rounding mode</doc>
+ <use-enum ref="BILINEAR_ROUNDING" />
+ </bitfield>
+ <bitfield name="LOD_BIAS" high="12" low="3"><doc>(s4.5). Ranges from -16.0 to 15.99. Mipmap LOD bias measured in mipmap levels. Added to the signed, computed LOD before the LOD is clamped.</doc></bitfield>
+ <bitfield name="MC_COORD_TRUNCATE" high="14" low="14">
+ <doc>MPEG coordinate truncation mode</doc>
+ <use-enum ref="MPEG_TRUNC_MODE" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4480" stride="0x0004" length="16">
+ <reg32 name="TX_FORMAT0" access="rw" offset="0x0000">
+ <doc>Texture Format State for Map 0</doc>
+ <bitfield name="TXWIDTH" high="10" low="0"><doc>Image width - 1. The largest image is 2048 texels. When wrapping or mirroring, must be a power of 2. When mipmapping, must be a power of 2 or padded to a power of 2 in memory. Can always be non-square, except for cube maps which must be square.</doc></bitfield>
+ <bitfield name="TXHEIGHT" high="21" low="11"><doc>Image height - 1. The largest image is 2048 texels. When wrapping or mirroring, must be a power of 2. When mipmapping, must be a power of 2 or padded to a power of 2 in memory. Can always be non-square, except for cube maps which must be square.</doc></bitfield>
+ <bitfield name="TXDEPTH" high="25" low="22"><doc>LOG2(depth) of volume texture</doc></bitfield>
+ <bitfield name="NUM_LEVELS" high="29" low="26"><doc>Number of mipmap levels minus 1. Ranges from 0 to 11. Equivalent to LOD index of smallest (coarsest) mipmap to use.</doc></bitfield>
+ <bitfield name="PROJECTED" high="30" low="30">
+ <doc>Specifies whether texture coords are projected.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TXPITCH_EN" high="31" low="31">
+ <doc>Indicates when TXPITCH should be used instead of TXWIDTH for image addressing</doc>
+ <use-enum ref="TXWIDTH_OR_PITCH" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x44C0" stride="0x0004" length="16">
+ <reg32 name="TX_FORMAT1" access="rw" offset="0x0000">
+ <doc>Texture Format State for Map 0</doc>
+ <bitfield name="TXFORMAT" high="4" low="0">
+ <doc>Texture Format. Components are numbered right to left. Parenthesis indicate typical uses of each format.</doc>
+ <value value="0" name="TX_FMT_8"><doc>TX_FMT_8</doc></value>
+ <value value="1" name="TX_FMT_16"><doc>TX_FMT_16</doc></value>
+ <value value="2" name="TX_FMT_4_4"><doc>TX_FMT_4_4</doc></value>
+ <value value="3" name="TX_FMT_8_8"><doc>TX_FMT_8_8</doc></value>
+ <value value="4" name="TX_FMT_16_16"><doc>TX_FMT_16_16</doc></value>
+ <value value="5" name="TX_FMT_3_3_2"><doc>TX_FMT_3_3_2</doc></value>
+ <value value="6" name="TX_FMT_5_6_5"><doc>TX_FMT_5_6_5</doc></value>
+ <value value="7" name="TX_FMT_6_5_5"><doc>TX_FMT_6_5_5</doc></value>
+ <value value="8" name="TX_FMT_11_11_10"><doc>TX_FMT_11_11_10</doc></value>
+ <value value="9" name="TX_FMT_10_11_11"><doc>TX_FMT_10_11_11</doc></value>
+ <value value="10" name="TX_FMT_4_4_4_4"><doc>TX_FMT_4_4_4_4</doc></value>
+ <value value="11" name="TX_FMT_1_5_5_5"><doc>TX_FMT_1_5_5_5</doc></value>
+ <value value="12" name="TX_FMT_8_8_8_8"><doc>TX_FMT_8_8_8_8</doc></value>
+ <value value="13" name="TX_FMT_2_10_10_10"><doc>TX_FMT_2_10_10_10</doc></value>
+ <value value="14" name="TX_FMT_16_16_16_16"><doc>TX_FMT_16_16_16_16</doc></value>
+ <value value="18" name="TX_FMT_Y8"><doc>TX_FMT_Y8</doc></value>
+ <value value="19" name="TX_FMT_AVYU444"><doc>TX_FMT_AVYU444</doc></value>
+ <value value="20" name="TX_FMT_VYUY422"><doc>TX_FMT_VYUY422</doc></value>
+ <value value="21" name="TX_FMT_YVYU422"><doc>TX_FMT_YVYU422</doc></value>
+ <value value="22" name="TX_FMT_16_MPEG"><doc>TX_FMT_16_MPEG</doc></value>
+ <value value="23" name="TX_FMT_16_16_MPEG"><doc>TX_FMT_16_16_MPEG</doc></value>
+ <value value="24" name="TX_FMT_16F"><doc>TX_FMT_16f</doc></value>
+ <value value="25" name="TX_FMT_16F_16F"><doc>TX_FMT_16f_16f</doc></value>
+ <value value="26" name="TX_FMT_16F_16F_16F_16F"><doc>TX_FMT_16f_16f_16f_16f</doc></value>
+ <value value="27" name="TX_FMT_32F"><doc>TX_FMT_32f</doc></value>
+ <value value="28" name="TX_FMT_32F_32F"><doc>TX_FMT_32f_32f</doc></value>
+ <value value="29" name="TX_FMT_32F_32F_32F_32F"><doc>TX_FMT_32f_32f_32f_32f</doc></value>
+ <value value="30" name="TX_FMT_W24_FP"><doc>TX_FMT_W24_FP</doc></value>
+ </bitfield>
+ <bitfield name="SIGNED_COMP0" high="5" low="5">
+ <doc>Component0 filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="COMPONENT0_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_UNSIGNED"><doc>Component0 filter should interpret texel data as unsigned</doc></value>
+ <value value="1" name="COMPONENT0_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_SIGNED"><doc>Component0 filter should interpret texel data as signed</doc></value>
+ </bitfield>
+ <bitfield name="SIGNED_COMP1" high="6" low="6">
+ <doc>Component1 filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="COMPONENT1_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_UNSIGNED"><doc>Component1 filter should interpret texel data as unsigned</doc></value>
+ <value value="1" name="COMPONENT1_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_SIGNED"><doc>Component1 filter should interpret texel data as signed</doc></value>
+ </bitfield>
+ <bitfield name="SIGNED_COMP2" high="7" low="7">
+ <doc>Component2 filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="COMPONENT2_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_UNSIGNED"><doc>Component2 filter should interpret texel data as unsigned</doc></value>
+ <value value="1" name="COMPONENT2_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_SIGNED"><doc>Component2 filter should interpret texel data as signed</doc></value>
+ </bitfield>
+ <bitfield name="SIGNED_COMP3" high="8" low="8">
+ <doc>Component3 filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="COMPONENT3_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_UNSIGNED"><doc>Component3 filter should interpret texel data as unsigned</doc></value>
+ <value value="1" name="COMPONENT3_FILTER_SHOULD_INTERPRET_TEXEL_DATA_AS_SIGNED"><doc>Component3 filter should interpret texel data as signed</doc></value>
+ </bitfield>
+ <bitfield name="SEL_ALPHA" high="11" low="9">
+ <doc>Specifies swizzling for alpha channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="SELECT_TEXTURE_COMPONENT0_FOR_THE_ALPHA_CHANNEL_ARGB"><doc>Select Texture Component0 for the Alpha Channel.</doc></value>
+ <value value="1" name="SELECT_TEXTURE_COMPONENT1_FOR_THE_ALPHA_CHANNEL_ARGB"><doc>Select Texture Component1 for the Alpha Channel.</doc></value>
+ <value value="2" name="SELECT_TEXTURE_COMPONENT2_FOR_THE_ALPHA_CHANNEL_ARGB"><doc>Select Texture Component2 for the Alpha Channel.</doc></value>
+ <value value="3" name="SELECT_TEXTURE_COMPONENT3_FOR_THE_ALPHA_CHANNEL_ARGB"><doc>Select Texture Component3 for the Alpha Channel.</doc></value>
+ <value value="4" name="SELECT_THE_VALUE_0_FOR_THE_ALPHA_CHANNEL_ARGB"><doc>Select the value 0 for the Alpha Channel.</doc></value>
+ <value value="5" name="SELECT_THE_VALUE_1_FOR_THE_ALPHA_CHANNEL_ARGB"><doc>Select the value 1 for the Alpha Channel.</doc></value>
+ </bitfield>
+ <bitfield name="SEL_RED" high="14" low="12">
+ <doc>Specifies swizzling for red channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="SELECT_TEXTURE_COMPONENT0_FOR_THE_RED_CHANNEL_ARGB"><doc>Select Texture Component0 for the Red Channel.</doc></value>
+ <value value="1" name="SELECT_TEXTURE_COMPONENT1_FOR_THE_RED_CHANNEL_ARGB"><doc>Select Texture Component1 for the Red Channel.</doc></value>
+ <value value="2" name="SELECT_TEXTURE_COMPONENT2_FOR_THE_RED_CHANNEL_ARGB"><doc>Select Texture Component2 for the Red Channel.</doc></value>
+ <value value="3" name="SELECT_TEXTURE_COMPONENT3_FOR_THE_RED_CHANNEL_ARGB"><doc>Select Texture Component3 for the Red Channel.</doc></value>
+ <value value="4" name="SELECT_THE_VALUE_0_FOR_THE_RED_CHANNEL_ARGB"><doc>Select the value 0 for the Red Channel.</doc></value>
+ <value value="5" name="SELECT_THE_VALUE_1_FOR_THE_RED_CHANNEL_ARGB"><doc>Select the value 1 for the Red Channel.</doc></value>
+ </bitfield>
+ <bitfield name="SEL_GREEN" high="17" low="15">
+ <doc>Specifies swizzling for green channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="SELECT_TEXTURE_COMPONENT0_FOR_THE_GREEN_CHANNEL_ARGB"><doc>Select Texture Component0 for the Green Channel.</doc></value>
+ <value value="1" name="SELECT_TEXTURE_COMPONENT1_FOR_THE_GREEN_CHANNEL_ARGB"><doc>Select Texture Component1 for the Green Channel.</doc></value>
+ <value value="2" name="SELECT_TEXTURE_COMPONENT2_FOR_THE_GREEN_CHANNEL_ARGB"><doc>Select Texture Component2 for the Green Channel.</doc></value>
+ <value value="3" name="SELECT_TEXTURE_COMPONENT3_FOR_THE_GREEN_CHANNEL_ARGB"><doc>Select Texture Component3 for the Green Channel.</doc></value>
+ <value value="4" name="SELECT_THE_VALUE_0_FOR_THE_GREEN_CHANNEL_ARGB"><doc>Select the value 0 for the Green Channel.</doc></value>
+ <value value="5" name="SELECT_THE_VALUE_1_FOR_THE_GREEN_CHANNEL_ARGB"><doc>Select the value 1 for the Green Channel.</doc></value>
+ </bitfield>
+ <bitfield name="SEL_BLUE" high="20" low="18">
+ <doc>Specifies swizzling for blue channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <value value="0" name="SELECT_TEXTURE_COMPONENT0_FOR_THE_BLUE_CHANNEL_ARGB"><doc>Select Texture Component0 for the Blue Channel.</doc></value>
+ <value value="1" name="SELECT_TEXTURE_COMPONENT1_FOR_THE_BLUE_CHANNEL_ARGB"><doc>Select Texture Component1 for the Blue Channel.</doc></value>
+ <value value="2" name="SELECT_TEXTURE_COMPONENT2_FOR_THE_BLUE_CHANNEL_ARGB"><doc>Select Texture Component2 for the Blue Channel.</doc></value>
+ <value value="3" name="SELECT_TEXTURE_COMPONENT3_FOR_THE_BLUE_CHANNEL_ARGB"><doc>Select Texture Component3 for the Blue Channel.</doc></value>
+ <value value="4" name="SELECT_THE_VALUE_0_FOR_THE_BLUE_CHANNEL_ARGB"><doc>Select the value 0 for the Blue Channel.</doc></value>
+ <value value="5" name="SELECT_THE_VALUE_1_FOR_THE_BLUE_CHANNEL_ARGB"><doc>Select the value 1 for the Blue Channel.</doc></value>
+ </bitfield>
+ <bitfield name="GAMMA" high="21" low="21">
+ <doc>Optionally remove gamma from texture before passing to shader. Only apply to 8bit or less components.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="YUV_TO_RGB" high="23" low="22">
+ <doc>YUV to RGB conversion mode</doc>
+ <use-enum ref="YUV_TO_RGB_MODE" />
+ </bitfield>
+ <bitfield name="SWAP_YUV" high="24" low="24"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="TEX_COORD_TYPE" high="26" low="25">
+ <doc>Specifies coordinate type.</doc>
+ <use-enum ref="COORD_TYPE" />
+ </bitfield>
+ <bitfield name="CACHE" high="31" low="27">
+ <doc>Multi-texture performance can be optimized and made deterministic by assigning textures to separate regions under sw control.</doc>
+ <use-enum ref="TEXCACHE" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4500" stride="0x0004" length="16">
+ <reg32 name="TX_FORMAT2" access="rw" offset="0x0000">
+ <doc>Texture Format State for Map 0</doc>
+ <bitfield name="TXPITCH" high="13" low="0"><doc>Used instead of TXWIDTH for image addressing when TXPITCH_EN is asserted. Pitch is given as number of texels minus one. Maximum pitch is 16K texels.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="TX_INVALTAGS" access="rw" offset="0x4100">
+ <doc>Invalidate texture cache tags</doc>
+ </reg32>
+ <stripe offset="0x4540" stride="0x0004" length="16">
+ <reg32 name="TX_OFFSET" access="rw" offset="0x0000">
+ <doc>Texture Offset State for Map 0</doc>
+ <bitfield name="ENDIAN_SWAP" high="1" low="0">
+ <doc>Endian Control</doc>
+ <use-enum ref="BYTESWAP" />
+ </bitfield>
+ <bitfield name="MACRO_TILE" high="2" low="2">
+ <doc>Macro Tile Control</doc>
+ <use-enum ref="MACROTILE" />
+ </bitfield>
+ <bitfield name="MICRO_TILE" high="4" low="3">
+ <doc>Micro Tile Control</doc>
+ <use-enum ref="MICROTILE" />
+ </bitfield>
+ <bitfield name="TXOFFSET" high="31" low="5"><doc>32-byte aligned pointer to base map</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x47C0" stride="0x0004" length="64">
+ <reg32 name="US_ALU_ALPHA_ADDR" access="rw" offset="0x0000">
+ <doc>This table specifies the Alpha source addresses for up to 64 ALU instruction. The ALU expects 6 source operands - three for color (rgb0, rgb1, rgb2) and three for alpha (a0, a1, a2).</doc>
+ <bitfield name="ADDR0" high="5" low="0"><doc>Specifies the identity of source operands a0, a1, and a2. Values 0 through 31 specify a location within the current pixel stack frame. Values 32 through 63 specify a constant.</doc></bitfield>
+ <bitfield name="ADDR1" high="11" low="6"><doc>Specifies the identity of source operands a0, a1, and a2. Values 0 through 31 specify a location within the current pixel stack frame. Values 32 through 63 specify a constant.</doc></bitfield>
+ <bitfield name="ADDR2" high="17" low="12"><doc>Specifies the identity of source operands a0, a1, and a2. Values 0 through 31 specify a location within the current pixel stack frame. Values 32 through 63 specify a constant.</doc></bitfield>
+ <bitfield name="ADDRD" high="22" low="18"><doc>Specifies the address of the pixel stack frame register to which the Alpha result of this instruction is to be written.</doc></bitfield>
+ <bitfield name="WMASK" high="23" low="23">
+ <doc>Specifies whether or not to write the Alpha component of the result for this instruction to the pixel stack frame.</doc>
+ <value value="0" name="NONE"><doc>NONE: No not write register.</doc></value>
+ <value value="1" name="A"><doc>A: Write the alpha channel only.</doc></value>
+ </bitfield>
+ <bitfield name="OMASK" high="24" low="24">
+ <doc>Specifies whether or not to write the Alpha component of the result of this instruction to the output fifo.</doc>
+ <value value="0" name="NONE"><doc>NONE: No not write output.</doc></value>
+ <value value="1" name="A"><doc>A: Write the alpha channel only.</doc></value>
+ </bitfield>
+ <bitfield name="TARGET" high="26" low="25"><doc>Specifies which frame buffer target to write to.</doc></bitfield>
+ <bitfield name="OMASK_W" high="27" low="27">
+ <doc>Specifies whether or not to write the Alpha component of the result of this instuction to the depth output fifo.</doc>
+ <value value="0" name="NONE"><doc>NONE: No not write output to w.</doc></value>
+ <value value="1" name="A"><doc>A: Write the alpha channel only.</doc></value>
+ </bitfield>
+ <bitfield name="STAT_WE" high="31" low="28"><doc>Specifies which components (R,G,B,A) contribute to the stat count (see performance counter field in US_CONFIG).</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x49C0" stride="0x0004" length="64">
+ <reg32 name="US_ALU_ALPHA_INST" access="rw" offset="0x0000">
+ <doc>ALU Alpha Instruction</doc>
+ <bitfield name="SEL_A" high="4" low="0">
+ <doc>Specifies the operand and component select for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_ALPHA_SWIZZLE_R300" />
+ </bitfield>
+ <bitfield name="MOD_A" high="6" low="5">
+ <doc>Specifies the modifier for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="SEL_B" high="11" low="7">
+ <doc>Specifies the operand and component select for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_ALPHA_SWIZZLE_R300" />
+ </bitfield>
+ <bitfield name="MOD_B" high="13" low="12">
+ <doc>Specifies the modifier for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="SEL_C" high="18" low="14">
+ <doc>Specifies the operand and component select for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_ALPHA_SWIZZLE_R300" />
+ </bitfield>
+ <bitfield name="MOD_C" high="20" low="19">
+ <doc>Specifies the modifier for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="SRCP_OP" high="22" low="21">
+ <doc>Specifies how the pre-subtract value (SRCP) is computed</doc>
+ <use-enum ref="ENUM99" />
+ </bitfield>
+ <bitfield name="OP" high="26" low="23">
+ <doc>Specifies the operand for this instruction.</doc>
+ <value value="0" name="OP_MAD"><doc>OP_MAD: Result = A*B + C</doc></value>
+ <value value="1" name="OP_DP"><doc>OP_DP: Result = dot product from RGB ALU</doc></value>
+ <value value="2" name="OP_MIN"><doc>OP_MIN: Result = min(A,B)</doc></value>
+ <value value="3" name="OP_MAX"><doc>OP_MAX: Result = max(A,B)</doc></value>
+ <value value="5" name="OP_CND"><doc>OP_CND: Result = cnd(A,B,C) = (C&gt;0.5)?A:B</doc></value>
+ <value value="6" name="OP_CMP"><doc>OP_CMP: Result = cmp(A,B,C) = (C&gt;=0.0)?A:B</doc></value>
+ <value value="7" name="OP_FRC"><doc>OP_FRC: Result = fractional(A)</doc></value>
+ <value value="8" name="OP_EX2"><doc>OP_EX2: Result = 2^^A</doc></value>
+ <value value="9" name="OP_LN2"><doc>OP_LN2: Result = log2(A)</doc></value>
+ <value value="10" name="OP_RCP"><doc>OP_RCP: Result = 1/A</doc></value>
+ <value value="11" name="OP_RSQ"><doc>OP_RSQ: Result = 1/sqrt(A)</doc></value>
+ </bitfield>
+ <bitfield name="OMOD" high="29" low="27">
+ <doc>Specifies the output modifier for this instruction.</doc>
+ <use-enum ref="ALU_OUTPUT_MOD" />
+ </bitfield>
+ <bitfield name="CLAMP" high="30" low="30">
+ <doc>Specifies clamp mode for this instruction.</doc>
+ <use-enum ref="CLAMP_MODE" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x46C0" stride="0x0004" length="64">
+ <reg32 name="US_ALU_RGB_ADDR" access="rw" offset="0x0000">
+ <doc>This table specifies the RGB source and destination addresses for up to 64 ALU instructions. The ALU expects 6 source operands - three for color (rgb0, rgb1, rgb2) and three for alpha (a0, a1, a2).</doc>
+ <bitfield name="ADDR0" high="5" low="0"><doc>Specifies the identity of source operands rgb0, rgb1, and rgb2. Values 0 through 31 specify a location within the current pixel stack frame. Values 32 through 63 specify a constant.</doc></bitfield>
+ <bitfield name="ADDR1" high="11" low="6"><doc>Specifies the identity of source operands rgb0, rgb1, and rgb2. Values 0 through 31 specify a location within the current pixel stack frame. Values 32 through 63 specify a constant.</doc></bitfield>
+ <bitfield name="ADDR2" high="17" low="12"><doc>Specifies the identity of source operands rgb0, rgb1, and rgb2. Values 0 through 31 specify a location within the current pixel stack frame. Values 32 through 63 specify a constant.</doc></bitfield>
+ <bitfield name="ADDRD" high="22" low="18"><doc>Specifies the address of the pixel stack frame register to which the RGB result of this instruction is to be written.</doc></bitfield>
+ <bitfield name="WMASK" high="25" low="23">
+ <doc>Specifies which of the R, G, and B components of the result of this instruction are written to the pixel stack frame.</doc>
+ <use-enum ref="WRITE_MASK" />
+ </bitfield>
+ <bitfield name="OMASK" high="28" low="26">
+ <doc>Specifies which of the R, G, and B components of the result of this instruction are written to the output fifo.</doc>
+ <use-enum ref="WRITE_MASK" />
+ </bitfield>
+ <bitfield name="TARGET" high="30" low="29"><doc>Specifies which frame buffer target to write to.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x48C0" stride="0x0004" length="64">
+ <reg32 name="US_ALU_RGB_INST" access="rw" offset="0x0000">
+ <doc>ALU RGB Instruction</doc>
+ <bitfield name="SEL_A" high="4" low="0">
+ <doc>Specifies the operand and component select for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_RGB_SWIZZLE_R300" />
+ </bitfield>
+ <bitfield name="MOD_A" high="6" low="5">
+ <doc>Specifies the modifier for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="SEL_B" high="11" low="7">
+ <doc>Specifies the operand and component select for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_RGB_SWIZZLE_R300" />
+ </bitfield>
+ <bitfield name="MOD_B" high="13" low="12">
+ <doc>Specifies the modifier for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="SEL_C" high="18" low="14">
+ <doc>Specifies the operand and component select for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_RGB_SWIZZLE_R300" />
+ </bitfield>
+ <bitfield name="MOD_C" high="20" low="19">
+ <doc>Specifies the modifier for inputs A, B, and C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="SRCP_OP" high="22" low="21">
+ <doc>Specifies how the pre-subtract value (SRCP) is computed</doc>
+ <use-enum ref="ENUM105" />
+ </bitfield>
+ <bitfield name="OP" high="26" low="23">
+ <doc>Specifies the operand for this instruction.</doc>
+ <value value="0" name="OP_MAD"><doc>OP_MAD: Result = A*B + C</doc></value>
+ <value value="1" name="OP_DP3"><doc>OP_DP3: Result = A.r*B.r + A.g*B.g + A.b*B.b</doc></value>
+ <value value="2" name="OP_DP4"><doc>OP_DP4: Result = A.r*B.r + A.g*B.g + A.b*B.b + A.a*B.a</doc></value>
+ <value value="3" name="OP_D2A"><doc>OP_D2A: Result = A.r*B.r + A.g*B.g + C.b</doc></value>
+ <value value="4" name="OP_MIN"><doc>OP_MIN: Result = min(A,B)</doc></value>
+ <value value="5" name="OP_MAX"><doc>OP_MAX: Result = max(A,B)</doc></value>
+ <value value="7" name="OP_CND"><doc>OP_CND: Result = cnd(A,B,C) = (C&gt;0.5)?A:B</doc></value>
+ <value value="8" name="OP_CMP"><doc>OP_CMP: Result = cmp(A,B,C) = (C&gt;=0.0)?A:B</doc></value>
+ <value value="9" name="OP_FRC"><doc>OP_FRC: Result = frac(A)</doc></value>
+ <value value="10" name="OP_SOP"><doc>OP_SOP: Result = ex2,ln2,rcp,rsq from Alpha ALU</doc></value>
+ </bitfield>
+ <bitfield name="OMOD" high="29" low="27">
+ <doc>Specifies the output modifier for this instruction.</doc>
+ <use-enum ref="ALU_OUTPUT_MOD" />
+ </bitfield>
+ <bitfield name="CLAMP" high="30" low="30">
+ <doc>Specifies clamp mode for this instruction.</doc>
+ <use-enum ref="CLAMP_MODE" />
+ </bitfield>
+ <bitfield name="NOP" high="31" low="31">
+ <doc>Specifies whether to insert a NOP instruction after this. This would get specified in order to meet dependency requirements for the pre-subtract inputs.</doc>
+ <value value="0" name="DO_NOT_INSERT_NOP_INSTRUCTION_AFTER_THIS_ONE"><doc>Do not insert NOP instruction after this one</doc></value>
+ <value value="1" name="INSERT_A_NOP_INSTRUCTION_AFTER_THIS_ONE"><doc>Insert a NOP instruction after this one</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4610" stride="0x0004" length="4">
+ <reg32 name="US_CODE_ADDR" access="rw" offset="0x0000">
+ <doc>Code Address for Indirection Levels 0 to 3</doc>
+ <bitfield name="ALU_START" high="5" low="0"><doc>Specifies the start address of the ALU microcode segment associated with the current indirection level (0:63)</doc></bitfield>
+ <bitfield name="ALU_SIZE" high="11" low="6"><doc>Specifies the size of the ALU microcode segment associated with the current indirection level (1:64)</doc></bitfield>
+ <bitfield name="TEX_START" high="16" low="12"><doc>Specifies the start address of the texture microcode segment associated with the current indirection level (0:31)</doc></bitfield>
+ <bitfield name="TEX_SIZE" high="21" low="17"><doc>Specifies the size of the texture microcode segment associated with the current indirection level (1:32)</doc></bitfield>
+ <bitfield name="RGBA_OUT" high="22" low="22"><doc>Indicates at least one RGBA output instruction at this level</doc></bitfield>
+ <bitfield name="W_OUT" high="23" low="23"><doc>Indicates at least one W output instruction at this level</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_CODE_OFFSET" access="rw" offset="0x4608">
+ <doc>Specifies the offset and size for the ALU and Texture micrcode. These values are used to support relocatable code, and to support register writes to the code store without requiring a pipeline flush.</doc>
+ <bitfield name="ALU_OFFSET" high="5" low="0"><doc>Specifies the offset for the ALU code. This value is added to the ALU_START field in the US_CODE_ADDR registers (0:63)</doc></bitfield>
+ <bitfield name="ALU_SIZE" high="12" low="6"><doc>Specifies the total size for the ALU code for all levels (0:64)</doc></bitfield>
+ <bitfield name="TEX_OFFSET" high="17" low="13"><doc>Specifies the offset for the Texture code. This value is added to the TEX_START field in the US_CODE_ADDR registers (0:31)</doc></bitfield>
+ <bitfield name="TEX_SIZE" high="23" low="18"><doc>Specifies the total size for the Texture code for all levels (0:32)</doc></bitfield>
+ </reg32>
+ <reg32 name="US_CONFIG" access="rw" offset="0x4600">
+ <doc>Shader Configuration</doc>
+ <bitfield name="NLEVEL" high="2" low="0">
+ <doc>Specifies the valid indirection levels.</doc>
+ <value value="0" name="LEVEL_3_ONLY"><doc>Level 3 only (normal DX7-style texturing)</doc></value>
+ <value value="1" name="LEVELS_2_AND_3"><doc>Levels 2 and 3 (DX8-style bump mapping)</doc></value>
+ <value value="2" name="LEVELS_1"><doc>Levels 1, 2, and 3</doc></value>
+ <value value="3" name="LEVELS_0"><doc>Levels 0, 1, 2, and 3</doc></value>
+ </bitfield>
+ <bitfield name="FIRST_TEX" high="3" low="3">
+ <doc>Specifies whether or not the texture code for the first valid level is enabled</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <stripe offset="0x46A4" stride="0x0004" length="4">
+ <reg32 name="US_OUT_FMT" access="rw" offset="0x0000">
+ <doc>Specifies how the shader output is written to the fog unit for each of up to four render targets</doc>
+ <bitfield name="OUT_FMT" high="4" low="0">
+ <doc>Specifies the number and size of components</doc>
+ <use-enum ref="COLOR_FORMAT" />
+ </bitfield>
+ <bitfield name="C0_SEL" high="9" low="8">
+ <doc>Specifies the source for components C0, C1, C2, C3</doc>
+ <use-enum ref="CHANNEL_ARGB" />
+ </bitfield>
+ <bitfield name="C1_SEL" high="11" low="10">
+ <doc>Specifies the source for components C0, C1, C2, C3</doc>
+ <use-enum ref="CHANNEL_ARGB" />
+ </bitfield>
+ <bitfield name="C2_SEL" high="13" low="12">
+ <doc>Specifies the source for components C0, C1, C2, C3</doc>
+ <use-enum ref="CHANNEL_ARGB" />
+ </bitfield>
+ <bitfield name="C3_SEL" high="15" low="14">
+ <doc>Specifies the source for components C0, C1, C2, C3</doc>
+ <use-enum ref="CHANNEL_ARGB" />
+ </bitfield>
+ <bitfield name="OUT_SIGN" high="19" low="16"><doc>Mask specifying whether components C3, C2, C1 and C0 are signed (C4_8, C_16, C2_16 and C4_16 formats only)</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_PIXSIZE" access="rw" offset="0x4604">
+ <doc>Shader pixel size. This register specifies the size and partitioning of the current pixel stack frame</doc>
+ <bitfield name="PIX_SIZE" high="4" low="0"><doc>Specifies the total size of the current pixel stack frame (1:32)</doc></bitfield>
+ </reg32>
+ <stripe offset="0x4620" stride="0x0004" length="32">
+ <reg32 name="US_TEX_INST" access="rw" offset="0x0000">
+ <doc>Texture Instruction</doc>
+ <bitfield name="SRC_ADDR" high="4" low="0"><doc>Specifies the location (within the shader pixel stack frame) of the texture address for this instruction</doc></bitfield>
+ <bitfield name="DST_ADDR" high="10" low="6"><doc>Specifies the location (within the shader pixel stack frame) of the returned texture data for this instruction</doc></bitfield>
+ <bitfield name="TEX_ID" high="14" low="11"><doc>Specifies the id of the texture map used for this instruction</doc></bitfield>
+ <bitfield name="INST" high="17" low="15">
+ <doc>Specifies the operation taking place for this instruction</doc>
+ <value value="0" name="NOP"><doc>NOP: Do nothing</doc></value>
+ <value value="1" name="LD"><doc>LD: Do Texture Lookup (S,T,R)</doc></value>
+ <value value="2" name="TEXKILL"><doc>TEXKILL: Kill pixel if any component is &lt; 0</doc></value>
+ <value value="3" name="PROJ"><doc>PROJ: Do projected texture lookup (S/Q,T/Q,R/Q)</doc></value>
+ <value value="4" name="LODBIAS"><doc>LODBIAS: Do texture lookup with lod bias</doc></value>
+ </bitfield>
+ <bitfield name="OMOD" high="18" low="18"><doc>unused</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_W_FMT" access="rw" offset="0x46B4">
+ <doc>Specifies the source and format for the Depth (W) value output by the shader</doc>
+ <bitfield name="W_FMT" high="1" low="0">
+ <doc>Format for W</doc>
+ <value value="0" name="W0"><doc>W0 - W is always zero</doc></value>
+ <value value="1" name="W24"><doc>W24 - 24-bit fixed point</doc></value>
+ <value value="2" name="W24_FP"><doc>W24_FP - 24-bit floating point</doc></value>
+ </bitfield>
+ <bitfield name="W_SRC" high="2" low="2">
+ <doc>Source for W</doc>
+ <use-enum ref="WSRC" />
+ </bitfield>
+ </reg32>
+ <stripe offset="0x4C0C" stride="0x0010" length="32">
+ <reg32 name="US_ALU_CONST_A" access="rw" offset="0x0000">
+ <doc>Shader Constant Color 0 Alpha Component</doc>
+ <bitfield name="KA" high="23" low="0"><doc>Specifies the alpha component; (S16E7) fixed format.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4C08" stride="0x0010" length="32">
+ <reg32 name="US_ALU_CONST_B" access="rw" offset="0x0000">
+ <doc>Shader Constant Color 0 Blue Component</doc>
+ <bitfield name="KB" high="23" low="0"><doc>Specifies the blue component; (S16E7) fixed format.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4C04" stride="0x0010" length="32">
+ <reg32 name="US_ALU_CONST_G" access="rw" offset="0x0000">
+ <doc>Shader Constant Color 0 Green Component</doc>
+ <bitfield name="KG" high="23" low="0"><doc>Specifies the green component; (S16E7) fixed format.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4C00" stride="0x0010" length="32">
+ <reg32 name="US_ALU_CONST_R" access="rw" offset="0x0000">
+ <doc>Shader Constant Color 0 Red Component</doc>
+ <bitfield name="KR" high="23" low="0"><doc>Specifies the red component; (S16E7) fixed format.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="VAP_CLIP_CNTL" access="rw" offset="0x221C">
+ <doc>Control Bits for User Clip Planes and Clipping</doc>
+ <bitfield name="UCP_ENA_0" high="0" low="0"><doc>Enable User Clip Plane 0</doc></bitfield>
+ <bitfield name="UCP_ENA_1" high="1" low="1"><doc>Enable User Clip Plane 1</doc></bitfield>
+ <bitfield name="UCP_ENA_2" high="2" low="2"><doc>Enable User Clip Plane 2</doc></bitfield>
+ <bitfield name="UCP_ENA_3" high="3" low="3"><doc>Enable User Clip Plane 3</doc></bitfield>
+ <bitfield name="UCP_ENA_4" high="4" low="4"><doc>Enable User Clip Plane 4</doc></bitfield>
+ <bitfield name="UCP_ENA_5" high="5" low="5"><doc>Enable User Clip Plane 5</doc></bitfield>
+ <bitfield name="PS_UCP_MODE" high="15" low="14"><doc>0 = Cull using distance from center of point 1 = Cull using radius-based distance from center of point 2 = Cull using radius-based distance from center of point, Expand and Clip on intersection 3 = Always expand and clip as trifan</doc></bitfield>
+ <bitfield name="CLIP_DISABLE" high="16" low="16"><doc>Disables clip code generation and clipping process for TCL</doc></bitfield>
+ <bitfield name="UCP_CULL_ONLY_ENA" high="17" low="17"><doc>Cull Primitives against UCPS, but don't clip</doc></bitfield>
+ <bitfield name="BOUNDARY_EDGE_FLAG_ENA" high="18" low="18"><doc>If set, boundary edges are highlighted, else they are not highlighted</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_CNTL" access="rw" offset="0x2080">
+ <doc>Vertex Assembler/Processor Control Register</doc>
+ <bitfield name="PVS_NUM_SLOTS" high="3" low="0"><doc>Specifies the number of vertex slots to be used in the VAP PVS process. A slot represents a single vertex storage location1 across multiple engines (one vertex per engine). By decreasing the number of slots, there is more memory for each vertex, but less parallel processing. Similarly, by increasing the number of slots, thre is less memory per vertex but more vertices being processed in parallel.</doc></bitfield>
+ <bitfield name="PVS_NUM_CNTLRS" high="7" low="4"><doc>Specifies the maximum number of controllers to be processing in parallel. In general should be set to max value of TBD. Can be changed for performance analysis.</doc></bitfield>
+ <bitfield name="PVS_NUM_FPUS" high="11" low="8"><doc>Specifies the number of Floating Point Units (Vector/Math Engines) to use when processing vertices.</doc></bitfield>
+ <bitfield name="VF_MAX_VTX_NUM" high="21" low="18"><doc>This field controls the number of vertices that the vertex fetcher manages for the TCL and Setup Vertex Storage memories (and therefore the number of vertices that can be re-used). This value should be set to 12 for most operation, This number may be modified for performance evaluation. The value is the maximum vertex number used which is one less than the number of vertices (i.e. a 12 means 13 vertices will be used)</doc></bitfield>
+ <bitfield name="DX_CLIP_SPACE_DEF" high="22" low="22">
+ <doc>Clip space is defined as:</doc>
+ <use-enum ref="CLIP_SPACE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="VAP_CNTL_STATUS" access="rw" offset="0x2140">
+ <doc>Vertex Assemblen/Processor Control Status</doc>
+ <bitfield name="VC_SWAP" high="1" low="0"><doc>Endian-Swap Control. 0 = No swap 1 = 16-bit swap: 0xAABBCCDD becomes 0xBBAADDCC 2 = 32-bit swap: 0xAABBCCDD becomes 0xDDCCBBAA 3 = Half-dword swap: 0xAABBCCDD becomes 0xCCDDAABB Default = 0</doc></bitfield>
+ <bitfield name="PVS_BYPASS" high="8" low="8"><doc>The TCL engine is logically or physically removed from the circuit.</doc></bitfield>
+ <bitfield name="PVS_BUSY" high="11" low="11"><doc>Transform/Clip/Light (TCL) Engine is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VS_BUSY" high="24" low="24"><doc>Vertex Store is Busy. Read-only.</doc></bitfield>
+ <bitfield name="RCP_BUSY" high="25" low="25"><doc>Reciprocal Engine is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VTE_BUSY" high="26" low="26"><doc>ViewPort Transform Engine is Busy. Read-only.</doc></bitfield>
+ <bitfield name="MIU_BUSY" high="27" low="27"><doc>Memory Interface Unit is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VC_BUSY" high="28" low="28"><doc>Vertex Cache is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VF_BUSY" high="29" low="29"><doc>Vertex Fetcher is Busy. Read-only.</doc></bitfield>
+ <bitfield name="REGPIPE_BUSY" high="30" low="30"><doc>Register Pipeline is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VAP_BUSY" high="31" low="31"><doc>VAP Engine is Busy. Read-only.</doc></bitfield>
+ </reg32>
+ <stripe offset="0x2150" stride="0x0004" length="8">
+ <reg32 name="VAP_PROG_STREAM_CNTL" access="rw" offset="0x0000">
+ <doc>Programmable Stream Control Word 0</doc>
+ <bitfield name="DATA_TYPE_0" high="3" low="0"><doc>The data type for element 0 0 = FLOAT_1 (Single IEEE Float) 1 = FLOAT_2 (2 IEEE floats) 2 = FLOAT_3 (3 IEEE Floats) 3 = FLOAT_4 (4 IEEE Floats) 4 = BYTE * (1 DWORD w 4 8-bit fixed point values) (X = [7:0], Y = [15:8], Z = [23:16], W = [31:24]) 5 = D3DCOLOR * (Same as BYTE except has X-&gt;Z,Z- &gt;X swap for D3D color def) (Z = [7:0], Y = [15:8], X = [23:16], W = [31:24]) 6 = SHORT_2 * (1 DWORD with 2 16-bit fixed point values) (X = [15:0], Y = [31:16], Z = 0.0, W = 1.0) 7 = SHORT_4 * (2 DWORDS with 4(2 per dword) 16- bit fixed point values) (X = DW0 [15:0], Y = DW0 [31:16], Z = DW1 [15:0], W = DW1 [31:16]) 8 = VECTOR_3_TTT * (1 DWORD with 3 10-bit fixed point values) (X = [9:0], Y = [19:10], Z = [29:20], W = 1.0) 9 = VECTOR_3_EET * (1 DWORD with 2 11-bit and 1 10-bit fixed point values) (X = [10:0], Y = [21:11], Z = [31:22], W = 1.0) * These data types use the SIGNED and NORMALIZE flags described below.</doc></bitfield>
+ <bitfield name="SKIP_DWORDS_0" high="7" low="4"><doc>The number of DWORDS to skip (discard) after processing the current element.</doc></bitfield>
+ <bitfield name="DST_VEC_LOC_0" high="12" low="8"><doc>The vector address in the input memory to write this element</doc></bitfield>
+ <bitfield name="LAST_VEC_0" high="13" low="13">
+ <doc>If set, indicates the last vector of the current vertex stream</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SIGNED_0" high="14" low="14">
+ <doc>Determines whether fixed point data types are unsigned (0) or 2's complement signed (1) data types. See NORMALIZE for complete description of affect</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="NORMALIZE_0" high="15" low="15">
+ <doc>Determines whether the fixed to floating point conversion will normalize the value (i.e. fixed point value is all fractional bits) or not (i.e. fixed point value is all integer bits). This table describes the fixed to float conversion results SIGNED NORMALIZE FLT RANGE 0 0 0.0 - (2^n - 1) (i.e. 8-bit -&gt; 0.0 - 255.0) 0 1 0.0 - 1.0 1 0 -2^(n-1) - (2^(n-1) - 1) (i.e. 8-bit -&gt; -128.0 - 127.0) 1 1 -1.0 - 1.0 where n is the number of bits in the associated fixed point value For signed, normalize conversion, since the fixed point range is not evenly distributed around 0, there are 3 different methods supported by R300. See the VAP_PSC_SGN_NORM_CNTL description for details.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SKIP_DWORDS_1" high="23" low="20"><doc>See SKIP_DWORDS_0</doc></bitfield>
+ <bitfield name="DST_VEC_LOC_1" high="28" low="24"><doc>See DST_VEC_LOC_0</doc></bitfield>
+ <bitfield name="LAST_VEC_1" high="29" low="29">
+ <doc>See LAST_VEC_0</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SIGNED_1" high="30" low="30">
+ <doc>See SIGNED_0</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="NORMALIZE_1" high="31" low="31">
+ <doc>See NORMALIZE_0</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x2290" stride="0x0004" length="16">
+ <reg32 name="VAP_PVS_FLOW_CNTL_LOOP_INDEX" access="rw" offset="0x0000">
+ <doc>Programmable Vertex Shader Flow Control Loop Index Register 0</doc>
+ <bitfield name="PVS_FC_LOOP_INIT_VAL_0" high="7" low="0"><doc>This field stores the automatic loop index register init value. This is an 8-bit unsigned value 0-255. This field is only used if the corresponding control flow instruction is a loop.</doc></bitfield>
+ <bitfield name="PVS_FC_LOOP_STEP_VAL_0" high="15" low="8"><doc>This field stores the automatic loop index register step value. This is an 8-bit 2's comp signed value -128-127. This field is only used if the corresponding control flow instruction is a loop.</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="VAP_VF_CNTL" access="rw" offset="0x2084">
+ <doc>Vertex Fetcher Control</doc>
+ <bitfield name="PRIM_TYPE" high="3" low="0">
+ <doc>Primitive Type</doc>
+ <use-enum ref="PRIM_TYPE" />
+ </bitfield>
+ <bitfield name="PRIM_WALK" high="5" low="4">
+ <doc>Method of Passing Vertex Data.</doc>
+ <use-enum ref="VERTEX_DATA_PASS_MODE" />
+ </bitfield>
+ <bitfield name="INDEX_SIZE" high="11" low="11"><doc>When set, vertex indices are 32-bits/indx, otherwise, 16- bits/indx.</doc></bitfield>
+ <bitfield name="VTX_REUSE_DIS" high="12" low="12"><doc>When set, vertex reuse is disabled. DO NOT SET unless PRIM_WALK is Indexes.</doc></bitfield>
+ <bitfield name="DUAL_INDEX_MODE" high="13" low="13"><doc>When set, the incoming index is treated as two separate indices. Bits 23-16 are used as the index for AOS 0 (These are 0 for 16-bit indices) Bits 15-0 are used as the index for AOS 1-15. This mode was added specifically for HOS usage</doc></bitfield>
+ <bitfield name="NUM_VERTICES" high="31" low="16"><doc>Number of vertices in the command packet.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VTX_NUM_ARRAYS" access="rw" offset="0x20C0">
+ <doc>Vertex Array of Structures Control</doc>
+ <bitfield name="VTX_NUM_ARRAYS" high="4" low="0"><doc>The number of arrays required to represent the current vertex type. Each Array is described by the following three fields: VTX_AOS_ADDR, VTX_AOS_COUNT, VTX_AOS_STRIDE.</doc></bitfield>
+ <bitfield name="VC_FORCE_PREFETCH" high="5" low="5"><doc>Force Vertex Data Pre-fetching. If this bit is set, then a 256-bit word will always be fetched, regardless of which dwords are needed. Typically useful when VAP_VF_CNTL.PRIM_WALK is set to Vertex List (Auto-incremented indices).</doc></bitfield>
+ <bitfield name="AOS_0_FETCH_SIZE" high="16" low="16"><doc>Granule Size to Fetch for AOS 0. 0 = 128-bit granule size 1 = 256-bit granule size This allows the driver to program the fetch size based on DWORDS/VTX/AOS combined with AGP vs. LOC Memory. The general belief is that the granule size should always be 256-bits for LOC memory and AGP8X data, but should be 128-bit for AGP2X/4X data if the DWORDS/VTX/AOS is less than TBD (128?) bits.</doc></bitfield>
+ <bitfield name="AOS_1_FETCH_SIZE" high="17" low="17"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_2_FETCH_SIZE" high="18" low="18"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_3_FETCH_SIZE" high="19" low="19"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_4_FETCH_SIZE" high="20" low="20"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_5_FETCH_SIZE" high="21" low="21"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_6_FETCH_SIZE" high="22" low="22"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_7_FETCH_SIZE" high="23" low="23"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_8_FETCH_SIZE" high="24" low="24"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_9_FETCH_SIZE" high="25" low="25"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_10_FETCH_SIZE" high="26" low="26"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_11_FETCH_SIZE" high="27" low="27"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_12_FETCH_SIZE" high="28" low="28"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_13_FETCH_SIZE" high="29" low="29"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_14_FETCH_SIZE" high="30" low="30"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_15_FETCH_SIZE" high="31" low="31"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VTX_STATE_CNTL" access="rw" offset="0x2180">
+ <doc>VAP Vertex State Control Register</doc>
+ <bitfield name="COLOR_0_ASSEMBLY_CNTL" high="1" low="0"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_1_ASSEMBLY_CNTL" high="3" low="2"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_2_ASSEMBLY_CNTL" high="5" low="4"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_3_ASSEMBLY_CNTL" high="7" low="6"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_4_ASSEMBLY_CNTL" high="9" low="8"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_5_ASSEMBLY_CNTL" high="11" low="10"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_6_ASSEMBLY_CNTL" high="13" low="12"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_7_ASSEMBLY_CNTL" high="15" low="14"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="UPDATE_USER_COLOR_0_ENA" high="16" low="16"><use-enum ref="ENUM127" /></bitfield>
+ <bitfield name="USE_ADDR_IND_TBL" high="18" low="18">
+ <value value="0" name="USE_VERTEX_STATE_ADDRESSES_DIRECTLY_TO_WRITE_TO_VERTEX_STATE_MEMORY"><doc>Use vertex state addresses directly to write to vertex state memory.</doc></value>
+ <value value="1" name="USE_ADDRESS_INDIRECTION_TABLE_TO_WRITE_TO_VERTEX_STATE_MEMORY_FOR_LOWER_64_DWORD_ADDRESSES"><doc>Use Address Indirection table to write to vertex state memory for lower 64 DWORD addresses.</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="VAP_VTX_ST_EDGE_FLAGS" access="rw" offset="0x245C" />
+ <reg32 name="ZB_BW_CNTL" access="rw" offset="0x4F1C">
+ <doc>Z Buffer Band-Width Control Bit Defa</doc>
+ <bitfield name="HIZ_ENABLE" high="0" low="0">
+ <doc>Enables hierarchical Z.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="HIZ_MIN" high="1" low="1"><use-enum ref="HZ_UPDATE_VAL" /></bitfield>
+ <bitfield name="FAST_FILL" high="2" low="2"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="RD_COMP_ENABLE" high="3" low="3">
+ <doc>Enables reading of compressed Z data from memory to the cache.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="WR_COMP_ENABLE" high="4" low="4">
+ <doc>Enables writing of compressed Z data from cache to memory,</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZB_CB_CLEAR" high="5" low="5">
+ <doc>This bit is set when the Z buffer is used to help the CB in clearing a region. Part of the region is cleared by the color buffer and part will be cleared by the Z buffer. Since the Z buffer does not have any write masks in the cache, full micro-tiles need to be written. If a partial micro-tile is touched , then the un-touched part will be unknowns. The cache will operate in write-allocate mode and quads will be accumulated in the cache and then evicted to main memory. The color value is supplied through the ZB_DEPTHCLEARVALUE register.</doc>
+ <use-enum ref="ENUM130" />
+ </bitfield>
+ <bitfield name="FORCE_COMPRESSED_STENCIL" high="6" low="6"><doc>Enabling this bit will force all the compressed stencil values to be</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_CNTL" access="rw" offset="0x4F00">
+ <doc>Z Buffer Control</doc>
+ <bitfield name="STENCIL_ENABLE" high="0" low="0">
+ <doc>Enables stenciling.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="Z_ENABLE" high="1" low="1">
+ <doc>Enables Z functions.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZWRITEENABLE" high="2" low="2">
+ <doc>Enables writing of the Z buffer.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZSIGNED_COMPARE" high="3" low="3">
+ <doc>Enable signed Z buffer comparison , for W-buffering.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="STENCIL_FRONT_BACK" high="4" low="4">
+ <doc>When STENCIL_ENABLE is set, setting STENCIL_FRONT_BACK bit to one specifies that stencilfunc/stencilfail/stencilzpass/stencilzfail registers are used if the quad is generated from front faced primitive and stencilfunc_bf/stencilfail_bf/stencilzpass_bf/stencilzfail_bf are used if the quad is generated from a back faced primitive. If the STENCIL_FRONT_BACK is not set, then stencilfunc/stencilfail/stencilzpass/stencilzfail registers determine the operation independent of the front/back face state of the quad.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="ZB_FORMAT" access="rw" offset="0x4F10">
+ <doc>Format of the Data in the Z buffer</doc>
+ <bitfield name="DEPTHFORMAT" high="3" low="0">
+ <doc>Specifies the format of the Z buffer.</doc>
+ <use-enum ref="DSFORMAT" />
+ </bitfield>
+ <bitfield name="INVERT" high="4" low="4">
+ <value value="0" name="IN_13E3_FORMAT"><doc>in 13E3 format , count leading 0's</doc></value>
+ <value value="1" name="IN_13E3_FORMAT"><doc>in 13E3 format , count leading 1's.</doc></value>
+ </bitfield>
+ <bitfield name="PEQ8" high="5" low="5">
+ <doc>This bit is unused</doc>
+ <value value="0" name="7_BYTES_PER_PLANE_EQUATION"><doc>7 bytes per plane equation, 1 byte for stencil</doc></value>
+ <value value="1" name="8_BYTES_PER_PLANE_EQUATION"><doc>8 bytes per plane equation, no bytes for stencil</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_DWORD" access="rw" offset="0x4F4C">
+ <doc>Hierarchical Z Data. This DWORD contains an 8-bit value for 4 4x4 blocks. The 4 blocks are organized as a 2x2 tile. The frame buffer coordinate (X,Y) corresponds to a particular 8-bit value for the 4x4 block within the DWORD as follows: BITPOS[4:0] = 16 * X[2] + 8 * Y[2] HIZ[7:0] = HIZDWORD[BITPOS+7:BITPOS]</doc>
+ </reg32>
+ <reg32 name="ZB_HIZ_OFFSET" access="rw" offset="0x4F44">
+ <doc>Hierarchical Z Memory Offset</doc>
+ <bitfield name="HIZ_OFFSET" high="16" low="2"><doc>DWORD offset into HiZ RAM. A DWORD can hold an 8-bit HiZ value for 4 blocks, so this offset is aligned on 4 4x4 blocks. In each pipe, the HIZ RAM DWORD address is generated from a pixel x[11:0] , y[11:0] as follows: HIZ_DWORD_ADDRESS[13:0] = HIZ_OFFSET[16:3] + Y[11:3] * HIZ_PITCH[13:5] + X[11:5].</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_RDINDEX" access="rw" offset="0x4F50">
+ <doc>Hierarchical Z Read Index</doc>
+ <bitfield name="HIZ_RDINDEX" high="16" low="2"><doc>Read index into HiZ RAM. The index must start on a DWORD boundary. RDINDEX words much like WRINDEX. Every read from HIZ_DWORD will increment the register by 2.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_WRINDEX" access="rw" offset="0x4F48">
+ <doc>Hierarchical Z Write Index</doc>
+ <bitfield name="HIZ_WRINDEX" high="16" low="2"><doc>Self-incrementing write index into the HiZ RAM. Starting write index must start on a DWORD boundary. Each time ZB_HIZ_DWORD is written, this index will increment by two DWORD, this due to the fact that there are 2 pipes and the data is broadcasted to both pipes. HIZ_OFFSET and HIZ_PITCH are not used to compute read/write address to HIZ ram, when it is accessed through WRINDEX and DWORD</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_ZPASS_DATA" access="rw" offset="0x4F58">
+ <doc>Z Buffer Z Pass Counter Data. Contains the number of passed Z components since the last write to this location. Writing this location resets the count to the value written.</doc>
+ </reg32>
+ <reg32 name="ZB_ZSTENCILCNTL" access="rw" offset="0x4F04">
+ <doc>Z and Stencil Function Control</doc>
+ <bitfield name="ZFUNC" high="2" low="0">
+ <doc>Specifies the Z function.</doc>
+ <use-enum ref="DSCOMPARE_FUNC" />
+ </bitfield>
+ <bitfield name="STENCILFUNC" high="5" low="3">
+ <doc>Specifies the stencil function.</doc>
+ <use-enum ref="DSCOMPARE_FUNC" />
+ </bitfield>
+ <bitfield name="STENCILFAIL" high="8" low="6">
+ <doc>Specifies the stencil value to be written if the stencil test fails.</doc>
+ <use-enum ref="STENCILFAIL_VAL" />
+ </bitfield>
+ <bitfield name="STENCILZPASS" high="11" low="9"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test passes (or is not enabled).</doc></bitfield>
+ <bitfield name="STENCILZFAIL" high="14" low="12"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test fails.</doc></bitfield>
+ <bitfield name="STENCILFUNC_BF" high="17" low="15"><doc>Same encoding as STENCILFUNC. Specifies the stencil function for back faced quads , if STENCIL_FRONT_BACK = 1.</doc></bitfield>
+ <bitfield name="STENCILFAIL_BF" high="20" low="18"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test fails for back faced quads, if STENCIL_FRONT_BACK = 1</doc></bitfield>
+ <bitfield name="STENCILZPASS_BF" high="23" low="21"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test passes (or is not enabled) for back faced quads, if STENCIL_FRONT_BACK = 1</doc></bitfield>
+ <bitfield name="STENCILZFAIL_BF" high="26" low="24"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test fails for back faced quads, if STENCIL_FRONT_BACK =1</doc></bitfield>
+ </reg32>
+</group>
+
+<group name="r500_regs" prepend="R500_">
+ <reg32 name="CP_CSQ2_STAT" access="r" offset="0x07FC">
+ <doc>(RO) Command Stream Indirect Queue 2 Status</doc>
+ <bitfield name="CSQ_WPTR_INDIRECT" high="9" low="0"><doc>Current Write Pointer into the Indirect Queue. Default = 0.</doc></bitfield>
+ <bitfield name="CSQ_RPTR_INDIRECT2" high="19" low="10"><doc>Current Read Pointer into the Indirect Queue. Default = 0.</doc></bitfield>
+ <bitfield name="CSQ_WPTR_INDIRECT2" high="29" low="20"><doc>Current Write Pointer into the Indirect Queue. Default = 0.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_CSQ_ADDR" access="w" offset="0x07F0">
+ <doc>(WO) Command Stream Queue Address</doc>
+ <bitfield name="CSQ_ADDR" high="11" low="2"><doc>Address into the Command Stream Queue which is to be read from. Used for debug, to read the contents of the Command Stream Queue.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_CSQ_APER_INDIRECT" access="rw" offset="0x1300">
+ <doc>IB1 Aperture map in RBBM - PIO. IB1 Aperture</doc>
+ </reg32>
+ <reg32 name="CP_CSQ_APER_INDIRECT2" access="rw" offset="0x1200">
+ <doc>IB2 Aperture map in RBBM - PIO. IB2 Aperture</doc>
+ </reg32>
+ <reg32 name="CP_CSQ_APER_PRIMARY" access="rw" offset="0x1000">
+ <doc>Primary Aperture map in RBBM - PIO. Primary Aperture</doc>
+ </reg32>
+ <reg32 name="CP_CSQ_AVAIL" access="rw" offset="0x07B8">
+ <doc>Command Stream Queue Available Counts</doc>
+ <bitfield name="CSQ_CNT_PRIMARY" high="9" low="0"><doc>Count of available dwords in the queue for the Primary Stream. Read Only.</doc></bitfield>
+ <bitfield name="CSQ_CNT_INDIRECT" high="19" low="10"><doc>Count of available dwords in the queue for the Indirect Stream. Read Only.</doc></bitfield>
+ <bitfield name="CSQ_CNT_INDIRECT2" high="29" low="20"><doc>Count of available dwords in the queue for the Indirect Stream. Read Only.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_CSQ_CNTL" access="rw" offset="0x0740">
+ <doc>Command Stream Queue Control</doc>
+ <bitfield name="CSQ_MODE" high="31" low="28">
+ <doc>Command Stream Queue Mode. Controls whether each command stream is enabled, and whether it is in push mode (Programmed I/O), or pull mode (Bus-Master). Encodings are chosen to be compatible with Rage128. 0= Primary Disabled, Indirect Disabled. 1= Primary PIO, Indirect Disabled. 2= Primary BM, Indirect Disabled. 3,5,7= Primary PIO, Indirect BM. 4,6,8= Primary BM, Indirect BM. 9-14= Reserved. 15= Primary PIO, Indirect PIO Default = 0</doc>
+ <value value="0" name="PRIMARY_DISABLED"><doc>Primary Disabled, Indirect Disabled.</doc></value>
+ <value value="1" name="PRIMARY_PIO"><doc>Primary PIO, Indirect Disabled.</doc></value>
+ <value value="2" name="PRIMARY_BM"><doc>Primary BM, Indirect Disabled. 3,5,</doc></value>
+ <value value="7" name="PRIMARY_PIO"><doc>Primary PIO, Indirect BM. 4,6,</doc></value>
+ <value value="8" name="PRIMARY_BM"><doc>Primary BM, Indirect BM. 9-</doc></value>
+ <value value="15" name="PRIMARY_PIO"><doc>Primary PIO, Indirect PIO Default = 0</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="CP_CSQ_DATA" access="r" offset="0x07F4">
+ <doc>(RO) Command Stream Queue Data. Data from the Command Stream Queue, from location pointed to by the CP_CSQ_ADDR register. Used for debug, to read the contents of the Command Stream Queue.</doc>
+ </reg32>
+ <reg32 name="CP_CSQ_MODE" access="rw" offset="0x0744">
+ <doc>Alternate Command Stream Queue Control</doc>
+ <bitfield name="INDIRECT2_START" high="6" low="0"><doc>Start location of Indirect Queue #2 in the command cache. This value also sets the size in double octwords of the Indirect Queue #1 cache that will reside in locations INDIRECT1_START to (INDIRECT2_START - 1). The Indirect Queue #2 will reside in locations INDIRECT2_START to 0x5f. The minimum size of the Indirect Queues must be at least twice the MAX_FETCH size as programmed in the CP_RB_CNTL register.</doc></bitfield>
+ <bitfield name="INDIRECT1_START" high="14" low="8"><doc>Start location of Indirect Queue #1 in the command cache. This value is also the size in double octwords of the Primary Queue cache that will reside in locations 0 to (INDIRECT1_START - 1). The minimum size of the Primary Queue cache must be at least twice the MAX_FETCH size as programmed in the CP_RB_CNTL register.</doc></bitfield>
+ <bitfield name="CSQ_INDIRECT2_MODE" high="26" low="26"><use-enum ref="CSQ_MODE" /></bitfield>
+ <bitfield name="CSQ_INDIRECT2_ENABLE" high="27" low="27"><doc>Enables Indirect Buffer #2. If this bit is set, the CP_CSQ_MODE register overrides the operation of the CSQ_MODE variable in the CP_CSQ_CNTL register.</doc></bitfield>
+ <bitfield name="CSQ_INDIRECT1_MODE" high="28" low="28"><use-enum ref="CSQ_MODE" /></bitfield>
+ <bitfield name="CSQ_INDIRECT1_ENABLE" high="29" low="29"><doc>Enables Indirect Buffer #1. If this bit is set, the CP_CSQ_MODE register overrides the operation of the CSQ_MODE variable in the CP_CSQ_CNTL register.</doc></bitfield>
+ <bitfield name="CSQ_PRIMARY_MODE" high="30" low="30"><use-enum ref="CSQ_MODE" /></bitfield>
+ <bitfield name="CSQ_PRIMARY_ENABLE" high="31" low="31"><doc>Enables Primary Buffer. If this bit is set, the CP_CSQ_MODE register overrides the operation of the CSQ_MODE variable in the CP_CSQ_CNTL register.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_CSQ_STAT" access="r" offset="0x07F8">
+ <doc>(RO) Command Stream Queue Status</doc>
+ <bitfield name="CSQ_RPTR_PRIMARY" high="9" low="0"><doc>Current Read Pointer into the Primary Queue. Default = 0.</doc></bitfield>
+ <bitfield name="CSQ_WPTR_PRIMARY" high="19" low="10"><doc>Current Write Pointer into the Primary Queue. Default = 0.</doc></bitfield>
+ <bitfield name="CSQ_RPTR_INDIRECT" high="29" low="20"><doc>Current Read Pointer into the Indirect Queue. Default = 0.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_GUI_COMMAND" access="rw" offset="0x0728">
+ <doc>Command for PIO GUI DMAs. Command for PIO DMAs to the GUI DMA. Only DWORD access is allowed to this register.</doc>
+ </reg32>
+ <reg32 name="CP_GUI_DST_ADDR" access="rw" offset="0x0724">
+ <doc>Destination Address for PIO GUI DMAs. Destination address for PIO DMAs to the GUI DMA. Only DWORD access is allowed to this register.</doc>
+ </reg32>
+ <reg32 name="CP_GUI_SRC_ADDR" access="rw" offset="0x0720">
+ <doc>Source Address for PIO GUI DMAs. Source address for PIO DMAs to the GUI DMA. Only DWORD access is allowed to this register.</doc>
+ </reg32>
+ <reg32 name="CP_IB2_BASE" access="rw" offset="0x0730">
+ <doc>Indirect Buffer 2 Base</doc>
+ <bitfield name="IB2_BASE" high="31" low="2"><doc>Indirect Buffer 2 Base. Address of the beginning of the indirect buffer. Only DWORD access is allowed to this register.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_IB2_BUFSZ" access="rw" offset="0x0734">
+ <doc>Indirect Buffer 2 Size</doc>
+ <bitfield name="IB2_BUFSZ" high="22" low="0"><doc>Indirect Buffer 2 Size. This size is expressed in dwords. This field is an initiator to begin fetching commands from the Indirect Buffer. Only DWORD access is allowed to this register. Default = 0</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_IB_BASE" access="rw" offset="0x0738">
+ <doc>Indirect Buffer Base</doc>
+ <bitfield name="IB_BASE" high="31" low="2"><doc>Indirect Buffer Base. Address of the beginning of the indirect buffer. Only DWORD access is allowed to this register.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_IB_BUFSZ" access="rw" offset="0x073C">
+ <doc>Indirect Buffer Size</doc>
+ <bitfield name="IB_BUFSZ" high="22" low="0"><doc>Indirect Buffer Size. This size is expressed in dwords. This field is an initiator to begin fetching commands from the Indirect Buffer. Only DWORD access is allowed to this register. Default = 0</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_ME_CNTL" access="rw" offset="0x07D0">
+ <doc>Micro Engine Control</doc>
+ <bitfield name="ME_STAT" high="15" low="0"><doc>Status of MicroEngine internal registers. This value depends on the current value of the ME_STATMUX field. Read Only.</doc></bitfield>
+ <bitfield name="ME_STATMUX" high="20" low="16"><doc>Selects which status is to be returned on the ME_STAT field.</doc></bitfield>
+ <bitfield name="ME_BUSY" high="29" low="29"><doc>Busy indicator for the MicroEngine. 0 = MicroEngine not busy. 1 = MicroEngine is active. Read Only.</doc></bitfield>
+ <bitfield name="ME_MODE" high="30" low="30"><doc>Run-Mode of MicroEngine. 0 = Single-Step Mode. 1 = Free-running Mode. Default = 1</doc></bitfield>
+ <bitfield name="ME_STEP" high="31" low="31"><doc>Step the MicroEngine by one instruction. Writing a '1' to this field causes the MicroEngine to step by one instruction, if and only if the ME_MODE bit is a '0'. Write Only.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_ME_RAM_ADDR" access="rw" offset="0x07D4">
+ <doc>MicroEngine RAM Address</doc>
+ <bitfield name="ME_RAM_ADDR" high="7" low="0"><doc>MicroEngine RAM Address (Write Mode) Writing this</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_ME_RAM_DATAH" access="rw" offset="0x07DC">
+ <doc>MicroEngine RAM Data High</doc>
+ <bitfield name="ME_RAM_DATAH" high="7" low="0"><doc>MicroEngine RAM Data High Used to load the MicroEngine RAM.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_ME_RAM_DATAL" access="rw" offset="0x07E0">
+ <doc>MicroEngine RAM Data Low. MicroEngine RAM Data Low Used to load the MicroEngine RAM.</doc>
+ </reg32>
+ <reg32 name="CP_ME_RAM_RADDR" access="rw" offset="0x07D8">
+ <doc>MicroEngine RAM Read Address</doc>
+ <bitfield name="ME_RAM_RADDR" high="7" low="0"><doc>MicroEngine RAM Address (Read Mode) Writing</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_BASE" access="rw" offset="0x0700">
+ <doc>Ring Buffer Base</doc>
+ <bitfield name="RB_BASE" high="31" low="2"><doc>Ring Buffer Base. Address of the beginning of the ring buffer.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_CNTL" access="rw" offset="0x0704">
+ <doc>Ring Buffer Control</doc>
+ <bitfield name="RB_BUFSZ" high="5" low="0"><doc>Ring Buffer Size. This size is expressed in log2 of the actual size. Values 0 and 1 are clamped to an 8 DWORD ring buffer. A value of 2 to 22 will give a ring buffer: 2^(RB_BUFSZ+1). Values greater than 22 will clamp to 22. Default = 0</doc></bitfield>
+ <bitfield name="RB_BLKSZ" high="13" low="8"><doc>Ring Buffer Block Size. This defines the number of quadwords that the Command Processor will read between updates to the host's copy of the Read Pointer. This size is expressed in log2 of the actual size (in 64-bit quadwords). For example, for a block of 1024 quadwords, you would program this field to 10(decimal). Default = 0</doc></bitfield>
+ <bitfield name="BUF_SWAP" high="17" low="16"><doc>Endian Swap Control for Ring Buffer and Indirect Buffer. Only affects the chip behavior if the buffer resides in system memory. 0 = No swap 1 = 16-bit swap: 0xAABBCCDD becomes 0xBBAADDCC 2 = 32-bit swap: 0xAABBCCDD becomes 0xDDCCBBAA 3 = Half-dword swap: 0xAABBCCDD becomes 0xCCDDAABB Default = 0</doc></bitfield>
+ <bitfield name="MAX_FETCH" high="19" low="18"><doc>Maximum Fetch Size for any read request that the CP makes to memory. 0 = 1 double octword. (32 bytes) 1 = 2 double octwords. (64 bytes) 2 = 4 double octwords. (128 bytes) 3 = 8 double octwords. (256 bytes). Default =0</doc></bitfield>
+ <bitfield name="RB_NO_UPDATE" high="27" low="27">
+ <doc>Ring Buffer No Write to Read Pointer 0= Write to Host's copy of Read Pointer in system memory. 1= Do not write to Host's copy of Read pointer. The purpose of this control bit is to have a fall-back position if the bus- mastered write to system memory doesn't work, in which case the driver will have to read the Graphics Controller's copy of the Read Pointer directly, with some performance penalty. Default = 0</doc>
+ <value value="0" name="WRITE_TO_HOST"><doc>Write to Host's copy of Read Pointer in system memory.</doc></value>
+ <value value="1" name="DO_NOT_WRITE_TO_HOST"><doc>Do not write to Host's copy of Read pointer. The purpose of this control bit is to have a fall-back position if the bus- mastered write to system memory doesn't work, in which case the driver will have to read the Graphics Controller's copy of the Read Pointer directly, with some performance penalty. Default = 0</doc></value>
+ </bitfield>
+ <bitfield name="RB_RPTR_WR_ENA" high="31" low="31"><doc>Ring Buffer Read Pointer Write Transfer Enable. When set the contents of the CP_RB_RPTR_WR register is transferred to the active read pointer (CP_RB_RPTR) whenever the CP_RB_WPTR register is written. Default =0</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_RPTR" access="rw" offset="0x0710">
+ <doc>Ring Buffer Read Pointer Address (RO)</doc>
+ <bitfield name="RB_RPTR" high="22" low="0"><doc>Ring Buffer Read Pointer. This is an index (in dwords) of the current element being read from the ring buffer.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_RPTR_ADDR" access="rw" offset="0x070C">
+ <doc>Ring Buffer Read Pointer Address</doc>
+ <bitfield name="RB_RPTR_SWAP" high="1" low="0"><doc>Swap control of the reported read pointer address. See CP_RB_CNTL.BUF_SWAP for the encoding.</doc></bitfield>
+ <bitfield name="RB_RPTR_ADDR" high="31" low="2"><doc>Ring Buffer Read Pointer Address. Address of the Host's copy of the Read Pointer. CP_RB_RPTR (RO) Ring Buffer Read Pointer</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_RPTR_WR" access="rw" offset="0x071C">
+ <doc>Writable Ring Buffer Read Pointer Address</doc>
+ <bitfield name="RB_RPTR_WR" high="22" low="0"><doc>Writable Ring Buffer Read Pointer. Writable for updating the RB_RPTR after an ACPI.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_WPTR" access="rw" offset="0x0714">
+ <doc>(RO) Ring Buffer Write Pointer</doc>
+ <bitfield name="RB_WPTR" high="22" low="0"><doc>Ring Buffer Write Pointer. This is an index (in dwords) of the last known element to be written to the ring buffer (by the host).</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RB_WPTR_DELAY" access="rw" offset="0x0718">
+ <doc>Ring Buffer Write Pointer Delay</doc>
+ <bitfield name="PRE_WRITE_TIMER" high="27" low="0"><doc>Pre-Write Timer. The number of clocks that a write to the CP_RB_WPTR register will be delayed until actually taking effect. Default = 0</doc></bitfield>
+ <bitfield name="PRE_WRITE_LIMIT" high="31" low="28"><doc>Pre-Write Limit. The number of times that the CP_RB_WPTR register can be written (while the PRE_WRITE_TIMER has not expired) before the CP_RB_WPTR register is forced to be updated with the most recently written value. Default = 0</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RESYNC_ADDR" access="rw" offset="0x0778">
+ <doc>Raster Engine Sync Address (WO)</doc>
+ <bitfield name="RESYNC_ADDR" high="2" low="0"><doc>Scratch Register Offset Address.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_RESYNC_DATA" access="rw" offset="0x077C">
+ <doc>Raster Engine Sync Data (WO). Data written to selected Scratch Register when a sync pulse pair is received from the CBA and CBB.</doc>
+ </reg32>
+ <reg32 name="CP_STAT" access="r" offset="0x07C0">
+ <doc>(RO) Busy Status Signals</doc>
+ <bitfield name="MRU_BUSY" high="0" low="0"><doc>Memory Read Unit Busy.</doc></bitfield>
+ <bitfield name="MWU_BUSY" high="1" low="1"><doc>Memory Write Unit Busy.</doc></bitfield>
+ <bitfield name="RSIU_BUSY" high="2" low="2"><doc>Register Backbone Input Interface Busy.</doc></bitfield>
+ <bitfield name="RCIU_BUSY" high="3" low="3"><doc>RBBM Output Interface Busy.</doc></bitfield>
+ <bitfield name="CSF_PRIMARY_BUSY" high="9" low="9"><doc>Primary Command Stream Fetcher Busy.</doc></bitfield>
+ <bitfield name="CSF_INDIRECT_BUSY" high="10" low="10"><doc>Indirect #1 Command Stream Fetcher Busy.</doc></bitfield>
+ <bitfield name="CSQ_PRIMARY_BUSY" high="11" low="11"><doc>Data in Command Queue for Primary Stream.</doc></bitfield>
+ <bitfield name="CSQ_INDIRECT_BUSY" high="12" low="12"><doc>Data in Command Queue for Indirect #1 Stream.</doc></bitfield>
+ <bitfield name="CSI_BUSY" high="13" low="13"><doc>Command Stream Interpreter Busy.</doc></bitfield>
+ <bitfield name="CSF_INDIRECT2_BUSY" high="14" low="14"><doc>Indirect #2 Command Stream Fetcher Busy.</doc></bitfield>
+ <bitfield name="CSQ_INDIRECT2_BUSY" high="15" low="15"><doc>Data in Command Queue for Indirect #2 Stream.</doc></bitfield>
+ <bitfield name="GUIDMA_BUSY" high="28" low="28"><doc>GUI DMA Engine Busy.</doc></bitfield>
+ <bitfield name="VIDDMA_BUSY" high="29" low="29"><doc>VID DMA Engine Busy.</doc></bitfield>
+ <bitfield name="CMDSTRM_BUSY" high="30" low="30"><doc>Command Stream Busy.</doc></bitfield>
+ <bitfield name="CP_BUSY" high="31" low="31"><doc>CP Busy.</doc></bitfield>
+ </reg32>
+ <reg32 name="CP_VID_COMMAND" access="rw" offset="0x07CC">
+ <doc>Command for PIO VID DMAs. Command for PIO DMAs to the VID DMA. Only DWORD access is allowed to this register.</doc>
+ </reg32>
+ <reg32 name="CP_VID_DST_ADDR" access="rw" offset="0x07C8">
+ <doc>Destination Address for PIO VID DMAs. Destination address for PIO DMAs to the VID DMA. Only DWORD access is allowed to this register.</doc>
+ </reg32>
+ <reg32 name="CP_VID_SRC_ADDR" access="rw" offset="0x07C4">
+ <doc>Source Address for PIO VID DMAs. Source address for PIO DMAs to the VID DMA. Only DWORD access is allowed to this register.</doc>
+ </reg32>
+ <reg32 name="CP_VP_ADDR_CNTL" access="rw" offset="0x07E8">
+ <doc>Virtual vs Physical Address Control - Selects whether the address corresponds to a physical or virtual address in memory.</doc>
+ <bitfield name="SCRATCH_ALT_VP_WR" high="0" low="0"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="SCRATCH_VP_WR" high="1" low="1"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="RPTR_VP_UPDATE" high="2" low="2"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="VIDDMA_VP_WR" high="3" low="3"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="VIDDMA_VP_RD" high="4" low="4"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="GUIDMA_VP_WR" high="5" low="5"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="GUIDMA_VP_RD" high="6" low="6"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="INDR2_VP_FETCH" high="7" low="7"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="INDR1_VP_FETCH" high="8" low="8"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ <bitfield name="RING_VP_FETCH" high="9" low="9"><use-enum ref="VP_ADDR_MODE" /></bitfield>
+ </reg32>
+ <reg32 name="RB3D_AARESOLVE_CTL" access="rw" offset="0x4E88">
+ <doc>Resolve Buffer Control. Unpipelined</doc>
+ <bitfield name="AARESOLVE_MODE" high="0" low="0">
+ <doc>Specifies if the color buffer is in resolve mode. The cache must be empty before changing this register.</doc>
+ <use-enum ref="AARESOLVE_MODE" />
+ </bitfield>
+ <bitfield name="AARESOLVE_GAMMA" high="1" low="1">
+ <doc>Specifies the gamma and degamma to be applied to the samples before and after filtering, respectively.</doc>
+ <use-enum ref="AARESOLVE_GAMMA" />
+ </bitfield>
+ <bitfield name="AARESOLVE_ALPHA" high="2" low="2">
+ <doc>Controls whether alpha is averaged in the resolve. 0 =&gt; the resolved alpha value is selected from the sample 0 value. 1=&gt; the resolved alpha value is a filtered (average) result of of the samples.</doc>
+ <value value="0" name="RESOLVED_ALPHA_VALUE_IS_TAKEN_FROM_SAMPLE_0"><doc>Resolved alpha value is taken from sample 0.</doc></value>
+ <value value="1" name="RESOLVED_ALPHA_VALUE_IS_THE_AVERAGE_OF_THE_SAMPLES"><doc>Resolved alpha value is the average of the samples. The average is not gamma corrected.</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_BLENDCNTL" access="rw" offset="0x4E04">
+ <doc>Alpha Blend Control for Color Channels. Pipelined through the blender.</doc>
+ <bitfield name="ALPHA_BLEND_ENABLE" high="0" low="0">
+ <doc>Allow alpha blending with the destination.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SEPARATE_ALPHA_ENABLE" high="1" low="1">
+ <doc>Enables use of RB3D_ABLENDCNTL</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="READ_ENABLE" high="2" low="2">
+ <doc>When blending is enabled, this enables memory reads. Memory reads will still occur when this is disabled if they are for reasons not related to blending.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DISCARD_SRC_PIXELS" high="5" low="3">
+ <doc>Discard pixels when blending is enabled based on the src color.</doc>
+ <value value="0" name="DISABLE"><doc>Disable</doc></value>
+ <value value="1" name="DISCARD_PIXELS_IF_SRC_ALPHA"><doc>Discard pixels if src alpha &lt;= RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD</doc></value>
+ <value value="2" name="DISCARD_PIXELS_IF_SRC_COLOR"><doc>Discard pixels if src color &lt;= RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD</doc></value>
+ <value value="3" name="DISCARD_PIXELS_IF_SRC_ARGB"><doc>Discard pixels if src argb &lt;= RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD</doc></value>
+ <value value="4" name="DISCARD_PIXELS_IF_SRC_ALPHA"><doc>Discard pixels if src alpha &gt;= RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD</doc></value>
+ <value value="5" name="DISCARD_PIXELS_IF_SRC_COLOR"><doc>Discard pixels if src color &gt;= RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD</doc></value>
+ <value value="6" name="DISCARD_PIXELS_IF_SRC_ARGB"><doc>Discard pixels if src argb &gt;= RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD</doc></value>
+ </bitfield>
+ <bitfield name="COMB_FCN" high="14" low="12">
+ <doc>Combine Function , Allows modification of how the SRCBLEND and DESTBLEND are combined.</doc>
+ <use-enum ref="COMBINE_FUNCTION" />
+ </bitfield>
+ <bitfield name="SRCBLEND" high="21" low="16">
+ <doc>Source Blend Function , Alpha blending function (SRC).</doc>
+ <use-enum ref="BLEND_FUNC_SRC" />
+ </bitfield>
+ <bitfield name="DESTBLEND" high="29" low="24">
+ <doc>Destination Blend Function , Alpha blending function (DST).</doc>
+ <use-enum ref="BLEND_FUNC_DEST" />
+ </bitfield>
+ <bitfield name="SRC_ALPHA_0_NO_READ" high="30" low="30">
+ <doc>Enables source alpha zero performance optimization to skip reads.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SRC_ALPHA_1_NO_READ" high="31" low="31">
+ <doc>Enables source alpha one performance optimization to skip reads.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD" access="rw" offset="0x4EA4">
+ <doc>Discard src pixels greater than or equal to threshold.</doc>
+ <bitfield name="BLUE" high="7" low="0"><doc>Blue</doc></bitfield>
+ <bitfield name="GREEN" high="15" low="8"><doc>Green</doc></bitfield>
+ <bitfield name="RED" high="23" low="16"><doc>Red</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="24"><doc>Alpha</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD" access="rw" offset="0x4EA0">
+ <doc>Discard src pixels less than or equal to threshold.</doc>
+ <bitfield name="BLUE" high="7" low="0"><doc>Blue</doc></bitfield>
+ <bitfield name="GREEN" high="15" low="8"><doc>Green</doc></bitfield>
+ <bitfield name="RED" high="23" low="16"><doc>Red</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="24"><doc>Alpha</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_CCTL" access="rw" offset="0x4E00">
+ <doc>Unpipelined.</doc>
+ <bitfield name="NUM_MULTIWRITES" high="6" low="5"><doc>A quad is replicated and written to this many + 1 buffers. 0 (1 buffer) is the only mode where the cb processes the end of packet command.</doc></bitfield>
+ <bitfield name="CLRCMP_FLIPE_ENABLE" high="7" low="7">
+ <doc>Enables equivalent of rage128 CMP_EQ_FLIP color compare mode. This is used to ensure 3D data does not get chromakeyed away by logic in the backend.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="AA_COMPRESSION_ENABLE" high="9" low="9">
+ <doc>Enables AA color compression. Cmask must also be enabled when aa compression is enabled. The cache must be empty before this is changed.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="CMASK_ENABLE" high="10" low="10">
+ <doc>Enables use of the cmask ram. The cache must be empty before this is changed.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="Reserved" high="11" low="11"><doc>Set to 0</doc></bitfield>
+ <bitfield name="INDEPENDENT_COLOR_CHANNEL_MASK_ENABLE" high="12" low="12">
+ <doc>Enables indepedent color channel masks for the MRTs. Disabling this feature will cause all the MRTs to use color channel mask 0.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="WRITE_COMPRESSION_DISABLE" high="13" low="13">
+ <doc>Disables write compression.</doc>
+ <value value="0" name="ENABLE_WRITE_COMPRESSION"><doc>Enable write compression</doc></value>
+ <value value="1" name="DISABLE_WRITE_COMPRESSION"><doc>Disable write compression</doc></value>
+ </bitfield>
+ <bitfield name="INDEPENDENT_COLORFORMAT_ENABLE" high="14" low="14">
+ <doc>Enables independent color format for the MRTs. Disabling this feature will cause all the MRTs to use color format 0.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <stripe offset="0x4E38" stride="0x0004" length="4">
+ <reg32 name="RB3D_COLORPITCH" access="rw" offset="0x0000">
+ <doc>Color buffer format and tiling control for all the multibuffers and the pitch of multibuffer 0. Unpipelined. The cache must be empty before any of the registers are changed.</doc>
+ <bitfield name="COLORPITCH" high="13" low="1"><doc>3D destination pitch in multiples of 2-pixels.</doc></bitfield>
+ <bitfield name="COLORTILE" high="16" low="16">
+ <doc>Denotes whether the 3D destination is in macrotiled format.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="COLORMICROTILE" high="18" low="17">
+ <doc>Denotes whether the 3D destination is in microtiled format.</doc>
+ <use-enum ref="MICROTILE" />
+ </bitfield>
+ <bitfield name="COLORENDIAN" high="20" low="19">
+ <doc>Specifies endian control for the color buffer.</doc>
+ <use-enum ref="BYTESWAP" />
+ </bitfield>
+ <bitfield name="COLORFORMAT" high="24" low="21">
+ <doc>3D destination color format.</doc>
+ <value value="0" name="ARGB10101010"><doc>ARGB10101010</doc></value>
+ <value value="1" name="UV1010"><doc>UV1010</doc></value>
+ <value value="2" name="CI8"><doc>CI8 (2D ONLY)</doc></value>
+ <value value="3" name="ARGB1555"><doc>ARGB1555</doc></value>
+ <value value="4" name="RGB565"><doc>RGB565</doc></value>
+ <value value="5" name="ARGB2101010"><doc>ARGB2101010</doc></value>
+ <value value="6" name="ARGB8888"><doc>ARGB8888</doc></value>
+ <value value="7" name="ARGB32323232"><doc>ARGB32323232</doc></value>
+ <value value="9" name="I8"><doc>I8</doc></value>
+ <value value="10" name="ARGB16161616"><doc>ARGB16161616</doc></value>
+ <value value="11" name="YUV422_PACKED"><doc>YUV422 packed (VYUY)</doc></value>
+ <value value="12" name="YUV422_PACKED"><doc>YUV422 packed (YVYU)</doc></value>
+ <value value="13" name="UV88"><doc>UV88</doc></value>
+ <value value="14" name="I10"><doc>I10</doc></value>
+ <value value="15" name="ARGB4444"><doc>ARGB4444</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="RB3D_COLOR_CHANNEL_MASK" access="rw" offset="0x4E0C">
+ <doc>3D Color Channel Mask. If all the channels used in the current color format are disabled, then the cb will discard all the incoming quads. Pipelined through the blender.</doc>
+ <bitfield name="BLUE_MASK" high="0" low="0">
+ <doc>mask bit for the blue channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="GREEN_MASK" high="1" low="1">
+ <doc>mask bit for the green channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="RED_MASK" high="2" low="2">
+ <doc>mask bit for the red channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALPHA_MASK" high="3" low="3">
+ <doc>mask bit for the alpha channel</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="BLUE_MASK1" high="4" low="4">
+ <doc>mask bit for the blue channel of MRT 1</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="GREEN_MASK1" high="5" low="5">
+ <doc>mask bit for the green channel of MRT 1</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="RED_MASK1" high="6" low="6">
+ <doc>mask bit for the red channel of MRT 1</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALPHA_MASK1" high="7" low="7">
+ <doc>mask bit for the alpha channel of MRT 1</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="BLUE_MASK2" high="8" low="8">
+ <doc>mask bit for the blue channel of MRT 2</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="GREEN_MASK2" high="9" low="9">
+ <doc>mask bit for the green channel of MRT 2</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="RED_MASK2" high="10" low="10">
+ <doc>mask bit for the red channel of MRT 2</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALPHA_MASK2" high="11" low="11">
+ <doc>mask bit for the alpha channel of MRT 2</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="BLUE_MASK3" high="12" low="12">
+ <doc>mask bit for the blue channel of MRT 3</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="GREEN_MASK3" high="13" low="13">
+ <doc>mask bit for the green channel of MRT 3</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="RED_MASK3" high="14" low="14">
+ <doc>mask bit for the red channel of MRT 3</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALPHA_MASK3" high="15" low="15">
+ <doc>mask bit for the alpha channel of MRT 3</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="RB3D_COLOR_CLEAR_VALUE" access="rw" offset="0x4E14">
+ <doc>Clear color that is used when the color mask is set to 00. Unpipelined. Program this register with a 32-bit value in ARGB8888 or ARGB2101010 formats, ignoring the fields.</doc>
+ <bitfield name="BLUE" high="7" low="0"><doc>blue clear color</doc></bitfield>
+ <bitfield name="GREEN" high="15" low="8"><doc>green clear color</doc></bitfield>
+ <bitfield name="RED" high="23" low="16"><doc>red clear color</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="24"><doc>alpha clear color</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_COLOR_CLEAR_VALUE_AR" access="rw" offset="0x46C0">
+ <doc>Alpha and red clear color values that are used when the color mask is set to 00 in FP16 per component mode. Unpipelined.</doc>
+ <bitfield name="RED" high="15" low="0"><doc>red clear color</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="16"><doc>alpha clear color</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_COLOR_CLEAR_VALUE_GB" access="rw" offset="0x46C4">
+ <doc>Green and blue clear color values that are used when the color mask is set to 00 in FP16 per component mode. Unpipelined.</doc>
+ <bitfield name="BLUE" high="15" low="0"><doc>blue clear color</doc></bitfield>
+ <bitfield name="GREEN" high="31" low="16"><doc>green clear color</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_CONSTANT_COLOR" access="rw" offset="0x4E10">
+ <doc>Constant color used by the blender. Pipelined through the blender.</doc>
+ <bitfield name="BLUE" high="7" low="0"><doc>blue constant color (For R520, this field is ignored, use RB3D_CONSTANT_COLOR_GB__BLUE instead)</doc></bitfield>
+ <bitfield name="GREEN" high="15" low="8"><doc>green constant color (For R520, this field is ignored, use RB3D_CONSTANT_COLOR_GB__GREEN instead)</doc></bitfield>
+ <bitfield name="RED" high="23" low="16"><doc>red constant color (For R520, this field is ignored, use RB3D_CONSTANT_COLOR_AR__RED instead)</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="24"><doc>alpha constant color (For R520, this field is ignored, use RB3D_CONSTANT_COLOR_AR__ALPHA instead)</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_CONSTANT_COLOR_AR" access="rw" offset="0x4EF8">
+ <doc>Constant color used by the blender. Pipelined through the blender.</doc>
+ <bitfield name="RED" high="15" low="0"><doc>red constant color in 0.10 fixed or FP16 format</doc></bitfield>
+ <bitfield name="ALPHA" high="31" low="16"><doc>alpha constant color in 0.10 fixed or FP16 format</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_CONSTANT_COLOR_GB" access="rw" offset="0x4EFC">
+ <doc>Constant color used by the blender. Pipelined through the blender.</doc>
+ <bitfield name="BLUE" high="15" low="0"><doc>blue constant color in 0.10 fixed or FP16 format</doc></bitfield>
+ <bitfield name="GREEN" high="31" low="16"><doc>green constant color in 0.10 fixed or FP16 format</doc></bitfield>
+ </reg32>
+ <reg32 name="RB3D_FIFO_SIZE" access="rw" offset="0x4EF4">
+ <doc>Sets the fifo sizes</doc>
+ <bitfield name="OP_FIFO_SIZE" high="1" low="0">
+ <doc>Determines the size of the op fifo</doc>
+ <use-enum ref="FIFO_SIZE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="FG_ALPHA_FUNC" access="rw" offset="0x4BD4">
+ <doc>Alpha Function</doc>
+ <bitfield name="AF_VAL" high="7" low="0"><doc>Specifies the 8-bit alpha compare value when AF_EN_8BIT is enabled</doc></bitfield>
+ <bitfield name="AF_FUNC" high="10" low="8">
+ <doc>Specifies the alpha compare function.</doc>
+ <use-enum ref="ALPHACOMPARE_FUNC" />
+ </bitfield>
+ <bitfield name="AF_EN" high="11" low="11">
+ <doc>Enables/Disables alpha compare function.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="AF_EN_8BIT" high="12" low="12">
+ <doc>Enable 8-bit alpha compare function.</doc>
+ <value value="0" name="DEFAULT_10"><doc>Default 10-bit alpha compare.</doc></value>
+ <value value="1" name="ENABLE_8"><doc>Enable 8-bit alpha compare.</doc></value>
+ </bitfield>
+ <bitfield name="AM_EN" high="16" low="16">
+ <doc>Enables/Disables alpha-to-mask function.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="AM_CFG" high="17" low="17">
+ <doc>Specfies number of sub-pixel samples for alpha-to-mask function.</doc>
+ <use-enum ref="ALPHA_SUBPIXEL_SAMPLES" />
+ </bitfield>
+ <bitfield name="DITH_EN" high="20" low="20">
+ <doc>Enables/Disables RGB Dithering (Not supported in R520)</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALP_OFF_EN" high="24" low="24">
+ <doc>Alpha offset enable/disable (Not supported in R520)</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DISCARD_ZERO_MASK_QUAD" high="25" low="25">
+ <doc>Enable/Disable discard zero mask coverage quad to ZB</doc>
+ <value value="0" name="NO_DISCARD_OF_ZERO_COVERAGE_MASK_QUADS"><doc>No discard of zero coverage mask quads</doc></value>
+ <value value="1" name="DISCARD_ZERO_COVERAGE_MASK_QUADS"><doc>Discard zero coverage mask quads</doc></value>
+ </bitfield>
+ <bitfield name="FP16_ENABLE" high="28" low="28">
+ <doc>Enables/Disables FP16 alpha function</doc>
+ <value value="0" name="DEFAULT_10"><doc>Default 10-bit alpha compare and alpha-to-mask function</doc></value>
+ <value value="1" name="ENABLE_FP16_ALPHA_COMPARE_AND_ALPHA"><doc>Enable FP16 alpha compare and alpha-to-mask function</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="FG_ALPHA_VALUE" access="rw" offset="0x4BE0">
+ <doc>Alpha Compare Value</doc>
+ <bitfield name="AF_VAL" high="15" low="0"><doc>Specifies the alpha compare value, 0.10 fixed or FP16 format</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_COLOR_B" access="rw" offset="0x4BD0">
+ <doc>Blue Component of Fog Color</doc>
+ <bitfield name="BLUE" high="9" low="0"><doc>Blue component of fog color; (0.10) fixed format.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_COLOR_G" access="rw" offset="0x4BCC">
+ <doc>Green Component of Fog Color</doc>
+ <bitfield name="GREEN" high="9" low="0"><doc>Green component of fog color; (0.10) fixed format.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_COLOR_R" access="rw" offset="0x4BC8">
+ <doc>Red Component of Fog Color</doc>
+ <bitfield name="RED" high="9" low="0"><doc>Red component of fog color; (0.10) fixed format.</doc></bitfield>
+ </reg32>
+ <reg32 name="FG_FOG_FACTOR" access="rw" offset="0x4BC4">
+ <doc>Constant Factor for Fog Blending</doc>
+ <bitfield name="FACTOR" high="9" low="0"><doc>Constant fog factor; fixed (0.10) format.</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_COLOR_CONTROL_PS3" access="rw" offset="0x4258">
+ <doc>Specifies color properties and mappings of textures.</doc>
+ <bitfield name="TEX0_SHADING_PS3" high="1" low="0">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX1_SHADING_PS3" high="3" low="2">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX2_SHADING_PS3" high="5" low="4">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX3_SHADING_PS3" high="7" low="6">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX4_SHADING_PS3" high="9" low="8">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX5_SHADING_PS3" high="11" low="10">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX6_SHADING_PS3" high="13" low="12">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX7_SHADING_PS3" high="15" low="14">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX8_SHADING_PS3" high="17" low="16">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX9_SHADING_PS3" high="19" low="18">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for each texture.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="TEX10_SHADING_PS3" high="21" low="20">
+ <doc>Specifies undefined(0), flat(1) and Gouraud(2/def) shading for tex10 components.</doc>
+ <use-enum ref="SHADING" />
+ </bitfield>
+ <bitfield name="COLOR0_TEX_OVERRIDE" high="25" low="22">
+ <doc>Specifies if each color should come from a texture and which one.</doc>
+ <use-enum ref="COLOR_TEX_OVERRIDE" />
+ </bitfield>
+ <bitfield name="COLOR1_TEX_OVERRIDE" high="29" low="26">
+ <doc>Specifies if each color should come from a texture and which one.</doc>
+ <use-enum ref="COLOR_TEX_OVERRIDE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_ENHANCE" access="rw" offset="0x4274">
+ <doc>GA Enhancement Register</doc>
+ <bitfield name="DEADLOCK_CNTL" high="0" low="0">
+ <doc>TCL/GA Deadlock control. Prevents TCL interface from deadlocking on GA side.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="FASTSYNC_CNTL" high="1" low="1">
+ <doc>Enables Fast register/primitive switching</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="REG_READWRITE" high="2" low="2">
+ <doc>R520+: When set, GA supports simultaneous register reads &amp; writes</doc>
+ <value value="0" name="NO_EFFECT"><doc>No effect.</doc></value>
+ <value value="1" name="ENABLES_GA_SUPPORT_OF_SIMULTANEOUS_REGISTER_READS_AND_WRITES"><doc>Enables GA support of simultaneous register reads and writes.</doc></value>
+ </bitfield>
+ <bitfield name="REG_NOSTALL" high="3" low="3">
+ <value value="0" name="NO_EFFECT"><doc>No effect.</doc></value>
+ <value value="1" name="ENABLES_GA_SUPPORT_OF_NO"><doc>Enables GA support of no-stall reads for register read back.</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_FIFO_CNTL" access="rw" offset="0x4270">
+ <doc>GA Input fifo high water marks</doc>
+ <bitfield name="VERTEX_FIFO" high="2" low="0"><doc>Number of words remaining in input vertex fifo before asserting nearly full</doc></bitfield>
+ <bitfield name="INDEX_FIFO" high="5" low="3"><doc>Number of words remaining in input primitive fifo before asserting nearly full</doc></bitfield>
+ <bitfield name="REG_FIFO" high="13" low="6"><doc>Number of words remaining in input register fifo before asserting nearly full</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_FILL_A" access="rw" offset="0x422C">
+ <doc>Alpha fill color. FP20 format for alpha fill.</doc>
+ </reg32>
+ <reg32 name="GA_FILL_B" access="rw" offset="0x4228">
+ <doc>Blue fill color. FP20 format for blue fill.</doc>
+ </reg32>
+ <reg32 name="GA_FILL_G" access="rw" offset="0x4224">
+ <doc>Green fill color. FP20 format for green fill.</doc>
+ </reg32>
+ <reg32 name="GA_FILL_R" access="rw" offset="0x4220">
+ <doc>Red fill color. FP20 format for red fill.</doc>
+ </reg32>
+ <reg32 name="GA_IDLE" access="rw" offset="0x425C">
+ <doc>Returns idle status of various G3D block, captured when GA_IDLE written or when hard or soft reset asserted.</doc>
+ <bitfield name="PIPE3_Z_IDLE" high="0" low="0"><doc>Idle status of physical pipe 3 Z unit</doc></bitfield>
+ <bitfield name="PIPE2_Z_IDLE" high="1" low="1"><doc>Idle status of physical pipe 2 Z unit</doc></bitfield>
+ <bitfield name="PIPE3_CB_IDLE" high="2" low="2"><doc>Idle status of physical pipe 3 CB unit</doc></bitfield>
+ <bitfield name="PIPE2_CB_IDLE" high="3" low="3"><doc>Idle status of physical pipe 2 CB unit</doc></bitfield>
+ <bitfield name="PIPE3_FG_IDLE" high="4" low="4"><doc>Idle status of physical pipe 3 FG unit</doc></bitfield>
+ <bitfield name="PIPE2_FG_IDLE" high="5" low="5"><doc>Idle status of physical pipe 2 FG unit</doc></bitfield>
+ <bitfield name="PIPE3_US_IDLE" high="6" low="6"><doc>Idle status of physical pipe 3 US unit</doc></bitfield>
+ <bitfield name="PIPE2_US_IDLE" high="7" low="7"><doc>Idle status of physical pipe 2 US unit</doc></bitfield>
+ <bitfield name="PIPE3_SC_IDLE" high="8" low="8"><doc>Idle status of physical pipe 3 SC unit</doc></bitfield>
+ <bitfield name="PIPE2_SC_IDLE" high="9" low="9"><doc>Idle status of physical pipe 2 SC unit</doc></bitfield>
+ <bitfield name="PIPE3_RS_IDLE" high="10" low="10"><doc>Idle status of physical pipe 3 RS unit</doc></bitfield>
+ <bitfield name="PIPE2_RS_IDLE" high="11" low="11"><doc>Idle status of physical pipe 2 RS unit</doc></bitfield>
+ <bitfield name="PIPE1_Z_IDLE" high="12" low="12"><doc>Idle status of physical pipe 1 Z unit</doc></bitfield>
+ <bitfield name="PIPE0_Z_IDLE" high="13" low="13"><doc>Idle status of physical pipe 0 Z unit</doc></bitfield>
+ <bitfield name="PIPE1_CB_IDLE" high="14" low="14"><doc>Idle status of physical pipe 1 CB unit</doc></bitfield>
+ <bitfield name="PIPE0_CB_IDLE" high="15" low="15"><doc>Idle status of physical pipe 0 CB unit</doc></bitfield>
+ <bitfield name="PIPE1_FG_IDLE" high="16" low="16"><doc>Idle status of physical pipe 1 FG unit</doc></bitfield>
+ <bitfield name="PIPE0_FG_IDLE" high="17" low="17"><doc>Idle status of physical pipe 0 FG unit</doc></bitfield>
+ <bitfield name="PIPE1_US_IDLE" high="18" low="18"><doc>Idle status of physical pipe 1 US unit</doc></bitfield>
+ <bitfield name="PIPE0_US_IDLE" high="19" low="19"><doc>Idle status of physical pipe 0 US unit</doc></bitfield>
+ <bitfield name="PIPE1_SC_IDLE" high="20" low="20"><doc>Idle status of physical pipe 1 SC unit</doc></bitfield>
+ <bitfield name="PIPE0_SC_IDLE" high="21" low="21"><doc>Idle status of physical pipe 0 SC unit</doc></bitfield>
+ <bitfield name="PIPE1_RS_IDLE" high="22" low="22"><doc>Idle status of physical pipe 1 RS unit</doc></bitfield>
+ <bitfield name="PIPE0_RS_IDLE" high="23" low="23"><doc>Idle status of physical pipe 0 RS unit</doc></bitfield>
+ <bitfield name="SU_IDLE" high="24" low="24"><doc>Idle status of SU unit</doc></bitfield>
+ <bitfield name="GA_IDLE" high="25" low="25"><doc>Idle status of GA unit</doc></bitfield>
+ <bitfield name="GA_UNIT2_IDLE" high="26" low="26"><doc>Idle status of GA unit2</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_LINE_CNTL" access="rw" offset="0x4234">
+ <doc>Line control</doc>
+ <bitfield name="WIDTH" high="15" low="0"><doc>1/2 width of line, in subpixels (1/12 or 1/16 only, even in 8b subprecision); (16.0) fixed format.</doc></bitfield>
+ <bitfield name="END_TYPE" high="17" low="16">
+ <doc>Specifies how ends of lines should be drawn.</doc>
+ <use-enum ref="LINE_END" />
+ </bitfield>
+ <bitfield name="SORT" high="18" low="18">
+ <doc>R520+: When enabled, all lines are sorted so that V0 is vertex with smallest X, or if X equal, smallest Y.</doc>
+ <value value="0" name="NO_SORTING"><doc>No sorting (default)</doc></value>
+ <value value="1" name="SORT_ON_MINX_THAN_MINY"><doc>Sort on minX than MinY</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GA_LINE_STIPPLE_VALUE" access="rw" offset="0x4260">
+ <doc>Current value of stipple accumulator. 24b Integer, measuring stipple accumulation in subpixels (1/12 or 1/16, even in 8b precision). (note: field is 32b, but only lower 24b used)</doc>
+ </reg32>
+ <reg32 name="GA_OFFSET" access="rw" offset="0x4290">
+ <doc>Specifies x &amp; y offsets for vertex data after conversion to FP.</doc>
+ <bitfield name="X_OFFSET" high="15" low="0"><doc>Specifies X offset in S15 format (subpixels -- 1/12 or 1/16, even in 8b subprecision).</doc></bitfield>
+ <bitfield name="Y_OFFSET" high="31" low="16"><doc>Specifies Y offset in S15 format (subpixels -- 1/12 or 1/16, even in 8b subprecision).</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_POINT_SIZE" access="rw" offset="0x421C">
+ <doc>Dimensions for Points</doc>
+ <bitfield name="HEIGHT" high="15" low="0"><doc>1/2 Height of point; fixed (16.0), subpixel format (1/12 or 1/16, even if in 8b precision).</doc></bitfield>
+ <bitfield name="WIDTH" high="31" low="16"><doc>1/2 Width of point; fixed (16.0), subpixel format (1/12 or 1/16, even if in 8b precision)</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_ROUND_MODE" access="rw" offset="0x428C">
+ <doc>Specifies the rouding mode for geometry &amp; color SPFP to FP conversions.</doc>
+ <bitfield name="GEOMETRY_ROUND" high="1" low="0">
+ <doc>Trunc (0) or round to nearest (1) for geometry (XY).</doc>
+ <use-enum ref="ROUNDING_MODE" />
+ </bitfield>
+ <bitfield name="COLOR_ROUND" high="3" low="2">
+ <doc>When set, FP32 to FP20 using round to nearest; otherwise trunc</doc>
+ <use-enum ref="ROUNDING_MODE" />
+ </bitfield>
+ <bitfield name="RGB_CLAMP" high="4" low="4">
+ <doc>Specifies SPFP color clamp range of [0,1] or FP20 for RGB.</doc>
+ <value value="0" name="CLAMP_TO"><doc>Clamp to [0,1.0] for RGB</doc></value>
+ <value value="1" name="RGB_IS_FP20"><doc>RGB is FP20</doc></value>
+ </bitfield>
+ <bitfield name="ALPHA_CLAMP" high="5" low="5">
+ <doc>Specifies SPFP alpha clamp range of [0,1] or FP20.</doc>
+ <value value="0" name="CLAMP_TO"><doc>Clamp to [0,1.0] for Alpha</doc></value>
+ <value value="1" name="ALPHA_IS_FP20"><doc>Alpha is FP20</doc></value>
+ </bitfield>
+ <bitfield name="GEOMETRY_MASK" high="9" low="6"><doc>4b negative polarity mask for subpixel precision. Inverted version gets ANDed with subpixel X, Y masks.</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_SOLID_BA" access="rw" offset="0x4280">
+ <doc>Specifies blue &amp; alpha components of fill color -- S312 format -- Backwards comp.</doc>
+ <bitfield name="COLOR_ALPHA" high="15" low="0"><doc>Component alpha value. (S3.12)</doc></bitfield>
+ <bitfield name="COLOR_BLUE" high="31" low="16"><doc>Component blue value. (S3.12)</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_SOLID_RG" access="rw" offset="0x427C">
+ <doc>Specifies red &amp; green components of fill color -- S312 format -- Backwards comp.</doc>
+ <bitfield name="COLOR_GREEN" high="15" low="0"><doc>Component green value (S3.12).</doc></bitfield>
+ <bitfield name="COLOR_RED" high="31" low="16"><doc>Component red value (S3.12).</doc></bitfield>
+ </reg32>
+ <reg32 name="GA_US_VECTOR_DATA" access="rw" offset="0x4254">
+ <doc>Data register for loading US instructions and constants. 32 bit dword</doc>
+ </reg32>
+ <reg32 name="GA_US_VECTOR_INDEX" access="rw" offset="0x4250">
+ <doc>Used to load US instructions and constants</doc>
+ <bitfield name="INDEX" high="8" low="0"><doc>Instruction (TYPE == GA_US_VECTOR_INST) or constant (TYPE == GA_US_VECTOR_CONST) number at which to start loading. The GA will then expect n*6 (instructions) or n*4 (constants) writes to GA_US_VECTOR_DATA. The GA will self-increment until this register is written again. For instructions, the GA expects the dwords in the following order: US_CMN_INST, US_ALU_RGB_ADDR, US_ALU_ALPHA_ADDR, US_ALU_ALPHA, US_RGB_INST, US_ALPHA_INST, US_RGBA_INST. For constants, the GA expects the dwords in RGBA order.</doc></bitfield>
+ <bitfield name="TYPE" high="16" low="16">
+ <doc>Specifies if the GA should load instructions or constants.</doc>
+ <value value="0" name="LOAD_INSTRUCTIONS"><doc>Load instructions - INDEX is an instruction index</doc></value>
+ <value value="1" name="LOAD_CONSTANTS"><doc>Load constants - INDEX is a constant index</doc></value>
+ </bitfield>
+ <bitfield name="CLAMP" high="17" low="17">
+ <value value="0" name="NO_CLAMPING_OF_DATA"><doc>No clamping of data - Default</doc></value>
+ <value value="1" name="CLAMP_TO"><doc>Clamp to [-1.0,1.0] constant data</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GB_ENABLE" access="rw" offset="0x4008">
+ <doc>Specifies top of Raster pipe specific enable controls.</doc>
+ <bitfield name="POINT_STUFF_ENABLE" high="0" low="0">
+ <doc>Specifies if points will have stuffed texture coordinates.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="LINE_STUFF_ENABLE" high="1" low="1">
+ <doc>Specifies if lines will have stuffed texture coordinates.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TRIANGLE_STUFF_ENABLE" high="2" low="2">
+ <doc>Specifies if triangles will have stuffed texture coordinates.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="STENCIL_AUTO" high="5" low="4">
+ <doc>Specifies if the auto dec/inc stencil mode should be enabled, and how.</doc>
+ <use-enum ref="STENCIL_AUTO_MODE" />
+ </bitfield>
+ <bitfield name="TEX0_SOURCE" high="17" low="16">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX1_SOURCE" high="19" low="18">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX2_SOURCE" high="21" low="20">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX3_SOURCE" high="23" low="22">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX4_SOURCE" high="25" low="24">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX5_SOURCE" high="27" low="26">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX6_SOURCE" high="29" low="28">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX7_SOURCE" high="31" low="30">
+ <doc>Specifies the sources of the texture coordinates for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ </reg32>
+ <reg32 name="GB_FIFO_SIZE" access="rw" offset="0x4024">
+ <doc>Specifies the sizes of the various FIFO's in the sc/rs/us. This register must be the first one written</doc>
+ <bitfield name="SC_IFIFO_SIZE" high="1" low="0">
+ <doc>Size of scan converter input FIFO (XYZ)</doc>
+ <use-enum ref="WORDSIZE_32" />
+ </bitfield>
+ <bitfield name="SC_TZFIFO_SIZE" high="3" low="2">
+ <doc>Size of scan converter top-of-pipe Z FIFO</doc>
+ <use-enum ref="WORDSIZE_16" />
+ </bitfield>
+ <bitfield name="SC_BFIFO_SIZE" high="5" low="4">
+ <doc>Size of scan converter input FIFO (B)</doc>
+ <use-enum ref="WORDSIZE_32" />
+ </bitfield>
+ <bitfield name="RS_TFIFO_SIZE" high="7" low="6">
+ <doc>Size of ras input FIFO (Texture)</doc>
+ <use-enum ref="WORDSIZE_64" />
+ </bitfield>
+ <bitfield name="RS_CFIFO_SIZE" high="9" low="8">
+ <doc>Size of ras input FIFO (Color)</doc>
+ <use-enum ref="WORDSIZE_64" />
+ </bitfield>
+ <bitfield name="US_RAM_SIZE" high="11" low="10">
+ <doc>Size of us RAM</doc>
+ <use-enum ref="WORDSIZE_64" />
+ </bitfield>
+ <bitfield name="US_OFIFO_SIZE" high="13" low="12">
+ <doc>Size of us output FIFO (RGBA)</doc>
+ <use-enum ref="WORDSIZE_16" />
+ </bitfield>
+ <bitfield name="US_WFIFO_SIZE" high="15" low="14">
+ <doc>Size of us output FIFO (W)</doc>
+ <use-enum ref="WORDSIZE_16" />
+ </bitfield>
+ <bitfield name="RS_HIGHWATER_COL" high="18" low="16"><doc>High water mark for RS colors' fifo -- NOT USED</doc></bitfield>
+ <bitfield name="RS_HIGHWATER_TEX" high="21" low="19"><doc>High water mark for RS textures' fifo -- NOT USED</doc></bitfield>
+ <bitfield name="US_OFIFO_HIGHWATER" high="23" low="22">
+ <doc>High water mark for US output fifo</doc>
+ <use-enum ref="ENUM44" />
+ </bitfield>
+ <bitfield name="US_CUBE_FIFO_HIGHWATER" high="28" low="24"><doc>High water mark for US cube map fifo</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_FIFO_SIZE1" access="rw" offset="0x4070">
+ <doc>Specifies the sizes of the various FIFO's in the sc/rs.</doc>
+ <bitfield name="SC_HIGHWATER_IFIFO" high="5" low="0"><doc>High water mark for SC input fifo</doc></bitfield>
+ <bitfield name="SC_HIGHWATER_BFIFO" high="11" low="6"><doc>High water mark for SC input fifo (B)</doc></bitfield>
+ <bitfield name="RS_HIGHWATER_COL" high="17" low="12"><doc>High water mark for RS colors' fifo</doc></bitfield>
+ <bitfield name="RS_HIGHWATER_TEX" high="23" low="18"><doc>High water mark for RS textures' fifo</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_MSPOS0" access="rw" offset="0x4010">
+ <doc>Specifies the position of multisamples 0 through 2</doc>
+ <bitfield name="MS_X0" high="3" low="0"><doc>Specifies the x and y position (in subpixels) of multisample 0</doc></bitfield>
+ <bitfield name="MS_Y0" high="7" low="4"><doc>Specifies the x and y position (in subpixels) of multisample 0</doc></bitfield>
+ <bitfield name="MS_X1" high="11" low="8"><doc>Specifies the x and y position (in subpixels) of multisample 1</doc></bitfield>
+ <bitfield name="MS_Y1" high="15" low="12"><doc>Specifies the x and y position (in subpixels) of multisample 1</doc></bitfield>
+ <bitfield name="MS_X2" high="19" low="16"><doc>Specifies the x and y position (in subpixels) of multisample 2</doc></bitfield>
+ <bitfield name="MS_Y2" high="23" low="20"><doc>Specifies the x and y position (in subpixels) of multisample 2</doc></bitfield>
+ <bitfield name="MSBD0_Y" high="27" low="24"><doc>Specifies the minimum x and y distance (in subpixels) between the pixel edge and the multisamples. These values are used in the first (coarse) scan converter</doc></bitfield>
+ <bitfield name="MSBD0_X" high="31" low="28"><doc>Specifies the minimum x and y distance (in subpixels) between the pixel edge and the multisamples. These values are used in the first (coarse) scan converter</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_MSPOS1" access="rw" offset="0x4014">
+ <doc>Specifies the position of multisamples 3 through 5</doc>
+ <bitfield name="MS_X3" high="3" low="0"><doc>Specifies the x and y position (in subpixels) of multisample 3</doc></bitfield>
+ <bitfield name="MS_Y3" high="7" low="4"><doc>Specifies the x and y position (in subpixels) of multisample 3</doc></bitfield>
+ <bitfield name="MS_X4" high="11" low="8"><doc>Specifies the x and y position (in subpixels) of multisample 4</doc></bitfield>
+ <bitfield name="MS_Y4" high="15" low="12"><doc>Specifies the x and y position (in subpixels) of multisample 4</doc></bitfield>
+ <bitfield name="MS_X5" high="19" low="16"><doc>Specifies the x and y position (in subpixels) of multisample 5</doc></bitfield>
+ <bitfield name="MS_Y5" high="23" low="20"><doc>Specifies the x and y position (in subpixels) of multisample 5</doc></bitfield>
+ <bitfield name="MSBD1" high="27" low="24"><doc>Specifies the minimum distance (in subpixels) between the pixel edge and the multisamples. This value is used in the second (quad) scan converter</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_PIPE_SELECT" access="rw" offset="0x402C">
+ <doc>Selects which of 4 pipes are active.</doc>
+ <bitfield name="PIPE0_ID" high="1" low="0"><doc>Maps physical pipe 0 to logical pipe ID (def 0).</doc></bitfield>
+ <bitfield name="PIPE1_ID" high="3" low="2"><doc>Maps physical pipe 1 to logical pipe ID (def 1).</doc></bitfield>
+ <bitfield name="PIPE2_ID" high="5" low="4"><doc>Maps physical pipe 2 to logical pipe ID (def 2).</doc></bitfield>
+ <bitfield name="PIPE3_ID" high="7" low="6"><doc>Maps physical pipe 3 to logical pipe ID (def 3).</doc></bitfield>
+ <bitfield name="PIPE_MASK" high="11" low="8">
+ <doc>4b mask, indicates which physical pipes are enabled (def none=0x0) -- B3=P3, B2=P2, B1=P1, B0=P0. -- 1: enabled, 0: disabled</doc>
+ <value value="3" name="P3"><doc>P3, B</doc></value>
+ <value value="2" name="P2"><doc>P2, B</doc></value>
+ <value value="1" name="P1"><doc>P1, B</doc></value>
+ <value value="0" name="P0"><doc>P0. -- 1: enabled,</doc></value>
+ <value value="0" name="DISABLED"><doc>disabled</doc></value>
+ </bitfield>
+ <bitfield name="MAX_PIPE" high="13" low="12"><doc>2b, indicates, by the fuses, the max number of allowed pipes. 0 = 1 pipe ... 3 = 4 pipes -- Read Only</doc></bitfield>
+ <bitfield name="BAD_PIPES" high="17" low="14">
+ <doc>4b, indicates, by the fuses, the bad pipes: B3=P3, B2=P2, B1=P1, B0=P0 -- 1: bad, 0: good -- Read Only</doc>
+ <value value="3" name="P3"><doc>P3, B</doc></value>
+ <value value="2" name="P2"><doc>P2, B</doc></value>
+ <value value="1" name="P1"><doc>P1, B</doc></value>
+ <value value="0" name="P0"><doc>P0 --</doc></value>
+ <value value="1" name="BAD"><doc>bad,</doc></value>
+ <value value="0" name="GOOD"><doc>good -- Read Only</doc></value>
+ </bitfield>
+ <bitfield name="CONFIG_PIPES" high="18" low="18">
+ <doc>If this bit is set when writing this register, the logical pipe ID values are assigned automatically based on the values that are read back in the MAX_PIPE and BAD_PIPES fields. This field is always read back as 0.</doc>
+ <value value="0" name="DO_NOTHING"><doc>Do nothing</doc></value>
+ <value value="1" name="FORCE_SELF"><doc>Force self-configuration</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GB_SELECT" access="rw" offset="0x401C">
+ <doc>Specifies various polygon specific selects (fog, depth, perspective).</doc>
+ <bitfield name="FOG_SELECT" high="2" low="0">
+ <doc>Specifies source for outgoing (GA to SU) fog value.</doc>
+ <use-enum ref="FOG_SELECT" />
+ </bitfield>
+ <bitfield name="DEPTH_SELECT" high="3" low="3">
+ <doc>Specifies source for outgoing (GA/SU &amp; SU/RAS) depth value.</doc>
+ <use-enum ref="DEPTH_SELECT" />
+ </bitfield>
+ <bitfield name="W_SELECT" high="4" low="4">
+ <doc>Specifies source for outgoing (1/W) value, used to disable perspective correct colors/textures.</doc>
+ <use-enum ref="W_SELECT" />
+ </bitfield>
+ <bitfield name="FOG_STUFF_ENABLE" high="5" low="5">
+ <doc>Controls enabling of fog stuffing into texture coordinate.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="FOG_STUFF_TEX" high="9" low="6"><doc>Controls which texture gets fog value</doc></bitfield>
+ <bitfield name="FOG_STUFF_COMP" high="11" low="10"><doc>Controls which component of texture gets fog value</doc></bitfield>
+ </reg32>
+ <reg32 name="GB_TILE_CONFIG" access="rw" offset="0x4018">
+ <doc>Specifies the graphics pipeline configuration for rasterization</doc>
+ <bitfield name="ENABLE" high="0" low="0">
+ <doc>Enables tiling, otherwise all tiles receive all polygons.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="PIPE_COUNT" high="3" low="1">
+ <doc>Specifies the number of active pipes and contexts (up to 4 pipes, 1 ctx). When this field is written, it is automatically reduced by hardware so as not to use more pipes than the number indicated in GB_PIPE_SELECT.MAX_PIPES or the number of pipes left unmasked GB_PIPE_SELECT.BAD_PIPES. The potentially altered value is read back, rather than the original value written by software.</doc>
+ <value value="0" name="RV350"><doc>RV350 (1 pipe, 1 ctx)</doc></value>
+ <value value="3" name="R300"><doc>R300 (2 pipes, 1 ctx) 06 – R420-3P (3 pipes, 1 ctx) 07 – R420 (4 pipes, 1 ctx)</doc></value>
+ </bitfield>
+ <bitfield name="TILE_SIZE" high="5" low="4">
+ <doc>Specifies width &amp; height (square), in pixels (only 16, 32 available).</doc>
+ <value value="0" name="8_PIXELS"><doc>8 pixels.</doc></value>
+ <value value="1" name="16_PIXELS"><doc>16 pixels.</doc></value>
+ <value value="2" name="32_PIXELS"><doc>32 pixels.</doc></value>
+ </bitfield>
+ <bitfield name="SUPER_SIZE" high="8" low="6">
+ <doc>Specifies number of tiles and config in super chip configuration.</doc>
+ <use-enum ref="ENUM50" />
+ </bitfield>
+ <bitfield name="SUPER_X" high="11" low="9"><doc>X Location of chip within super tile.</doc></bitfield>
+ <bitfield name="SUPER_Y" high="14" low="12"><doc>Y Location of chip within super tile.</doc></bitfield>
+ <bitfield name="SUPER_TILE" high="15" low="15">
+ <doc>Tile location of chip in a multi super tile config (Super size of 2,8,32 or 128).</doc>
+ <use-enum ref="SUPERTILE_LOCATION" />
+ </bitfield>
+ <bitfield name="SUBPIXEL" high="16" low="16">
+ <doc>Specifies the precision of subpixels wrt pixels (12 or 16).</doc>
+ <use-enum ref="SUBPIXEL_PRECISION" />
+ </bitfield>
+ <bitfield name="QUADS_PER_RAS" high="18" low="17">
+ <doc>Specifies the number of quads to be sent to each rasterizer in turn when in RV300B or R300B mode</doc>
+ <value value="0" name="4_QUADS"><doc>4 Quads</doc></value>
+ <value value="1" name="8_QUADS"><doc>8 Quads</doc></value>
+ <value value="2" name="16_QUADS"><doc>16 Quads</doc></value>
+ <value value="3" name="32_QUADS"><doc>32 Quads</doc></value>
+ </bitfield>
+ <bitfield name="BB_SCAN" high="19" low="19">
+ <doc>Specifies whether to use an intercept or bounding box based calculation for the first (coarse) scan converter</doc>
+ <value value="0" name="USE_INTERCEPT_BASED_SCAN_CONVERTER"><doc>Use intercept based scan converter</doc></value>
+ <value value="1" name="USE_BOUNDING_BOX_BASED_SCAN_CONVERTER"><doc>Use bounding box based scan converter</doc></value>
+ </bitfield>
+ <bitfield name="ALT_SCAN_EN" high="20" low="20">
+ <doc>Specifies whether to use an altenate scan pattern for the coarse scan converter</doc>
+ <value value="0" name="USE_NORMAL_LEFT"><doc>Use normal left-right scan</doc></value>
+ <value value="1" name="USE_ALTERNATE_LEFT"><doc>Use alternate left-right-left scan</doc></value>
+ </bitfield>
+ <bitfield name="ALT_OFFSET" high="21" low="21">
+ <doc>Not used -- should be 0</doc>
+ <value value="0" name="NOT_USED"><doc>Not used</doc></value>
+ <value value="1" name="NOT_USED"><doc>Not used</doc></value>
+ </bitfield>
+ <bitfield name="SUBPRECISION" high="22" low="22"><doc>Set to 0</doc></bitfield>
+ <bitfield name="ALT_TILING" high="23" low="23">
+ <doc>Support for 3x2 tiling in 3P mode</doc>
+ <value value="0" name="USE_DEFAULT_TILING_IN_ALL_TILING_MODES"><doc>Use default tiling in all tiling modes</doc></value>
+ <value value="1" name="USE_ALTERNATIVE_3X2_TILING_IN_3P_MODE"><doc>Use alternative 3x2 tiling in 3P mode</doc></value>
+ </bitfield>
+ <bitfield name="Z_EXTENDED" high="24" low="24">
+ <doc>Support for extended setup Z range from [0,1] to [-2,2] with per pixel clamping</doc>
+ <value value="0" name="USE"><doc>Use (24.1) Z format, with vertex clamp to [1.0,0.0]</doc></value>
+ <value value="1" name="USE"><doc>Use (S25.1) format, with vertex clamp to [2.0,- 2.0] and per pixel [1.0,0.0]</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="GB_Z_PEQ_CONFIG" access="rw" offset="0x4028">
+ <doc>Specifies the z plane equation configuration.</doc>
+ <bitfield name="Z_PEQ_SIZE" high="0" low="0">
+ <doc>Specifies the z plane equation size.</doc>
+ <value value="0" name="4X4_Z_PLANE_EQUATIONS"><doc>4x4 z plane equations (point-sampled or aa)</doc></value>
+ <value value="1" name="8X8_Z_PLANE_EQUATIONS"><doc>8x8 z plane equations (point-sampled only)</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="PS3_ENABLE" access="rw" offset="0x4118">
+ <doc>PS3 mode enable register</doc>
+ <bitfield name="PS3_MODE" high="0" low="0">
+ <doc>When reset (default), follows R300/PS2 mode; when set, allows for new ps3 mode.</doc>
+ <value value="0" name="DEFAULT_PS2_MODE"><doc>Default PS2 mode</doc></value>
+ <value value="1" name="NEW_PS3_MODE"><doc>New PS3 mode</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="PS3_TEX_SOURCE" access="rw" offset="0x4120">
+ <doc>Specifies source for texture components in PS3 mode</doc>
+ <bitfield name="TEX0_SOURCE" high="1" low="0">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX1_SOURCE" high="3" low="2">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX2_SOURCE" high="5" low="4">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX3_SOURCE" high="7" low="6">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX4_SOURCE" high="9" low="8">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX5_SOURCE" high="11" low="10">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX6_SOURCE" high="13" low="12">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX7_SOURCE" high="15" low="14">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX8_SOURCE" high="17" low="16">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ <bitfield name="TEX9_SOURCE" high="19" low="18">
+ <doc>Specifies VAP source, or GA (ST) or GA (STR) stuffing for each texture.</doc>
+ <use-enum ref="TEX_COORD_SRC" />
+ </bitfield>
+ </reg32>
+ <reg32 name="PS3_VTX_FMT" access="rw" offset="0x411C">
+ <doc>PS3 vertex format register</doc>
+ <bitfield name="TEX_0_COMP_CNT" high="2" low="0">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_1_COMP_CNT" high="5" low="3">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_2_COMP_CNT" high="8" low="6">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_3_COMP_CNT" high="11" low="9">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_4_COMP_CNT" high="14" low="12">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_5_COMP_CNT" high="17" low="15">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_6_COMP_CNT" high="20" low="18">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_7_COMP_CNT" high="23" low="21">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_8_COMP_CNT" high="26" low="24">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_9_COMP_CNT" high="29" low="27">
+ <doc>How many active components (0,1,2,3,4) are in each texture.</doc>
+ <use-enum ref="ENUM177" />
+ </bitfield>
+ <bitfield name="TEX_10_COMP_CNT" high="31" low="30">
+ <doc>How many active components (0,2,3,4) are in texture 10.</doc>
+ <value value="0" name="NOT_ACTIVE"><doc>Not active</doc></value>
+ <value value="1" name="2_COMPONENT"><doc>2 component (GA/SU)</doc></value>
+ <value value="2" name="3_COMPONENT"><doc>3 component (GA/SU)</doc></value>
+ <value value="3" name="4_COMPONENT"><doc>4 component (GA/SU)</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="RS_COUNT" access="rw" offset="0x4300">
+ <doc>This register specifies the rasterizer input packet configuration</doc>
+ <bitfield name="IT_COUNT" high="6" low="0"><doc>Specifies the total number of texture address components contained in the rasterizer input packet (0:32).</doc></bitfield>
+ <bitfield name="IC_COUNT" high="10" low="7"><doc>Specifies the total number of colors contained in the rasterizer input packet (0:4).</doc></bitfield>
+ <bitfield name="W_ADDR" high="17" low="12"><doc>Specifies the relative rasterizer input packet location of w (if w_count==1)</doc></bitfield>
+ <bitfield name="HIRES_EN" high="18" low="18"><doc>Enable high resolution texture coordinate output when q is equal to 1</doc></bitfield>
+ </reg32>
+ <stripe offset="0x4320" stride="0x0004" length="16">
+ <reg32 name="RS_INST" access="rw" offset="0x0000">
+ <doc>This table specifies what happens during each rasterizer instruction</doc>
+ <bitfield name="TEX_ID" high="3" low="0"><doc>Specifies the index (into the RS_IP table) of the texture address output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="TEX_CN" high="4" low="4">
+ <doc>Write enable for texture address</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_ADDR" high="11" low="5"><doc>Specifies the destination address (within the current pixel stack frame) of the texture address output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="COL_ID" high="15" low="12"><doc>Specifies the index (into the RS_IP table) of the color output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="COL_CN" high="17" low="16">
+ <doc>Write enable for color</doc>
+ <value value="0" name="NO_WRITE"><doc>No write - color not valid</doc></value>
+ <value value="1" name="WRITE"><doc>write - color valid</doc></value>
+ <value value="2" name="WRITE_FBUFFER"><doc>write fbuffer - XY00-&gt;RGBA</doc></value>
+ <value value="3" name="WRITE_BACKFACE"><doc>write backface - B000-&gt;RGBA</doc></value>
+ </bitfield>
+ <bitfield name="COL_ADDR" high="24" low="18"><doc>Specifies the destination address (within the current pixel stack frame) of the color output during this rasterizer instruction</doc></bitfield>
+ <bitfield name="TEX_ADJ" high="25" low="25">
+ <doc>Specifies whether to sample texture coordinates at the real or adjusted pixel centers</doc>
+ <use-enum ref="PIXEL_CENTER" />
+ </bitfield>
+ <bitfield name="W_CN" high="26" low="26">
+ <doc>Specifies that the rasterizer should output w</doc>
+ <value value="0" name="NO_WRITE"><doc>No write - w not valid</doc></value>
+ <value value="1" name="WRITE"><doc>write - w valid</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="RS_INST_COUNT" access="rw" offset="0x4304">
+ <doc>This register specifies the number of rasterizer instructions</doc>
+ <bitfield name="INST_COUNT" high="3" low="0"><doc>Number of rasterizer instructions (1:16)</doc></bitfield>
+ <bitfield name="TX_OFFSET" high="7" low="5"><doc>Indicates range of texture offset to minimize peroidic errors on texels sampled right on their edges</doc></bitfield>
+ </reg32>
+ <stripe offset="0x4074" stride="0x0004" length="16">
+ <reg32 name="RS_IP" access="rw" offset="0x0000">
+ <doc>This table specifies the source location and format for up to 16 texture addresses (i[0]:i[15]) and four colors (c[0]:c[3])</doc>
+ <bitfield name="TEX_PTR_S" high="5" low="0"><doc>Specifies the relative rasterizer input packet location of each component (S, T, R, and Q) of texture address (i[i]). The values 62 and 63 select constant inputs for the component: 62 selects K0 (0.0), and 63 selects K1 (1.0).</doc></bitfield>
+ <bitfield name="TEX_PTR_T" high="11" low="6"><doc>Specifies the relative rasterizer input packet location of each component (S, T, R, and Q) of texture address (i[i]). The values 62 and 63 select constant inputs for the component: 62 selects K0 (0.0), and 63 selects K1 (1.0).</doc></bitfield>
+ <bitfield name="TEX_PTR_R" high="17" low="12"><doc>Specifies the relative rasterizer input packet location of each component (S, T, R, and Q) of texture address (i[i]). The values 62 and 63 select constant inputs for the component: 62 selects K0 (0.0), and 63 selects K1 (1.0).</doc></bitfield>
+ <bitfield name="TEX_PTR_Q" high="23" low="18"><doc>Specifies the relative rasterizer input packet location of each component (S, T, R, and Q) of texture address (i[i]). The values 62 and 63 select constant inputs for the component: 62 selects K0 (0.0), and 63 selects K1 (1.0).</doc></bitfield>
+ <bitfield name="COL_PTR" high="26" low="24"><doc>Specifies the relative rasterizer input packet location of the color (c[i]).</doc></bitfield>
+ <bitfield name="COL_FMT" high="30" low="27">
+ <doc>Specifies the format of the color (c[i]).</doc>
+ <use-enum ref="COLFMT" />
+ </bitfield>
+ <bitfield name="OFFSET_EN" high="31" low="31">
+ <doc>Enable application of the TX_OFFSET in RS_INST_COUNT</doc>
+ <value value="0" name="DO_NOT_APPLY_THE_TX_OFFSET_IN_RS_INST_COUNT"><doc>Do not apply the TX_OFFSET in RS_INST_COUNT</doc></value>
+ <value value="1" name="APPLY_THE_TX_OFFSET_SPECIFIED_BY_RS_INST_COUNT"><doc>Apply the TX_OFFSET specified by RS_INST_COUNT</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="SC_EDGERULE" access="rw" offset="0x43A8">
+ <doc>Edge rules - what happens when an edge falls exactly on a sample point</doc>
+ <bitfield name="ER_TRI" high="4" low="0">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ <bitfield name="ER_POINT" high="9" low="5">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ <bitfield name="ER_LINE_LR" high="14" low="10">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ <bitfield name="ER_LINE_RL" high="19" low="15">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ <bitfield name="ER_LINE_TB" high="24" low="20">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ <bitfield name="ER_LINE_BT" high="29" low="25">
+ <doc>Edge rules for triangles, points, left-right lines, right-left lines, upper-bottom lines, bottom-upper lines. For values 0 to 15, bit 0 specifies whether a sample on a horizontal- bottom edge is in, bit 1 specifies whether a sample on a horizontal-top edge is in, bit 2 species whether a sample on a right edge is in, bit 3 specifies whether a sample on a left edge is in. For values 16 to 31, bit 0 specifies whether a sample on a vertical-right edge is in, bit 1 specifies whether a sample on a vertical-left edge is in, bit 2 species whether a sample on a bottom edge is in, bit 3 specifies whether a sample on a top edge is in</doc>
+ <use-enum ref="ENUM59" />
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_REG_DEST" access="rw" offset="0x42C8">
+ <doc>SU Raster pipe destination select for registers</doc>
+ <bitfield name="SELECT" high="3" low="0">
+ <doc>Register read/write destination select: b0: logical pipe0, b1: logical pipe1, b2: logical pipe2 and b3: logical pipe3</doc>
+ <value value="0" name="LOGICAL_PIPE0"><doc>logical pipe0, b</doc></value>
+ <value value="1" name="LOGICAL_PIPE1"><doc>logical pipe1, b</doc></value>
+ <value value="2" name="LOGICAL_PIPE2_AND_B"><doc>logical pipe2 and b</doc></value>
+ <value value="3" name="LOGICAL_PIPE3"><doc>logical pipe3</doc></value>
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_TEX_WRAP" access="rw" offset="0x42A0">
+ <doc>Enables for Cylindrical Wrapping</doc>
+ <bitfield name="T0C0" high="0" low="0">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T0C1" high="1" low="1">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T0C2" high="2" low="2">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T0C3" high="3" low="3">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T1C0" high="4" low="4">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T1C1" high="5" low="5">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T1C2" high="6" low="6">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T1C3" high="7" low="7">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T2C0" high="8" low="8">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T2C1" high="9" low="9">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T2C2" high="10" low="10">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T2C3" high="11" low="11">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T3C0" high="12" low="12">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T3C1" high="13" low="13">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T3C2" high="14" low="14">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T3C3" high="15" low="15">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T4C0" high="16" low="16">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T4C1" high="17" low="17">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T4C2" high="18" low="18">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T4C3" high="19" low="19">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T5C0" high="20" low="20">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T5C1" high="21" low="21">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T5C2" high="22" low="22">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T5C3" high="23" low="23">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T6C0" high="24" low="24">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T6C1" high="25" low="25">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T6C2" high="26" low="26">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T6C3" high="27" low="27">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T7C0" high="28" low="28">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T7C1" high="29" low="29">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T7C2" high="30" low="30">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T7C3" high="31" low="31">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="SU_TEX_WRAP_PS3" access="rw" offset="0x4114">
+ <doc>Specifies texture wrapping for new PS3 textures.</doc>
+ <bitfield name="T9C0" high="0" low="0">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T9C1" high="1" low="1">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T9C2" high="2" low="2">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T9C3" high="3" low="3">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T8C0" high="4" low="4">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T8C1" high="5" low="5">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T8C2" high="6" low="6">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="T8C3" high="7" low="7">
+ <doc>tNcM -- Enable texture wrapping on component M (S,T,R,Q) of texture N.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <stripe offset="0x45C0" stride="0x0004" length="16">
+ <reg32 name="TX_BORDER_COLOR" access="rw" offset="0x0000">
+ <doc>Border Color. Color used for borders. Format is the same as the texture being bordered.</doc>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4580" stride="0x0004" length="16">
+ <reg32 name="TX_CHROMA_KEY" access="rw" offset="0x0000">
+ <doc>Texture Chroma Key. Color used for chroma key compare. Format is the same as the texture being keyed.</doc>
+ </reg32>
+ </stripe>
+ <reg32 name="TX_ENABLE" access="rw" offset="0x4104">
+ <doc>Texture Enables for Maps 0 to 15</doc>
+ <bitfield name="TEX_0_ENABLE" high="0" low="0">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_1_ENABLE" high="1" low="1">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_2_ENABLE" high="2" low="2">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_3_ENABLE" high="3" low="3">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_4_ENABLE" high="4" low="4">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_5_ENABLE" high="5" low="5">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_6_ENABLE" high="6" low="6">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_7_ENABLE" high="7" low="7">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_8_ENABLE" high="8" low="8">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_9_ENABLE" high="9" low="9">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_10_ENABLE" high="10" low="10">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_11_ENABLE" high="11" low="11">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_12_ENABLE" high="12" low="12">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_13_ENABLE" high="13" low="13">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_14_ENABLE" high="14" low="14">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TEX_15_ENABLE" high="15" low="15">
+ <doc>Texture Map Enables.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+ <stripe offset="0x4400" stride="0x0004" length="16">
+ <reg32 name="TX_FILTER0" access="rw" offset="0x0000">
+ <doc>Texture Filter State</doc>
+ <bitfield name="CLAMP_S" high="2" low="0">
+ <doc>Clamp mode for texture coordinates</doc>
+ <use-enum ref="TX_FILTER_CLAMP" />
+ </bitfield>
+ <bitfield name="CLAMP_T" high="5" low="3">
+ <doc>Clamp mode for texture coordinates</doc>
+ <use-enum ref="TX_FILTER_CLAMP" />
+ </bitfield>
+ <bitfield name="CLAMP_R" high="8" low="6">
+ <doc>Clamp mode for texture coordinates</doc>
+ <use-enum ref="TX_FILTER_CLAMP" />
+ </bitfield>
+ <bitfield name="MAG_FILTER" high="10" low="9">
+ <doc>Filter used when texture is magnified</doc>
+ <use-enum ref="TX_FILTER_R500" />
+ </bitfield>
+ <bitfield name="MIN_FILTER" high="12" low="11">
+ <doc>Filter used when texture is minified</doc>
+ <use-enum ref="TX_FILTER_R500" />
+ </bitfield>
+ <bitfield name="MIP_FILTER" high="14" low="13">
+ <doc>Filter used between mipmap levels</doc>
+ <use-enum ref="TX_FILTER" />
+ </bitfield>
+ <bitfield name="VOL_FILTER" high="16" low="15">
+ <doc>Filter used between layers of a volume. (if no filter is specifed, select from MIN/MAG filters)</doc>
+ <use-enum ref="TX_FILTER" />
+ </bitfield>
+ <bitfield name="MAX_MIP_LEVEL" high="20" low="17"><doc>LOD index of largest (finest) mipmap to use (0 is largest). Ranges from 0 to NUM_LEVELS.</doc></bitfield>
+ <bitfield name="ID" high="31" low="28"><doc>Logical id for this physical texture</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4440" stride="0x0004" length="16">
+ <reg32 name="TX_FILTER1" access="rw" offset="0x0000">
+ <doc>Texture Filter State</doc>
+ <bitfield name="CHROMA_KEY_MODE" high="1" low="0">
+ <doc>Chroma Key Mode</doc>
+ <use-enum ref="CHROMA_KEY" />
+ </bitfield>
+ <bitfield name="MC_ROUND" high="2" low="2">
+ <doc>Bilinear rounding mode</doc>
+ <use-enum ref="BILINEAR_ROUNDING" />
+ </bitfield>
+ <bitfield name="LOD_BIAS" high="12" low="3"><doc>(s4.5). Ranges from -16.0 to 15.99. Mipmap LOD bias measured in mipmap levels. Added to the signed, computed LOD before the LOD is clamped.</doc></bitfield>
+ <bitfield name="MC_COORD_TRUNCATE" high="14" low="14">
+ <doc>MPEG coordinate truncation mode</doc>
+ <use-enum ref="MPEG_TRUNC_MODE" />
+ </bitfield>
+ <bitfield name="TRI_PERF" high="16" low="15">
+ <doc>Apply slope and bias to trilerp fraction to reduce the number of 2-level fetches for trilinear. Should only be used if MIP_FILTER is LINEAR.</doc>
+ <value value="0" name="BREAKPOINT"><doc>Breakpoint=0/8. lfrac_out = lfrac_in</doc></value>
+ <value value="1" name="BREAKPOINT"><doc>Breakpoint=1/8. lfrac_out = clamp(4/3*lfrac_in - 1/6)</doc></value>
+ <value value="2" name="BREAKPOINT"><doc>Breakpoint=1/4. lfrac_out = clamp(2*lfrac_in - 1/2)</doc></value>
+ <value value="3" name="BREAKPOINT"><doc>Breakpoint=3/8. lfrac_out = clamp(4*lfrac_in - 3/2)</doc></value>
+ </bitfield>
+ <bitfield name="Reserved" high="19" low="17"><doc>Set to 0</doc></bitfield>
+ <bitfield name="Reserved" high="20" low="20"><doc>Set to 0</doc></bitfield>
+ <bitfield name="Reserved" high="21" low="21"><doc>Set to 0</doc></bitfield>
+ <bitfield name="MACRO_SWITCH" high="22" low="22">
+ <doc>If enabled, addressing switches to macro-linear when image width is &lt;= 8 micro-tiles. If disabled, functionality is same as RV350, switch to macro-linear when image width is &lt; 8 micro-tiles.</doc>
+ <value value="0" name="RV350_MODE"><doc>RV350 mode</doc></value>
+ <value value="1" name="SWITCH_FROM_MACRO"><doc>Switch from macro-tiled to macro-linear when (width &lt;= 8 micro-tiles)</doc></value>
+ </bitfield>
+ <bitfield name="BORDER_FIX" high="31" low="31">
+ <doc>To fix issues when using non-square mipmaps, with border_color, and extreme minification.</doc>
+ <value value="0" name="R3XX_R4XX_MODE"><doc>R3xx R4xx mode</doc></value>
+ <value value="1" name="STOP_RIGHT_SHIFTING_COORD_ONCE_MIP_SIZE_IS_PINNED_TO_ONE"><doc>Stop right shifting coord once mip size is pinned to one</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="TX_FILTER4" access="rw" offset="0x4110">
+ <doc>Filter4 Kernel</doc>
+ <bitfield name="WEIGHT_1" high="10" low="0"><doc>(s1.9). Bottom or Right weight of pair.</doc></bitfield>
+ <bitfield name="WEIGHT_0" high="21" low="11"><doc>(s1.9). Top or Left weight of pair.</doc></bitfield>
+ <bitfield name="WEIGHT_PAIR" high="22" low="22">
+ <doc>Indicates which pair of weights within phase to load.</doc>
+ <value value="0" name="TOP_OR_LEFT"><doc>Top or Left</doc></value>
+ <value value="1" name="BOTTOM_OR_RIGHT"><doc>Bottom or Right</doc></value>
+ </bitfield>
+ <bitfield name="PHASE" high="26" low="23"><doc>Indicates which of 9 phases to load</doc></bitfield>
+ <bitfield name="DIRECTION" high="27" low="27">
+ <doc>Indicates whether to load the horizontal or vertical weights</doc>
+ <value value="0" name="HORIZONTAL"><doc>Horizontal</doc></value>
+ <value value="1" name="VERTICAL"><doc>Vertical</doc></value>
+ </bitfield>
+ </reg32>
+ <stripe offset="0x4480" stride="0x0004" length="16">
+ <reg32 name="TX_FORMAT0" access="rw" offset="0x0000">
+ <doc>Texture Format State</doc>
+ <bitfield name="TXWIDTH" high="10" low="0"><doc>Image width - 1. The largest image is 4096 texels. When wrapping or mirroring, must be a power of 2. When mipmapping, must be a power of 2 or padded to a power of 2 in memory. Can always be non-square, except for cube maps which must be square.</doc></bitfield>
+ <bitfield name="TXHEIGHT" high="21" low="11"><doc>Image height - 1. The largest image is 4096 texels. When wrapping or mirroring, must be a power of 2. When mipmapping, must be a power of 2 or padded to a power of 2 in memory. Can always be non-square, except for cube maps which must be square.</doc></bitfield>
+ <bitfield name="TXDEPTH" high="25" low="22"><doc>LOG2(depth) of volume texture</doc></bitfield>
+ <bitfield name="NUM_LEVELS" high="29" low="26"><doc>Number of mipmap levels minus 1. Ranges from 0 to 12. Equivalent to LOD index of smallest (coarsest) mipmap to use.</doc></bitfield>
+ <bitfield name="PROJECTED" high="30" low="30">
+ <doc>Specifies whether texture coords are projected.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="TXPITCH_EN" high="31" low="31">
+ <doc>Indicates when TXPITCH should be used instead of TXWIDTH for image addressing</doc>
+ <use-enum ref="TXWIDTH_OR_PITCH" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x44C0" stride="0x0004" length="16">
+ <reg32 name="TX_FORMAT1" access="rw" offset="0x0000">
+ <doc>Texture Format State</doc>
+ <bitfield name="TXFORMAT" high="4" low="0">
+ <doc>Texture Format. Components are numbered right to left. Parenthesis indicate typical uses of each format.</doc>
+ <value value="0" name="TX_FMT_8_OR_TX_FMT_1"><doc>TX_FMT_8 or TX_FMT_1 (if TX_FORMAT2.TXFORMAT_MSB is set)</doc></value>
+ <value value="1" name="TX_FMT_16_OR_TX_FMT_1_REVERSE"><doc>TX_FMT_16 or TX_FMT_1_REVERSE (if TX_FORMAT2.TXFORMAT_MSB is set)</doc></value>
+ <value value="2" name="TX_FMT_4_4_OR_TX_FMT_10"><doc>TX_FMT_4_4 or TX_FMT_10 (if TX_FORMAT2.TXFORMAT_MSB is set)</doc></value>
+ <value value="3" name="TX_FMT_8_8_OR_TX_FMT_10_10"><doc>TX_FMT_8_8 or TX_FMT_10_10 (if TX_FORMAT2.TXFORMAT_MSB is set)</doc></value>
+ <value value="4" name="TX_FMT_16_16_OR_TX_FMT_10_10_10_10"><doc>TX_FMT_16_16 or TX_FMT_10_10_10_10 (if TX_FORMAT2.TXFORMAT_MSB is set)</doc></value>
+ <value value="5" name="TX_FMT_3_3_2_OR_TX_FMT_ATI1N"><doc>TX_FMT_3_3_2 or TX_FMT_ATI1N (if TX_FORMAT2.TXFORMAT_MSB is set)</doc></value>
+ <value value="6" name="TX_FMT_5_6_5"><doc>TX_FMT_5_6_5</doc></value>
+ <value value="7" name="TX_FMT_6_5_5"><doc>TX_FMT_6_5_5</doc></value>
+ <value value="8" name="TX_FMT_11_11_10"><doc>TX_FMT_11_11_10</doc></value>
+ <value value="9" name="TX_FMT_10_11_11"><doc>TX_FMT_10_11_11</doc></value>
+ <value value="10" name="TX_FMT_4_4_4_4"><doc>TX_FMT_4_4_4_4</doc></value>
+ <value value="11" name="TX_FMT_1_5_5_5"><doc>TX_FMT_1_5_5_5</doc></value>
+ <value value="12" name="TX_FMT_8_8_8_8"><doc>TX_FMT_8_8_8_8</doc></value>
+ <value value="13" name="TX_FMT_2_10_10_10"><doc>TX_FMT_2_10_10_10</doc></value>
+ <value value="14" name="TX_FMT_16_16_16_16"><doc>TX_FMT_16_16_16_16</doc></value>
+ <value value="18" name="TX_FMT_Y8"><doc>TX_FMT_Y8</doc></value>
+ <value value="19" name="TX_FMT_AVYU444"><doc>TX_FMT_AVYU444</doc></value>
+ <value value="20" name="TX_FMT_VYUY422"><doc>TX_FMT_VYUY422</doc></value>
+ <value value="21" name="TX_FMT_YVYU422"><doc>TX_FMT_YVYU422</doc></value>
+ <value value="22" name="TX_FMT_16_MPEG"><doc>TX_FMT_16_MPEG</doc></value>
+ <value value="23" name="TX_FMT_16_16_MPEG"><doc>TX_FMT_16_16_MPEG</doc></value>
+ <value value="24" name="TX_FMT_16F"><doc>TX_FMT_16f</doc></value>
+ <value value="25" name="TX_FMT_16F_16F"><doc>TX_FMT_16f_16f</doc></value>
+ <value value="26" name="TX_FMT_16F_16F_16F_16F"><doc>TX_FMT_16f_16f_16f_16f</doc></value>
+ <value value="27" name="TX_FMT_32F"><doc>TX_FMT_32f</doc></value>
+ <value value="28" name="TX_FMT_32F_32F"><doc>TX_FMT_32f_32f</doc></value>
+ <value value="29" name="TX_FMT_32F_32F_32F_32F"><doc>TX_FMT_32f_32f_32f_32f</doc></value>
+ <value value="30" name="TX_FMT_W24_FP"><doc>TX_FMT_W24_FP</doc></value>
+ <value value="31" name="TX_FMT_ATI2N"><doc>TX_FMT_ATI2N</doc></value>
+ </bitfield>
+ <bitfield name="SIGNED_COMP0" high="5" low="5">
+ <doc>Component filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="TEXEL_SIGNATION" />
+ </bitfield>
+ <bitfield name="SIGNED_COMP1" high="6" low="6">
+ <doc>Component filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="TEXEL_SIGNATION" />
+ </bitfield>
+ <bitfield name="SIGNED_COMP2" high="7" low="7">
+ <doc>Component filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="TEXEL_SIGNATION" />
+ </bitfield>
+ <bitfield name="SIGNED_COMP3" high="8" low="8">
+ <doc>Component filter should interpret texel data as signed or unsigned. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="TEXEL_SIGNATION" />
+ </bitfield>
+ <bitfield name="SEL_ALPHA" high="11" low="9">
+ <doc>Specifies swizzling for each channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="SEL_RED" high="14" low="12">
+ <doc>Specifies swizzling for each channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="SEL_GREEN" high="17" low="15">
+ <doc>Specifies swizzling for each channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="SEL_BLUE" high="20" low="18">
+ <doc>Specifies swizzling for each channel at the input of the pixel shader. (Ignored for Y/YUV formats.)</doc>
+ <use-enum ref="COLOR_COMPONENT" />
+ </bitfield>
+ <bitfield name="GAMMA" high="21" low="21">
+ <doc>Optionally remove gamma from texture before passing to shader. Only apply to 8bit or less components.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="YUV_TO_RGB" high="23" low="22">
+ <doc>YUV to RGB conversion mode</doc>
+ <use-enum ref="YUV_TO_RGB_MODE" />
+ </bitfield>
+ <bitfield name="SWAP_YUV" high="24" low="24"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="TEX_COORD_TYPE" high="26" low="25">
+ <doc>Specifies coordinate type.</doc>
+ <use-enum ref="COORD_TYPE" />
+ </bitfield>
+ <bitfield name="CACHE" high="31" low="27">
+ <doc>This field is ignored on R520 and RV510.</doc>
+ <use-enum ref="TEXCACHE" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4500" stride="0x0004" length="16">
+ <reg32 name="TX_FORMAT2" access="rw" offset="0x0000">
+ <doc>Texture Format State</doc>
+ <bitfield name="TXPITCH" high="13" low="0"><doc>Used instead of TXWIDTH for image addressing when TXPITCH_EN is asserted. Pitch is given as number of texels minus one. Maximum pitch is 16K texels.</doc></bitfield>
+ <bitfield name="TXFORMAT_MSB" high="14" low="14"><doc>Specifies the MSB of the texture format to extend the number of formats to 64.</doc></bitfield>
+ <bitfield name="TXWIDTH_11" high="15" low="15"><doc>Specifies bit 11 of TXWIDTH to extend the largest image to 4096 texels.</doc></bitfield>
+ <bitfield name="TXHEIGHT_11" high="16" low="16"><doc>Specifies bit 11 of TXHEIGHT to extend the largest image to 4096 texels.</doc></bitfield>
+ <bitfield name="POW2FIX2FLT" high="17" low="17">
+ <doc>Optionally divide by 256 instead of 255 during fix2float. Can only be asserted for 8-bit components.</doc>
+ <value value="0" name="DIVIDE_BY_POW2"><doc>Divide by pow2-1 for fix2float (default)</doc></value>
+ <value value="1" name="DIVIDE_BY_POW2_FOR_FIX2FLOAT"><doc>Divide by pow2 for fix2float</doc></value>
+ </bitfield>
+ <bitfield name="SEL_FILTER4" high="19" low="18">
+ <doc>If filter4 is enabled, specifies which texture component to apply filter4 to.</doc>
+ <value value="0" name="SELECT_TEXTURE_COMPONENT0"><doc>Select Texture Component0.</doc></value>
+ <value value="1" name="SELECT_TEXTURE_COMPONENT1"><doc>Select Texture Component1.</doc></value>
+ <value value="2" name="SELECT_TEXTURE_COMPONENT2"><doc>Select Texture Component2.</doc></value>
+ <value value="3" name="SELECT_TEXTURE_COMPONENT3"><doc>Select Texture Component3.</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="TX_INVALTAGS" access="rw" offset="0x4100">
+ <doc>Invalidate texture cache tags. Unused</doc>
+ </reg32>
+ <stripe offset="0x4540" stride="0x0004" length="16">
+ <reg32 name="TX_OFFSET" access="rw" offset="0x0000">
+ <doc>Texture Offset State</doc>
+ <bitfield name="ENDIAN_SWAP" high="1" low="0">
+ <doc>Endian Control</doc>
+ <use-enum ref="BYTESWAP" />
+ </bitfield>
+ <bitfield name="MACRO_TILE" high="2" low="2">
+ <doc>Macro Tile Control</doc>
+ <use-enum ref="MACROTILE" />
+ </bitfield>
+ <bitfield name="MICRO_TILE" high="4" low="3">
+ <doc>Micro Tile Control</doc>
+ <use-enum ref="MICROTILE" />
+ </bitfield>
+ <bitfield name="TXOFFSET" high="31" low="5"><doc>32-byte aligned pointer to base map</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0xA800" stride="0x0004" length="512">
+ <reg32 name="US_ALU_ALPHA_INST" access="rw" offset="0x0000">
+ <doc>ALU Alpha Instruction</doc>
+ <bitfield name="ALPHA_OP" high="3" low="0">
+ <doc>Specifies the opcode for this instruction.</doc>
+ <value value="0" name="OP_MAD"><doc>OP_MAD: Result = A*B + C</doc></value>
+ <value value="1" name="OP_DP"><doc>OP_DP: Result = dot product from RGB ALU</doc></value>
+ <value value="2" name="OP_MIN"><doc>OP_MIN: Result = min(A,B)</doc></value>
+ <value value="3" name="OP_MAX"><doc>OP_MAX: Result = max(A,B)</doc></value>
+ <value value="5" name="OP_CND"><doc>OP_CND: Result = cnd(A,B,C) = (C&gt;0.5)?A:B</doc></value>
+ <value value="6" name="OP_CMP"><doc>OP_CMP: Result = cmp(A,B,C) = (C&gt;=0.0)?A:B</doc></value>
+ <value value="7" name="OP_FRC"><doc>OP_FRC: Result = A-floor(A)</doc></value>
+ <value value="8" name="OP_EX2"><doc>OP_EX2: Result = 2^^A</doc></value>
+ <value value="9" name="OP_LN2"><doc>OP_LN2: Result = log2(A)</doc></value>
+ <value value="10" name="OP_RCP"><doc>OP_RCP: Result = 1/A</doc></value>
+ <value value="11" name="OP_RSQ"><doc>OP_RSQ: Result = 1/sqrt(A)</doc></value>
+ <value value="12" name="OP_SIN"><doc>OP_SIN: Result = sin(A*2pi)</doc></value>
+ <value value="13" name="OP_COS"><doc>OP_COS: Result = cos(A*2pi)</doc></value>
+ <value value="14" name="OP_MDH"><doc>OP_MDH: Result = A*B + C; A is always topleft.src0, C is always topright.src0 (source select and swizzles ignored). Input modifiers are respected for all inputs.</doc></value>
+ <value value="15" name="OP_MDV"><doc>OP_MDV: Result = A*B + C; A is always topleft.src0, C is always bottomleft.src0 (source select and swizzles ignored). Input modifiers are respected for all inputs.</doc></value>
+ </bitfield>
+ <bitfield name="ALPHA_ADDRD" high="10" low="4"><doc>Specifies the address of the pixel stack frame register to which the Alpha result of this instruction is to be written.</doc></bitfield>
+ <bitfield name="ALPHA_ADDRD_REL" high="11" low="11">
+ <doc>Specifies whether the loop register is added to the value of ALPHA_ADDRD before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALPHA_SEL_A" high="13" low="12">
+ <doc>Specifies the operands for Alpha inputs A and B.</doc>
+ <use-enum ref="SEL_OPERAND" />
+ </bitfield>
+ <bitfield name="ALPHA_SWIZ_A" high="16" low="14">
+ <doc>Specifies the channel sources for Alpha inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="ALPHA_MOD_A" high="18" low="17">
+ <doc>Specifies the input modifiers for Alpha inputs A and B.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="ALPHA_SEL_B" high="20" low="19">
+ <doc>Specifies the operands for Alpha inputs A and B.</doc>
+ <use-enum ref="SEL_OPERAND" />
+ </bitfield>
+ <bitfield name="ALPHA_SWIZ_B" high="23" low="21">
+ <doc>Specifies the channel sources for Alpha inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="ALPHA_MOD_B" high="25" low="24">
+ <doc>Specifies the input modifiers for Alpha inputs A and B.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="OMOD" high="28" low="26">
+ <doc>Specifies the output modifier for this instruction.</doc>
+ <use-enum ref="ALU_ALPHA_OUTPUT_MOD" />
+ </bitfield>
+ <bitfield name="TARGET" high="30" low="29">
+ <doc>This specifies which (cached) frame buffer target to write to. For non-output ALU instructions, this specifies how to compare the results against zero when setting the predicate bits.</doc>
+ <use-enum ref="ALU_PREDICATE_COMPARE" />
+ </bitfield>
+ <bitfield name="W_OMASK" high="31" low="31">
+ <doc>Specifies whether or not to write the Alpha component of the result of this instuction to the depth output fifo.</doc>
+ <value value="0" name="NONE"><doc>NONE: Do not write output to w.</doc></value>
+ <value value="1" name="A"><doc>A: Write the alpha channel only to w.</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x9800" stride="0x0004" length="512">
+ <reg32 name="US_ALU_ALPHA_ADDR" access="rw" offset="0x0000">
+ <doc>This table specifies the Alpha source addresses and pre-subtract operation for up to 512 ALU instruction. The ALU expects 6 source operands - three for color (rgb0, rgb1, rgb2) and three for alpha (a0, a1, a2). The pre-subtract operation creates two more (rgbp and ap).</doc>
+ <bitfield name="ADDR0" high="7" low="0"><doc>Specifies the identity of source operands a0, a1, and a2. If the const field is set, this number ranges from 0 to 255 and specifies a location within the constant register bank. Otherwise: If the most significant bit is cleared, this field specifies a location within the current pixel stack frame (ranging from 0 to 127). If the most significant bit is set, then the lower 7 bits specify an inline unsigned floating- point constant with 4 bit exponent (bias 7) and 3 bit mantissa, including denormals but excluding infinite/NaN.</doc></bitfield>
+ <bitfield name="ADDR0_CONST" high="8" low="8">
+ <doc>Specifies whether the associated address is a constant register address or a temporary address / inline constant.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR0_REL" high="9" low="9">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR1" high="17" low="10"><doc>Specifies the identity of source operands a0, a1, and a2. If the const field is set, this number ranges from 0 to 255 and specifies a location within the constant register bank. Otherwise: If the most significant bit is cleared, this field specifies a location within the current pixel stack frame (ranging from 0 to 127). If the most significant bit is set, then the lower 7 bits specify an inline unsigned floating- point constant with 4 bit exponent (bias 7) and 3 bit mantissa, including denormals but excluding infinite/NaN.</doc></bitfield>
+ <bitfield name="ADDR1_CONST" high="18" low="18">
+ <doc>Specifies whether the associated address is a constant register address or a temporary address / inline constant.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR1_REL" high="19" low="19">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR2" high="27" low="20"><doc>Specifies the identity of source operands a0, a1, and a2. If the const field is set, this number ranges from 0 to 255 and specifies a location within the constant register bank. Otherwise: If the most significant bit is cleared, this field specifies a location within the current pixel stack frame (ranging from 0 to 127). If the most significant bit is set, then the lower 7 bits specify an inline unsigned floating- point constant with 4 bit exponent (bias 7) and 3 bit mantissa, including denormals but excluding infinite/NaN.</doc></bitfield>
+ <bitfield name="ADDR2_CONST" high="28" low="28">
+ <doc>Specifies whether the associated address is a constant register address or a temporary address / inline constant.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR2_REL" high="29" low="29">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SRCP_OP" high="31" low="30">
+ <doc>Specifies how the pre-subtract value (SRCP) is computed.</doc>
+ <use-enum ref="ENUM99" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0xB000" stride="0x0004" length="512">
+ <reg32 name="US_ALU_RGBA_INST" access="rw" offset="0x0000">
+ <doc>ALU Shared RGBA Instruction</doc>
+ <bitfield name="RGB_OP" high="3" low="0">
+ <doc>Specifies the opcode for this instruction.</doc>
+ <value value="0" name="OP_MAD"><doc>OP_MAD: Result = A*B + C</doc></value>
+ <value value="1" name="OP_DP3"><doc>OP_DP3: Result = A.r*B.r + A.g*B.g + A.b*B.b</doc></value>
+ <value value="2" name="OP_DP4"><doc>OP_DP4: Result = A.r*B.r + A.g*B.g + A.b*B.b + A.a*B.a</doc></value>
+ <value value="3" name="OP_D2A"><doc>OP_D2A: Result = A.r*B.r + A.g*B.g + C.b</doc></value>
+ <value value="4" name="OP_MIN"><doc>OP_MIN: Result = min(A,B)</doc></value>
+ <value value="5" name="OP_MAX"><doc>OP_MAX: Result = max(A,B)</doc></value>
+ <value value="7" name="OP_CND"><doc>OP_CND: Result = cnd(A,B,C) = (C&gt;0.5)?A:B</doc></value>
+ <value value="8" name="OP_CMP"><doc>OP_CMP: Result = cmp(A,B,C) = (C&gt;=0.0)?A:B</doc></value>
+ <value value="9" name="OP_FRC"><doc>OP_FRC: Result = A-floor(A)</doc></value>
+ <value value="10" name="OP_SOP"><doc>OP_SOP: Result = ex2,ln2,rcp,rsq,sin,cos from Alpha ALU</doc></value>
+ <value value="11" name="OP_MDH"><doc>OP_MDH: Result = A*B + C; A is always topleft.src0, C is always topright.src0 (source select and swizzles ignored). Input modifiers are respected for all inputs.</doc></value>
+ <value value="12" name="OP_MDV"><doc>OP_MDV: Result = A*B + C; A is always topleft.src0, C is always bottomleft.src0 (source select and swizzles ignored). Input modifiers are respected for all inputs.</doc></value>
+ </bitfield>
+ <bitfield name="RGB_ADDRD" high="10" low="4"><doc>Specifies the address of the pixel stack frame register to which the RGB result of this instruction is to be written.</doc></bitfield>
+ <bitfield name="RGB_ADDRD_REL" high="11" low="11">
+ <doc>Specifies whether the loop register is added to the value of RGB_ADDRD before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="RGB_SEL_C" high="13" low="12">
+ <doc>Specifies the operands for RGB and Alpha input C.</doc>
+ <use-enum ref="SEL_OPERAND" />
+ </bitfield>
+ <bitfield name="RED_SWIZ_C" high="16" low="14">
+ <doc>Specifies, per channel, the sources for RGB and Alpha input C.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="GREEN_SWIZ_C" high="19" low="17">
+ <doc>Specifies, per channel, the sources for RGB and Alpha input C.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="BLUE_SWIZ_C" high="22" low="20">
+ <doc>Specifies, per channel, the sources for RGB and Alpha input C.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="RGB_MOD_C" high="24" low="23">
+ <doc>Specifies the input modifiers for RGB and Alpha input C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="ALPHA_SEL_C" high="26" low="25">
+ <doc>Specifies the operands for RGB and Alpha input C.</doc>
+ <use-enum ref="SEL_OPERAND" />
+ </bitfield>
+ <bitfield name="ALPHA_SWIZ_C" high="29" low="27">
+ <doc>Specifies, per channel, the sources for RGB and Alpha input C.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="ALPHA_MOD_C" high="31" low="30">
+ <doc>Specifies the input modifiers for RGB and Alpha input C.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0xA000" stride="0x0004" length="512">
+ <reg32 name="US_ALU_RGB_INST" access="rw" offset="0x0000">
+ <doc>ALU RGB Instruction</doc>
+ <bitfield name="RGB_SEL_A" high="1" low="0">
+ <doc>Specifies the operands for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_OPERAND" />
+ </bitfield>
+ <bitfield name="RED_SWIZ_A" high="4" low="2">
+ <doc>Specifies, per channel, the sources for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="GREEN_SWIZ_A" high="7" low="5">
+ <doc>Specifies, per channel, the sources for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="BLUE_SWIZ_A" high="10" low="8">
+ <doc>Specifies, per channel, the sources for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="RGB_MOD_A" high="12" low="11">
+ <doc>Specifies the input modifiers for RGB inputs A and B.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="RGB_SEL_B" high="14" low="13">
+ <doc>Specifies the operands for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_OPERAND" />
+ </bitfield>
+ <bitfield name="RED_SWIZ_B" high="17" low="15">
+ <doc>Specifies, per channel, the sources for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="GREEN_SWIZ_B" high="20" low="18">
+ <doc>Specifies, per channel, the sources for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="BLUE_SWIZ_B" high="23" low="21">
+ <doc>Specifies, per channel, the sources for RGB inputs A and B.</doc>
+ <use-enum ref="SEL_SRC" />
+ </bitfield>
+ <bitfield name="RGB_MOD_B" high="25" low="24">
+ <doc>Specifies the input modifiers for RGB inputs A and B.</doc>
+ <use-enum ref="ALU_INPUT_MOD" />
+ </bitfield>
+ <bitfield name="OMOD" high="28" low="26">
+ <doc>Specifies the output modifier for this instruction.</doc>
+ <use-enum ref="ALU_ALPHA_OUTPUT_MOD" />
+ </bitfield>
+ <bitfield name="TARGET" high="30" low="29">
+ <doc>This specifies which (cached) frame buffer target to write to. For non-output ALU instructions, this specifies how to compare the results against zero when setting the predicate bits.</doc>
+ <use-enum ref="ALU_PREDICATE_COMPARE" />
+ </bitfield>
+ <bitfield name="ALU_WMASK" high="31" low="31">
+ <doc>Specifies whether to update the current ALU result.</doc>
+ <value value="0" name="DO_NOT_MODIFY_THE_CURRENT_ALU_RESULT"><doc>Do not modify the current ALU result.</doc></value>
+ <value value="1" name="MODIFY_THE_CURRENT_ALU_RESULT_BASED_ON_THE_SETTINGS_OF_ALU_RESULT_SEL_AND_ALU_RESULT_OP"><doc>Modify the current ALU result based on the settings of ALU_RESULT_SEL and ALU_RESULT_OP.</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x9000" stride="0x0004" length="512">
+ <reg32 name="US_ALU_RGB_ADDR" access="rw" offset="0x0000">
+ <doc>This table specifies the RGB source addresses and pre-subtract operation for up to 512 ALU instructions. The ALU expects 6 source operands - three for color (rgb0, rgb1, rgb2) and three for alpha (a0, a1, a2). The pre-subtract operation creates two more (rgbp and ap).</doc>
+ <bitfield name="ADDR0" high="7" low="0"><doc>Specifies the identity of source operands rgb0, rgb1, and rgb2. If the const field is set, this number ranges from 0 to 255 and specifies a location within the constant register bank. Otherwise: If the most significant bit is cleared, this field specifies a location within the current pixel stack frame (ranging from 0 to 127). If the most significant bit is set, then the lower 7 bits specify an inline unsigned floating-point constant with 4 bit exponent (bias 7) and 3 bit mantissa, including denormals but excluding infinite/NaN.</doc></bitfield>
+ <bitfield name="ADDR0_CONST" high="8" low="8">
+ <doc>Specifies whether the associated address is a constant register address or a temporary address / inline constant.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR0_REL" high="9" low="9">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR1" high="17" low="10"><doc>Specifies the identity of source operands rgb0, rgb1, and rgb2. If the const field is set, this number ranges from 0 to 255 and specifies a location within the constant register bank. Otherwise: If the most significant bit is cleared, this field specifies a location within the current pixel stack frame (ranging from 0 to 127). If the most significant bit is set, then the lower 7 bits specify an inline unsigned floating-point constant with 4 bit exponent (bias 7) and 3 bit mantissa, including denormals but excluding infinite/NaN.</doc></bitfield>
+ <bitfield name="ADDR1_CONST" high="18" low="18">
+ <doc>Specifies whether the associated address is a constant register address or a temporary address / inline constant.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR1_REL" high="19" low="19">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR2" high="27" low="20"><doc>Specifies the identity of source operands rgb0, rgb1, and rgb2. If the const field is set, this number ranges from 0 to 255 and specifies a location within the constant register bank. Otherwise: If the most significant bit is cleared, this field specifies a location within the current pixel stack frame (ranging from 0 to 127). If the most significant bit is set, then the lower 7 bits specify an inline unsigned floating-point constant with 4 bit exponent (bias 7) and 3 bit mantissa, including denormals but excluding infinite/NaN.</doc></bitfield>
+ <bitfield name="ADDR2_CONST" high="28" low="28">
+ <doc>Specifies whether the associated address is a constant register address or a temporary address / inline constant.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ADDR2_REL" high="29" low="29">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SRCP_OP" high="31" low="30">
+ <doc>Specifies how the pre-subtract value (SRCP) is computed.</doc>
+ <use-enum ref="ENUM105" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0xB800" stride="0x0004" length="512">
+ <reg32 name="US_CMN_INST" access="rw" offset="0x0000">
+ <doc>Shared instruction fields for all instruction types</doc>
+ <bitfield name="TYPE" high="1" low="0">
+ <doc>Specifies the type of instruction. Note that output instructions write to render targets.</doc>
+ <value value="0" name="US_INST_TYPE_ALU"><doc>US_INST_TYPE_ALU: This instruction is an ALU instruction.</doc></value>
+ <value value="1" name="US_INST_TYPE_OUT"><doc>US_INST_TYPE_OUT: This instruction is an output instruction.</doc></value>
+ <value value="2" name="US_INST_TYPE_FC"><doc>US_INST_TYPE_FC: This instruction is a flow control instruction.</doc></value>
+ <value value="3" name="US_INST_TYPE_TEX"><doc>US_INST_TYPE_TEX: This instruction is a texture instruction.</doc></value>
+ </bitfield>
+ <bitfield name="TEX_SEM_WAIT" high="2" low="2">
+ <doc>Specifies whether to wait for the texture semaphore.</doc>
+ <value value="0" name="THIS_INSTRUCTION_MAY_ISSUE_IMMEDIATELY"><doc>This instruction may issue immediately.</doc></value>
+ <value value="1" name="THIS_INSTRUCTION_WILL_NOT_ISSUE_UNTIL_THE_TEXTURE_SEMAPHORE_IS_AVAILABLE"><doc>This instruction will not issue until the texture semaphore is available.</doc></value>
+ </bitfield>
+ <bitfield name="RGB_PRED_SEL" high="5" low="3">
+ <doc>Specifies whether the instruction uses predication. For ALU/TEX/Output this specifies predication for the RGB channels only. For FC this specifies the predicate for the entire instruction.</doc>
+ <value value="0" name="US_PRED_SEL_NONE"><doc>US_PRED_SEL_NONE: No predication</doc></value>
+ <value value="1" name="US_PRED_SEL_RGBA"><doc>US_PRED_SEL_RGBA: Independent Channel Predication</doc></value>
+ <value value="2" name="US_PRED_SEL_RRRR"><doc>US_PRED_SEL_RRRR: R-Replicate Predication</doc></value>
+ <value value="3" name="US_PRED_SEL_GGGG"><doc>US_PRED_SEL_GGGG: G-Replicate Predication</doc></value>
+ <value value="4" name="US_PRED_SEL_BBBB"><doc>US_PRED_SEL_BBBB: B-Replicate Predication</doc></value>
+ <value value="5" name="US_PRED_SEL_AAAA"><doc>US_PRED_SEL_AAAA: A-Replicate Predication</doc></value>
+ </bitfield>
+ <bitfield name="RGB_PRED_INV" high="6" low="6">
+ <doc>Specifies whether the predicate should be inverted. For ALU/TEX/Output this specifies predication for the RGB channels only. For FC this specifies the predicate for the entire instruction.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="WRITE_INACTIVE" high="7" low="7">
+ <doc>Specifies which pixels to write to.</doc>
+ <value value="0" name="ONLY_WRITE_TO_CHANNELS_OF_ACTIVE_PIXELS"><doc>Only write to channels of active pixels</doc></value>
+ <value value="1" name="WRITE_TO_CHANNELS_OF_ALL_PIXELS"><doc>Write to channels of all pixels, including inactive pixels</doc></value>
+ </bitfield>
+ <bitfield name="LAST" high="8" low="8">
+ <doc>Specifies whether this is the last instruction.</doc>
+ <value value="0" name="DO_NOT_TERMINATE_THE_SHADER_AFTER_EXECUTING_THIS_INSTRUCTION"><doc>Do not terminate the shader after executing this instruction (unless this instruction is at END_ADDR).</doc></value>
+ <value value="1" name="ALL_ACTIVE_PIXELS_ARE_WILLING_TO_TERMINATE_AFTER_EXECUTING_THIS_INSTRUCTION"><doc>All active pixels are willing to terminate after executing this instruction. There is no guarantee that the shader will actually terminate here. This feature is provided as a performance optimization for tests where pixels can conditionally terminate early.</doc></value>
+ </bitfield>
+ <bitfield name="NOP" high="9" low="9">
+ <doc>Specifies whether to insert a NOP instruction after this. This would get specified in order to meet dependency requirements for the pre-subtract inputs, and dependency requirements for src0 of an MDH/MDV instruction.</doc>
+ <value value="0" name="DO_NOT_INSERT_NOP_INSTRUCTION_AFTER_THIS_ONE"><doc>Do not insert NOP instruction after this one.</doc></value>
+ <value value="1" name="INSERT_A_NOP_INSTRUCTION_AFTER_THIS_ONE"><doc>Insert a NOP instruction after this one.</doc></value>
+ </bitfield>
+ <bitfield name="ALU_WAIT" high="10" low="10">
+ <doc>Specifies whether to wait for pending ALU instructions to complete before issuing this instruction.</doc>
+ <value value="0" name="DO_NOT_WAIT_FOR_PENDING_ALU_INSTRUCTIONS_TO_COMPLETE_BEFORE_ISSUING_THE_CURRENT_INSTRUCTION"><doc>Do not wait for pending ALU instructions to complete before issuing the current instruction.</doc></value>
+ <value value="1" name="WAIT_FOR_PENDING_ALU_INSTRUCTIONS_TO_COMPLETE_BEFORE_ISSUING_THE_CURRENT_INSTRUCTION"><doc>Wait for pending ALU instructions to complete before issuing the current instruction.</doc></value>
+ </bitfield>
+ <bitfield name="RGB_WMASK" high="13" low="11">
+ <doc>Specifies which components of the result of the RGB instruction are written to the pixel stack frame.</doc>
+ <use-enum ref="WRITE_MASK" />
+ </bitfield>
+ <bitfield name="ALPHA_WMASK" high="14" low="14">
+ <doc>Specifies whether the result of the Alpha instruction is written to the pixel stack frame.</doc>
+ <value value="0" name="NONE"><doc>NONE: Do not write register.</doc></value>
+ <value value="1" name="A"><doc>A: Write the alpha channel only.</doc></value>
+ </bitfield>
+ <bitfield name="RGB_OMASK" high="17" low="15">
+ <doc>Specifies which components of the result of the RGB instruction are written to the output fifo if this is an output instruction, and which predicate bits should be modified if this is an ALU instruction.</doc>
+ <use-enum ref="WRITE_MASK" />
+ </bitfield>
+ <bitfield name="ALPHA_OMASK" high="18" low="18">
+ <doc>Specifies whether the result of the Alpha instruction is written to the output fifo if this is an output instruction, and whether the Alpha predicate bit should be modified if this is an ALU instruction.</doc>
+ <value value="0" name="NONE"><doc>NONE: Do not write output.</doc></value>
+ <value value="1" name="A"><doc>A: Write the alpha channel only.</doc></value>
+ </bitfield>
+ <bitfield name="RGB_CLAMP" high="19" low="19">
+ <doc>Specifies RGB and Alpha clamp mode for this instruction.</doc>
+ <use-enum ref="CLAMP_MODE" />
+ </bitfield>
+ <bitfield name="ALPHA_CLAMP" high="20" low="20">
+ <doc>Specifies RGB and Alpha clamp mode for this instruction.</doc>
+ <use-enum ref="CLAMP_MODE" />
+ </bitfield>
+ <bitfield name="ALU_RESULT_SEL" high="21" low="21">
+ <doc>Specifies which component of the result of this instruction should be used as the 'ALU result' by a subsequent flow control instruction.</doc>
+ <value value="0" name="RED"><doc>RED: Use red as ALU result for FC.</doc></value>
+ <value value="1" name="ALPHA"><doc>ALPHA: Use alpha as ALU result for FC.</doc></value>
+ </bitfield>
+ <bitfield name="ALPHA_PRED_INV" high="22" low="22">
+ <doc>Specifies whether the predicate should be inverted. For ALU/TEX/Output this specifies predication for the alpha channel only. This field has no effect on FC instructions.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ALU_RESULT_OP" high="24" low="23">
+ <doc>Specifies how to compare the ALU result against zero for the 'alu_result' bit in a subsequent flow control instruction.</doc>
+ <value value="0" name="EQUAL_TO"><doc>Equal to</doc></value>
+ <value value="1" name="LESS_THAN"><doc>Less than</doc></value>
+ <value value="2" name="GREATER_THAN_OR_EQUAL_TO"><doc>Greater than or equal to</doc></value>
+ <value value="3" name="NOT_EQUAL"><doc>Not equal</doc></value>
+ </bitfield>
+ <bitfield name="ALPHA_PRED_SEL" high="27" low="25">
+ <doc>Specifies whether the instruction uses predication. For ALU/TEX/Output this specifies predication for the alpha channel only. This field has no effect on FC instructions.</doc>
+ <value value="0" name="US_PRED_SEL_NONE"><doc>US_PRED_SEL_NONE: No predication</doc></value>
+ <value value="1" name="US_PRED_SEL_RGBA"><doc>US_PRED_SEL_RGBA: A predication (identical to US_PRED_SEL_AAAA)</doc></value>
+ <value value="2" name="US_PRED_SEL_RRRR"><doc>US_PRED_SEL_RRRR: R Predication</doc></value>
+ <value value="3" name="US_PRED_SEL_GGGG"><doc>US_PRED_SEL_GGGG: G Predication</doc></value>
+ <value value="4" name="US_PRED_SEL_BBBB"><doc>US_PRED_SEL_BBBB: B Predication</doc></value>
+ <value value="5" name="US_PRED_SEL_AAAA"><doc>US_PRED_SEL_AAAA: A Predication</doc></value>
+ </bitfield>
+ <bitfield name="STAT_WE" high="31" low="28"><doc>Specifies which components (R,G,B,A) contribute to the stat count</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_CODE_ADDR" access="rw" offset="0x4630">
+ <doc>Code start and end instruction addresses.</doc>
+ <bitfield name="START_ADDR" high="8" low="0"><doc>Specifies the address of the first instruction to execute in the shader program. This address is relative to the shader program offset given in US_CODE_OFFSET.OFFSET_ADDR.</doc></bitfield>
+ <bitfield name="END_ADDR" high="24" low="16"><doc>Specifies the address of the last instruction to execute in the shader program. This address is relative to the shader program offset given in US_CODE_OFFSET.OFFSET_ADDR. Shader program execution will always terminate after the instruction at this address is executed.</doc></bitfield>
+ </reg32>
+ <reg32 name="US_CODE_OFFSET" access="rw" offset="0x4638">
+ <doc>Offsets used for relative instruction addresses in the shader program, including START_ADDR, END_ADDR, and any non-global flow control jump addresses.</doc>
+ <bitfield name="OFFSET_ADDR" high="8" low="0"><doc>Specifies the offset to add to relative instruction addresses, including START_ADDR, END_ADDR, and some flow control jump addresses.</doc></bitfield>
+ </reg32>
+ <reg32 name="US_CODE_RANGE" access="rw" offset="0x4634">
+ <doc>Range of instructions that contains the current shader program.</doc>
+ <bitfield name="CODE_ADDR" high="8" low="0"><doc>Specifies the start address of the current code window. This address is an absolute address.</doc></bitfield>
+ <bitfield name="CODE_SIZE" high="24" low="16"><doc>Specifies the size of the current code window, minus one. The last instruction in the code window is given by CODE_ADDR + CODE_SIZE.</doc></bitfield>
+ </reg32>
+ <reg32 name="US_CONFIG" access="rw" offset="0x4600">
+ <doc>Shader Configuration</doc>
+ <bitfield name="Reserved" high="0" low="0"><doc>Set to 0</doc></bitfield>
+ <bitfield name="ZERO_TIMES_ANYTHING_EQUALS_ZERO" high="1" low="1">
+ <doc>Control how ALU multiplier behaves when one argument is zero. This affects the multiplier used in MAD and dot product calculations.</doc>
+ <value value="0" name="DEFAULT_BEHAVIOUR"><doc>Default behaviour (0*inf=nan,0*nan=nan)</doc></value>
+ <value value="1" name="LEGACY_BEHAVIOUR_FOR_SHADER_MODEL_1"><doc>Legacy behaviour for shader model 1 (0*anything=0)</doc></value>
+ </bitfield>
+ </reg32>
+ <stripe offset="0xA000" stride="0x0004" length="512">
+ <reg32 name="US_FC_ADDR" access="rw" offset="0x0000">
+ <doc>Flow Control Instruction Address Fields</doc>
+ <bitfield name="BOOL_ADDR" high="4" low="0"><doc>The address of the static boolean register to use in the jump function.</doc></bitfield>
+ <bitfield name="INT_ADDR" high="12" low="8"><doc>The address of the static integer register to use for loop/rep and endloop/endrep.</doc></bitfield>
+ <bitfield name="JUMP_ADDR" high="24" low="16"><doc>The address to jump to if the jump function evaluates to true.</doc></bitfield>
+ <bitfield name="JUMP_GLOBAL" high="31" low="31">
+ <doc>Specifies whether to interpret JUMP_ADDR as a global address.</doc>
+ <value value="0" name="ADD_THE_SHADER_PROGRAM_OFFSET_IN_US_CODE_OFFSET"><doc>Add the shader program offset in US_CODE_OFFSET.OFFSET_ADDR when calculating the destination address of a jump</doc></value>
+ <value value="1" name="DON"><doc>Don't use the shader program offset when calculating the destination address jump</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_FC_BOOL_CONST" access="rw" offset="0x4620">
+ <doc>Static Boolean Constants for Flow Control Branching Instructions. Quad-buffered. Specifies the boolean value for constants 0-31.</doc>
+ </reg32>
+ <reg32 name="US_FC_CTRL" access="rw" offset="0x4624">
+ <doc>Flow Control Options. Quad-buffered.</doc>
+ <bitfield name="TEST_EN" high="30" low="30">
+ <doc>Specifies whether test mode is enabled. This flag currently has no effect in hardware.</doc>
+ <value value="0" name="NORMAL_MODE"><doc>Normal mode</doc></value>
+ <value value="1" name="TEST_MODE"><doc>Test mode (currently unused)</doc></value>
+ </bitfield>
+ <bitfield name="FULL_FC_EN" high="31" low="31">
+ <doc>Specifies whether full flow control functionality is enabled.</doc>
+ <value value="0" name="USE_PARTIAL_FLOW"><doc>Use partial flow-control (enables twice the contexts). Loops and subroutines are not available in partial flow-control mode, and the nesting depth of branch statements is limited.</doc></value>
+ <value value="1" name="USE_FULL_PIXEL_SHADER_3"><doc>Use full pixel shader 3.0 flow control, including loops and subroutines.</doc></value>
+ </bitfield>
+ </reg32>
+ <stripe offset="0x9800" stride="0x0004" length="512">
+ <reg32 name="US_FC_INST" access="rw" offset="0x0000">
+ <doc>Flow Control Instruction</doc>
+ <bitfield name="OP" high="2" low="0">
+ <doc>Specifies the type of flow control instruction.</doc>
+ <value value="0" name="US_FC_OP_JUMP"><doc>US_FC_OP_JUMP: (if, endif, call, etc)</doc></value>
+ <value value="1" name="US_FC_OP_LOOP"><doc>US_FC_OP_LOOP: same as jump except always take the jump if the static counter is 0. If we don't take the jump, push initial loop counter and loop register (aL) values onto the loop stack.</doc></value>
+ <value value="2" name="US_FC_OP_ENDLOOP"><doc>US_FC_OP_ENDLOOP: same as jump but decrement the loop counter and increment the loop register (aL), and don't take the jump if the loop counter becomes zero.</doc></value>
+ <value value="3" name="US_FC_OP_REP"><doc>US_FC_OP_REP: same as loop but don't push the loop register aL.</doc></value>
+ <value value="4" name="US_FC_OP_ENDREP"><doc>US_FC_OP_ENDREP: same as endloop but don't update/pop the loop register aL.</doc></value>
+ <value value="5" name="US_FC_OP_BREAKLOOP"><doc>US_FC_OP_BREAKLOOP: same as jump but pops the loop stacks if a pixel stops being active.</doc></value>
+ <value value="6" name="US_FC_OP_BREAKREP"><doc>US_FC_OP_BREAKREP: same as breakloop but don't pop the loop register if it jumps.</doc></value>
+ <value value="7" name="US_FC_OP_CONTINUE"><doc>US_FC_OP_CONTINUE: used to disable pixels that are ready to jump to the ENDLOOP/ENDREP instruction.</doc></value>
+ </bitfield>
+ <bitfield name="B_ELSE" high="4" low="4">
+ <doc>Specifies whether to perform an else operation on the active and branch-inactive pixels before executing the instruction.</doc>
+ <value value="0" name="DON"><doc>Don't alter the branch state before executing the instruction.</doc></value>
+ <value value="1" name="PERFORM_AN_ELSE_OPERATION_ON_THE_BRANCH_STATE_BEFORE_EXECUTING_THE_INSTRUCTION"><doc>Perform an else operation on the branch state before executing the instruction; pixels in the active state are moved to the branch inactive state with zero counter, and vice versa.</doc></value>
+ </bitfield>
+ <bitfield name="JUMP_ANY" high="5" low="5">
+ <doc>If set, jump if any active pixels want to take the jump (otherwise the instruction jumps only if all active pixels want to).</doc>
+ <value value="0" name="JUMP_IF_ALL_ACTIVE_PIXELS_WANT_TO_TAKE_THE_JUMP"><doc>Jump if ALL active pixels want to take the jump (for if and else). If no pixels are active, jump.</doc></value>
+ <value value="1" name="JUMP_IF_ANY_ACTIVE_PIXELS_WANT_TO_TAKE_THE_JUMP"><doc>Jump if ANY active pixels want to take the jump (for call, loop/rep and endrep/endloop). If no pixels are active, do not jump.</doc></value>
+ </bitfield>
+ <bitfield name="A_OP" high="7" low="6">
+ <doc>The address stack operation to perform if we take the jump.</doc>
+ <value value="0" name="US_FC_A_OP_NONE"><doc>US_FC_A_OP_NONE: Don't change the address stack</doc></value>
+ <value value="1" name="US_FC_A_OP_POP"><doc>US_FC_A_OP_POP: If we jump, pop the address stack and use that value for the jump target</doc></value>
+ <value value="2" name="US_FC_A_OP_PUSH"><doc>US_FC_A_OP_PUSH: If we jump, push the current address onto the address stack</doc></value>
+ </bitfield>
+ <bitfield name="JUMP_FUNC" high="15" low="8"><doc>A 2x2x2 table of boolean values indicating whether to take the jump. The table index is indexed by {ALU Compare Result, Predication Result, Boolean Value (from the static boolean address in US_FC_ADDR.BOOL)}. To determine whether to jump, look at bit ((alu_result&lt;&lt;2) | (predicate&lt;&lt;1) | bool).</doc></bitfield>
+ <bitfield name="B_POP_CNT" high="20" low="16"><doc>The amount to decrement the branch counter by if US_FC_B_OP_DECR operation is performed.</doc></bitfield>
+ <bitfield name="B_OP0" high="25" low="24">
+ <doc>The branch state operation to perform if we don't take the jump.</doc>
+ <value value="0" name="US_FC_B_OP_NONE"><doc>US_FC_B_OP_NONE: If we don't jump, don't alter the branch counter for any pixel.</doc></value>
+ <value value="1" name="US_FC_B_OP_DECR"><doc>US_FC_B_OP_DECR: If we don't jump, decrement branch counter by B_POP_CNT for inactive pixels. Activate pixels with negative counters.</doc></value>
+ <value value="2" name="US_FC_B_OP_INCR"><doc>US_FC_B_OP_INCR: If we don't jump, increment branch counter by 1 for inactive pixels. Deactivate pixels that decided to jump and set their counter to zero.</doc></value>
+ </bitfield>
+ <bitfield name="B_OP1" high="27" low="26">
+ <doc>The branch state operation to perform if we do take the jump.</doc>
+ <value value="0" name="US_FC_B_OP_NONE"><doc>US_FC_B_OP_NONE: If we do jump, don't alter the branch counter for any pixel.</doc></value>
+ <value value="1" name="US_FC_B_OP_DECR"><doc>US_FC_B_OP_DECR: If we do jump, decrement branch counter by B_POP_CNT for inactive pixels. Activate pixels with negative counters.</doc></value>
+ <value value="2" name="US_FC_B_OP_INCR"><doc>US_FC_B_OP_INCR: If we do jump, increment branch counter by 1 for inactive pixels. Deactivate pixels that decided not to jump and set their counter to zero.</doc></value>
+ </bitfield>
+ <bitfield name="IGNORE_UNCOVERED" high="28" low="28">
+ <doc>If set, uncovered pixels will not participate in flow control decisions.</doc>
+ <value value="0" name="INCLUDE_UNCOVERED_PIXELS_IN_JUMP_DECISIONS"><doc>Include uncovered pixels in jump decisions</doc></value>
+ <value value="1" name="IGNORE_UNCOVERED_PIXELS_IN_MAKING_JUMP_DECISIONS"><doc>Ignore uncovered pixels in making jump decisions</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4C00" stride="0x0004" length="32">
+ <reg32 name="US_FC_INT_CONST" access="rw" offset="0x0000">
+ <doc>Integer Constants used by Flow Control Loop Instructions. Single buffered.</doc>
+ <bitfield name="KR" high="7" low="0"><doc>Specifies the number of iterations. Unsigned 8-bit integer in [0, 255].</doc></bitfield>
+ <bitfield name="KG" high="15" low="8"><doc>Specifies the initial value of the loop register (aL). Unsigned 8-bit integer in [0, 255].</doc></bitfield>
+ <bitfield name="KB" high="23" low="16"><doc>Specifies the increment used to change the loop register (aL) on each iteration. Signed 7-bit integer in [-128, 127].</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x4640" stride="0x0004" length="16">
+ <reg32 name="US_FORMAT0" access="rw" offset="0x0000">
+ <bitfield name="TXDEPTH" high="25" low="22">
+ <value value="13" name="WIDTH"><doc>width &gt; 2048, height &lt;= 2048</doc></value>
+ <value value="14" name="WIDTH"><doc>width &lt;= 2048, height &gt; 2048</doc></value>
+ <value value="15" name="WIDTH"><doc>width &gt; 2048, height &gt; 2048</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x46A4" stride="0x0004" length="4">
+ <reg32 name="US_OUT_FMT" access="rw" offset="0x0000">
+ <bitfield name="OUT_FMT" high="4" low="0"><use-enum ref="COLOR_FORMAT" /></bitfield>
+ <bitfield name="C0_SEL" high="9" low="8"><use-enum ref="CHANNEL_ARGB" /></bitfield>
+ <bitfield name="C1_SEL" high="11" low="10"><use-enum ref="CHANNEL_ARGB" /></bitfield>
+ <bitfield name="C2_SEL" high="13" low="12"><use-enum ref="CHANNEL_ARGB" /></bitfield>
+ <bitfield name="C3_SEL" high="15" low="14"><use-enum ref="CHANNEL_ARGB" /></bitfield>
+ <bitfield name="ROUND_ADJ" high="20" low="20">
+ <value value="0" name="NORMAL_ROUNDING"><doc>Normal rounding</doc></value>
+ <value value="1" name="MODIFIED_ROUNDING_OF_FIXED"><doc>Modified rounding of fixed-point data</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_PIXSIZE" access="rw" offset="0x4604">
+ <doc>Shader pixel size. This register specifies the size and partitioning of the current pixel stack frame</doc>
+ <bitfield name="PIX_SIZE" high="6" low="0"><doc>Specifies the total size of the current pixel stack frame (1:128)</doc></bitfield>
+ </reg32>
+ <stripe offset="0x9800" stride="0x0004" length="512">
+ <reg32 name="US_TEX_ADDR" access="rw" offset="0x0000">
+ <doc>Texture addresses and swizzles</doc>
+ <bitfield name="SRC_ADDR" high="6" low="0"><doc>Specifies the location (within the shader pixel stack frame) of the texture address for this instruction</doc></bitfield>
+ <bitfield name="SRC_ADDR_REL" high="7" low="7">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SRC_S_SWIZ" high="9" low="8">
+ <doc>Specify which colour channel of src_addr to use for S coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="SRC_T_SWIZ" high="11" low="10">
+ <doc>Specify which colour channel of src_addr to use for T coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="SRC_R_SWIZ" high="13" low="12">
+ <doc>Specify which colour channel of src_addr to use for R coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="SRC_Q_SWIZ" high="15" low="14">
+ <doc>Specify which colour channel of src_addr to use for Q coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DST_ADDR" high="22" low="16"><doc>Specifies the location (within the shader pixel stack frame) of the returned texture data for this instruction</doc></bitfield>
+ <bitfield name="DST_ADDR_REL" high="23" low="23">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <value value="0" name="NONE"><doc>NONE: Do not modify destination address</doc></value>
+ <value value="1" name="RELATIVE"><doc>RELATIVE: Add aL before lookup.</doc></value>
+ </bitfield>
+ <bitfield name="DST_R_SWIZ" high="25" low="24">
+ <doc>Specify which colour channel of the returned texture data to write to the red channel of dst_addr</doc>
+ <value value="0" name="WRITE_R_CHANNEL_TO_R_CHANNEL_ARGB"><doc>Write R channel to R channel</doc></value>
+ <value value="1" name="WRITE_G_CHANNEL_TO_R_CHANNEL_ARGB"><doc>Write G channel to R channel</doc></value>
+ <value value="2" name="WRITE_B_CHANNEL_TO_R_CHANNEL_ARGB"><doc>Write B channel to R channel</doc></value>
+ <value value="3" name="WRITE_A_CHANNEL_TO_R_CHANNEL_ARGB"><doc>Write A channel to R channel</doc></value>
+ </bitfield>
+ <bitfield name="DST_G_SWIZ" high="27" low="26">
+ <doc>Specify which colour channel of the returned texture data to write to the green channel of dst_addr</doc>
+ <value value="0" name="WRITE_R_CHANNEL_TO_G_CHANNEL_ARGB"><doc>Write R channel to G channel</doc></value>
+ <value value="1" name="WRITE_G_CHANNEL_TO_G_CHANNEL_ARGB"><doc>Write G channel to G channel</doc></value>
+ <value value="2" name="WRITE_B_CHANNEL_TO_G_CHANNEL_ARGB"><doc>Write B channel to G channel</doc></value>
+ <value value="3" name="WRITE_A_CHANNEL_TO_G_CHANNEL_ARGB"><doc>Write A channel to G channel</doc></value>
+ </bitfield>
+ <bitfield name="DST_B_SWIZ" high="29" low="28">
+ <doc>Specify which colour channel of the returned texture data to write to the blue channel of dst_addr</doc>
+ <value value="0" name="WRITE_R_CHANNEL_TO_B_CHANNEL_ARGB"><doc>Write R channel to B channel</doc></value>
+ <value value="1" name="WRITE_G_CHANNEL_TO_B_CHANNEL_ARGB"><doc>Write G channel to B channel</doc></value>
+ <value value="2" name="WRITE_B_CHANNEL_TO_B_CHANNEL_ARGB"><doc>Write B channel to B channel</doc></value>
+ <value value="3" name="WRITE_A_CHANNEL_TO_B_CHANNEL_ARGB"><doc>Write A channel to B channel</doc></value>
+ </bitfield>
+ <bitfield name="DST_A_SWIZ" high="31" low="30">
+ <doc>Specify which colour channel of the returned texture data to write to the alpha channel of dst_addr</doc>
+ <value value="0" name="WRITE_R_CHANNEL_TO_A_CHANNEL_ARGB"><doc>Write R channel to A channel</doc></value>
+ <value value="1" name="WRITE_G_CHANNEL_TO_A_CHANNEL_ARGB"><doc>Write G channel to A channel</doc></value>
+ <value value="2" name="WRITE_B_CHANNEL_TO_A_CHANNEL_ARGB"><doc>Write B channel to A channel</doc></value>
+ <value value="3" name="WRITE_A_CHANNEL_TO_A_CHANNEL_ARGB"><doc>Write A channel to A channel</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0xA000" stride="0x0004" length="512">
+ <reg32 name="US_TEX_ADDR_DXDY" access="rw" offset="0x0000">
+ <doc>Additional texture addresses and swizzles for DX/DY inputs</doc>
+ <bitfield name="DX_ADDR" high="6" low="0"><doc>Specifies the location (within the shader pixel stack frame) of the DX value for this instruction</doc></bitfield>
+ <bitfield name="DX_ADDR_REL" high="7" low="7">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DX_S_SWIZ" high="9" low="8">
+ <doc>Specify which colour channel of dx_addr to use for S coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DX_T_SWIZ" high="11" low="10">
+ <doc>Specify which colour channel of dx_addr to use for T coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DX_R_SWIZ" high="13" low="12">
+ <doc>Specify which colour channel of dx_addr to use for R coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DX_Q_SWIZ" high="15" low="14">
+ <doc>Specify which colour channel of dx_addr to use for Q coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DY_ADDR" high="22" low="16"><doc>Specifies the location (within the shader pixel stack frame) of the DY value for this instruction</doc></bitfield>
+ <bitfield name="DY_ADDR_REL" high="23" low="23">
+ <doc>Specifies whether the loop register is added to the value of the associated address before it is used. This implements relative addressing.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DY_S_SWIZ" high="25" low="24">
+ <doc>Specify which colour channel of dy_addr to use for S coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DY_T_SWIZ" high="27" low="26">
+ <doc>Specify which colour channel of dy_addr to use for T coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DY_R_SWIZ" high="29" low="28">
+ <doc>Specify which colour channel of dy_addr to use for R coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ <bitfield name="DY_Q_SWIZ" high="31" low="30">
+ <doc>Specify which colour channel of dy_addr to use for Q coordinate</doc>
+ <use-enum ref="CHANNEL_RGBA" />
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x9000" stride="0x0004" length="512">
+ <reg32 name="US_TEX_INST" access="rw" offset="0x0000">
+ <doc>Texture Instruction</doc>
+ <bitfield name="TEX_ID" high="19" low="16"><doc>Specifies the id of the texture map used for this instruction</doc></bitfield>
+ <bitfield name="INST" high="24" low="22">
+ <doc>Specifies the operation taking place for this instruction</doc>
+ <value value="0" name="NOP"><doc>NOP: Do nothing</doc></value>
+ <value value="1" name="LD"><doc>LD: Do Texture Lookup (S,T,R)</doc></value>
+ <value value="2" name="TEXKILL"><doc>TEXKILL: Kill pixel if any component is &lt; 0</doc></value>
+ <value value="3" name="PROJ"><doc>PROJ: Do projected texture lookup (S/Q,T/Q,R/Q)</doc></value>
+ <value value="4" name="LODBIAS"><doc>LODBIAS: Do texture lookup with lod bias</doc></value>
+ <value value="5" name="LOD"><doc>LOD: Do texture lookup with explicit lod</doc></value>
+ <value value="6" name="DXDY"><doc>DXDY: Do texture lookup with lod calculated from DX and DY</doc></value>
+ </bitfield>
+ <bitfield name="TEX_SEM_ACQUIRE" high="25" low="25">
+ <doc>Whether to hold the texture semaphore until the data is written to the temporary register.</doc>
+ <value value="0" name="DON"><doc>Don't hold the texture semaphore</doc></value>
+ <value value="1" name="HOLD_THE_TEXTURE_SEMAPHORE_UNTIL_THE_DATA_IS_WRITTEN_TO_THE_TEMPORARY_REGISTER"><doc>Hold the texture semaphore until the data is written to the temporary register.</doc></value>
+ </bitfield>
+ <bitfield name="IGNORE_UNCOVERED" high="26" low="26">
+ <doc>If set, US will not request data for pixels which are uncovered. Clear this bit for indirect texture lookups.</doc>
+ <value value="0" name="FETCH_TEXELS_FOR_UNCOVERED_PIXELS"><doc>Fetch texels for uncovered pixels</doc></value>
+ <value value="1" name="DON"><doc>Don't fetch texels for uncovered pixels</doc></value>
+ </bitfield>
+ <bitfield name="UNSCALED" high="27" low="27">
+ <doc>Whether to scale texture coordinates when sending them to the texture unit.</doc>
+ <value value="0" name="SCALE_THE_S"><doc>Scale the S, T, R texture coordinates from [0.0,1.0] to the dimensions of the target texture</doc></value>
+ <value value="1" name="USE_THE_UNSCALED_S"><doc>Use the unscaled S, T, R texture coordates.</doc></value>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="US_W_FMT" access="rw" offset="0x46B4">
+ <doc>Specifies the source and format for the Depth (W) value output by the shader</doc>
+ <bitfield name="W_FMT" high="1" low="0">
+ <doc>Format for W</doc>
+ <value value="0" name="W0"><doc>W0 - W is always zero</doc></value>
+ <value value="1" name="W24"><doc>W24 - 24-bit fixed point</doc></value>
+ <value value="2" name="W24_FP"><doc>W24_FP - 24-bit floating point. The floating point values are a special format that preserve sorting order when values are compared as integers, allowing higher precision in W without additional logic in other blocks.</doc></value>
+ </bitfield>
+ <bitfield name="W_SRC" high="2" low="2">
+ <doc>Source for W</doc>
+ <use-enum ref="WSRC" />
+ </bitfield>
+ </reg32>
+ <reg32 name="VAP_ALT_NUM_VERTICES" access="rw" offset="0x2088">
+ <doc>Alternate Number of Vertices to allow &gt; 16-bits of Vertex count</doc>
+ <bitfield name="NUM_VERTICES" high="23" low="0"><doc>24-bit vertex count for command packet. Used instead of bits 31:16 of VAP_VF_CNTL if VAP_VF_CNTL.USE_ALT_NUM_VERTS is set.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_CLIP_CNTL" access="rw" offset="0x221C">
+ <doc>Control Bits for User Clip Planes and Clipping</doc>
+ <bitfield name="UCP_ENA_0" high="0" low="0"><doc>Enable User Clip Plane 0</doc></bitfield>
+ <bitfield name="UCP_ENA_1" high="1" low="1"><doc>Enable User Clip Plane 1</doc></bitfield>
+ <bitfield name="UCP_ENA_2" high="2" low="2"><doc>Enable User Clip Plane 2</doc></bitfield>
+ <bitfield name="UCP_ENA_3" high="3" low="3"><doc>Enable User Clip Plane 3</doc></bitfield>
+ <bitfield name="UCP_ENA_4" high="4" low="4"><doc>Enable User Clip Plane 4</doc></bitfield>
+ <bitfield name="UCP_ENA_5" high="5" low="5"><doc>Enable User Clip Plane 5</doc></bitfield>
+ <bitfield name="PS_UCP_MODE" high="15" low="14"><doc>0 = Cull using distance from center of point 1 = Cull using radius-based distance from center of point 2 = Cull using radius-based distance from center of point, Expand and Clip on intersection 3 = Always expand and clip as trifan</doc></bitfield>
+ <bitfield name="CLIP_DISABLE" high="16" low="16"><doc>Disables clip code generation and clipping process for TCL</doc></bitfield>
+ <bitfield name="UCP_CULL_ONLY_ENA" high="17" low="17"><doc>Cull Primitives against UCPS, but don't clip</doc></bitfield>
+ <bitfield name="BOUNDARY_EDGE_FLAG_ENA" high="18" low="18"><doc>If set, boundary edges are highlighted, else they are not highlighted</doc></bitfield>
+ <bitfield name="COLOR2_IS_TEXTURE" high="20" low="20"><doc>If set, color2 is used as texture8 by GA (PS3.0 requirement)</doc></bitfield>
+ <bitfield name="COLOR3_IS_TEXTURE" high="21" low="21"><doc>If set, color3 is used as texture9 by GA (PS3.0 requirement)</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_CNTL" access="rw" offset="0x2080">
+ <doc>Vertex Assembler/Processor Control Register</doc>
+ <bitfield name="PVS_NUM_SLOTS" high="3" low="0"><doc>Specifies the number of vertex slots to be used in the VAP PVS process. A slot represents a single vertex storage location1 across multiple engines (one vertex per engine). By decreasing the number of slots, there is more memory for each vertex, but less parallel processing. Similarly, by increasing the number of slots, there is less memory per vertex but more vertices being processed in parallel.</doc></bitfield>
+ <bitfield name="PVS_NUM_CNTLRS" high="7" low="4"><doc>Specifies the maximum number of controllers to be processing in parallel. In general should be set to max value of TBD. Can be changed for performance analysis.</doc></bitfield>
+ <bitfield name="PVS_NUM_FPUS" high="11" low="8"><doc>Specifies the number of Floating Point Units (Vector/Math Engines) to use when processing vertices.</doc></bitfield>
+ <bitfield name="VAP_NO_RENDER" high="17" low="17"><doc>If set, VAP will not process any draw commands (i.e. writes to VAP_VF_CNTL, the INDX and DATAPORT and Immediate mode writes are ignored.</doc></bitfield>
+ <bitfield name="VF_MAX_VTX_NUM" high="21" low="18"><doc>This field controls the number of vertices that the vertex fetcher manages for the TCL and Setup Vertex Storage memories (and therefore the number of vertices that can be re-used). This value should be set to 12 for most operation, This number may be modified for performance evaluation. The value is the maximum vertex number used which is one less than the number of vertices (i.e. a 12 means 13 vertices will be used)</doc></bitfield>
+ <bitfield name="DX_CLIP_SPACE_DEF" high="22" low="22">
+ <doc>Clip space is defined as:</doc>
+ <use-enum ref="CLIP_SPACE" />
+ </bitfield>
+ <bitfield name="TCL_STATE_OPTIMIZATION" high="23" low="23"><doc>If set, enables the TCL state optimization, and the new state is used only if there is a change in TCL state, between VF_CNTL (triggers)</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_CNTL_STATUS" access="rw" offset="0x2140">
+ <doc>Vertex Assemblen/Processor Control Status</doc>
+ <bitfield name="VC_SWAP" high="1" low="0"><doc>Endian-Swap Control. 0 = No swap 1 = 16-bit swap: 0xAABBCCDD becomes 0xBBAADDCC 2 = 32-bit swap: 0xAABBCCDD becomes 0xDDCCBBAA 3 = Half-dword swap: 0xAABBCCDD becomes 0xCCDDAABB Default = 0</doc></bitfield>
+ <bitfield name="PVS_BYPASS" high="8" low="8"><doc>The TCL engine is logically or physically removed from the circuit.</doc></bitfield>
+ <bitfield name="PVS_BUSY" high="11" low="11"><doc>Transform/Clip/Light (TCL) Engine is Busy. Read-only.</doc></bitfield>
+ <bitfield name="MAX_MPS" high="19" low="16"><doc>Maximum number of MPs fused for this chip. Read- only. For A11, fusemask is fixed to 1XXX. For A12, CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 000 =&gt; max_mps[3:0] = 1XXX =&gt; 8 MPs CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 001 =&gt; max_mps[3:0] = 0110 =&gt; 6 MPs CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 010 =&gt; max_mps[3:0] = 0101 =&gt; 5 MPs CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 011 =&gt; max_mps[3:0] = 0100 =&gt; 4 MPs CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 100 =&gt; max_mps[3:0] = 0011 =&gt; 3 MPs CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 101 =&gt; max_mps[3:0] = 0010 =&gt; 2 MPs CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 110 =&gt; max_mps[3:0] = 0001 =&gt; 1 MP CG.CC_COMBINEDSTRAPS.MAX_MPS[7:5] = 111 =&gt; max_mps[3:0] = 0000 =&gt; 0 MP Note that max_mps[3:0] = 0111 = 7 MPs is not available</doc></bitfield>
+ <bitfield name="VS_BUSY" high="24" low="24"><doc>Vertex Store is Busy. Read-only.</doc></bitfield>
+ <bitfield name="RCP_BUSY" high="25" low="25"><doc>Reciprocal Engine is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VTE_BUSY" high="26" low="26"><doc>ViewPort Transform Engine is Busy. Read-only.</doc></bitfield>
+ <bitfield name="MIU_BUSY" high="27" low="27"><doc>Memory Interface Unit is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VC_BUSY" high="28" low="28"><doc>Vertex Cache is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VF_BUSY" high="29" low="29"><doc>Vertex Fetcher is Busy. Read-only.</doc></bitfield>
+ <bitfield name="REGPIPE_BUSY" high="30" low="30"><doc>Register Pipeline is Busy. Read-only.</doc></bitfield>
+ <bitfield name="VAP_BUSY" high="31" low="31"><doc>VAP Engine is Busy. Read-only.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_INDEX_OFFSET" access="rw" offset="0x208C">
+ <doc>Offset Value added to index value in both Indexed and Auto-indexed modes. Disabled by setting to 0</doc>
+ <bitfield name="INDEX_OFFSET" high="24" low="0"><doc>25-bit signed 2's comp offset value</doc></bitfield>
+ </reg32>
+ <stripe offset="0x2150" stride="0x0004" length="8">
+ <reg32 name="VAP_PROG_STREAM_CNTL" access="rw" offset="0x0000">
+ <doc>Programmable Stream Control Word 0</doc>
+ <bitfield name="DATA_TYPE_0" high="3" low="0"><doc>The data type for element 0 0 = FLOAT_1 (Single IEEE Float) 1 = FLOAT_2 (2 IEEE floats) 2 = FLOAT_3 (3 IEEE Floats) 3 = FLOAT_4 (4 IEEE Floats) 4 = BYTE * (1 DWORD w 4 8-bit fixed point values) (X = [7:0], Y = [15:8], Z = [23:16], W = [31:24]) 5 = D3DCOLOR * (Same as BYTE except has X-&gt;Z,Z- &gt;X swap for D3D color def) (Z = [7:0], Y = [15:8], X = [23:16], W = [31:24]) 6 = SHORT_2 * (1 DWORD with 2 16-bit fixed point values) (X = [15:0], Y = [31:16], Z = 0.0, W = 1.0) 7 = SHORT_4 * (2 DWORDS with 4(2 per dword) 16- bit fixed point values) (X = DW0 [15:0], Y = DW0 [31:16], Z = DW1 [15:0], W = DW1 [31:16]) 8 = VECTOR_3_TTT * (1 DWORD with 3 10-bit fixed point values) (X = [9:0], Y = [19:10], Z = [29:20], W = 1.0) 9 = VECTOR_3_EET * (1 DWORD with 2 11-bit and 1 10-bit fixed point values) (X = [10:0], Y = [21:11], Z = [31:22], W = 1.0) 10 = FLOAT_8 (8 IEEE Floats) Sames as 2 FLOAT_4 but must use consecutive DST_VEC_LOC. Used to allow &gt; 16 PSC for OGL path. 11 = FLT16_2 (1 DWORD with 2 16-bit floating point values (SE5M10 exp bias of 15, supports denormalized numbers)) (X = [15:0], Y = [31:16], Z = 0.0, W = 1.0) 12 = FLT16_4 (2 DWORDS with 4(2 per dword) 16-bit floating point values (SE5M10 exp bias of 15, supports denormalized numbers))) (X = DW0 [15:0], Y = DW0 [31:16], Z = DW1 [15:0], W = DW1 [31:16]) * These data types use the SIGNED and NORMALIZE flags described below.</doc></bitfield>
+ <bitfield name="SKIP_DWORDS_0" high="7" low="4"><doc>The number of DWORDS to skip (discard) after processing the current element.</doc></bitfield>
+ <bitfield name="DST_VEC_LOC_0" high="12" low="8"><doc>The vector address in the input memory to write this element</doc></bitfield>
+ <bitfield name="LAST_VEC_0" high="13" low="13">
+ <doc>If set, indicates the last vector of the current vertex stream</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="SIGNED_0" high="14" low="14">
+ <doc>Determines whether fixed point data types are unsigned (0) or 2's complement signed (1) data types. See NORMALIZE for complete description of affect</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="NORMALIZE_0" high="15" low="15">
+ <doc>Determines whether the fixed to floating point conversion will normalize the value (i.e. fixed point value is all fractional bits) or not (i.e. fixed point value is all integer bits). This table describes the fixed to float conversion results SIGNED NORMALIZE FLT RANGE 0 0 0.0 - (2^n - 1) (i.e. 8-bit -&gt; 0.0 - 255.0) 0 1 0.0 - 1.0 1 0 -2^(n-1) - (2^(n-1) - 1) (i.e. 8-bit -&gt; -128.0 - 127.0) 1 1 -1.0 - 1.0 where n is the number of bits in the associated fixed point value For signed, normalize conversion, since the fixed point range is not evenly distributed around 0, there are 3 different methods supported by R300. See the VAP_PSC_SGN_NORM_CNTL description for details.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="DATA_TYPE_1" high="19" low="16"><doc>Similar to DATA_TYPE_0</doc></bitfield>
+ <bitfield name="SKIP_DWORDS_1" high="23" low="20"><doc>See SKIP_DWORDS_0</doc></bitfield>
+ <bitfield name="DST_VEC_LOC_1" high="28" low="24"><doc>See DST_VEC_LOC_0</doc></bitfield>
+ <bitfield name="LAST_VEC_1" high="29" low="29">
+ <use-enum ref="ENABLE" />
+ <doc>See LAST_VEC_0</doc>
+ </bitfield>
+ <bitfield name="SIGNED_1" high="30" low="30">
+ <use-enum ref="ENABLE" />
+ <doc>See SIGNED_0</doc>
+ </bitfield>
+ <bitfield name="NORMALIZE_1" high="31" low="31">
+ <use-enum ref="ENABLE" />
+ <doc>See NORMALIZE_0</doc>
+ </bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x2500" stride="0x0008" length="16">
+ <reg32 name="VAP_PVS_FLOW_CNTL_ADDRS_LW" access="rw" offset="0x0000">
+ <doc>For VS3.0 - To support more PVS instructions, increase the address range - Programmable Vertex Shader Flow Control Lower Word Addresses Register 0</doc>
+ <bitfield name="PVS_FC_ACT_ADRS_0" high="15" low="0"><doc>This field defines the last PVS instruction to execute prior to the control flow redirection. JUMP - The last instruction executed prior to the jump LOOP - The last instruction executed prior to the loop (init loop counter/inc) JSR - The last instruction executed prior to the jump to the subroutine. (Addrss_Range:1K=[9:0];512=[8:0];256=[7:0])</doc></bitfield>
+ <bitfield name="PVS_FC_LOOP_CNT_JMP_INST_0" high="31" low="16"><doc>This field has multiple definitions as follows: JUMP - The instruction address to jump to. LOOP - The loop count. *Note loop count of 0 must be replaced by a jump. JSR - The instruction address to jump to (first inst of subroutine). (Addrss_Range:1K=[24:15];512=[23:15];256=[22:15])</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x2504" stride="0x0008" length="16">
+ <reg32 name="VAP_PVS_FLOW_CNTL_ADDRS_UW" access="rw" offset="0x0000">
+ <doc>For VS3.0 - To support more PVS instructions, increase the address range - Programmable Vertex Shader Flow Control Upper Word Addresses Register 0</doc>
+ <bitfield name="PVS_FC_LAST_INST_0" high="15" low="0"><doc>This field has multiple definitions as follows: JUMP - Not Applicable LOOP - The last instruction of the loop. JSR - The last instruction of the subroutine. (Addrss_Range:1K=[9:0];512=[8:0];256=[7:0])</doc></bitfield>
+ <bitfield name="PVS_FC_RTN_INST_0" high="31" low="16"><doc>This field has multiple definitions as follows: JUMP - Not Applicable LOOP - First Instruction of Loop (Typically ACT_ADRS + 1) JSR - First Instruction After JSR (Typically ACT_ADRS + 1). (Addrss_Range:1K=[24:15];512=[23:15];256=[22:15])</doc></bitfield>
+ </reg32>
+ </stripe>
+ <stripe offset="0x2290" stride="0x0004" length="16">
+ <reg32 name="VAP_PVS_FLOW_CNTL_LOOP_INDEX" access="rw" offset="0x0000">
+ <doc>Programmable Vertex Shader Flow Control Loop Index Register 0</doc>
+ <bitfield name="PVS_FC_LOOP_INIT_VAL_0" high="7" low="0"><doc>This field stores the automatic loop index register init value. This is an 8-bit unsigned value 0-255. This field is only used if the corresponding control flow instruction is a loop.</doc></bitfield>
+ <bitfield name="PVS_FC_LOOP_STEP_VAL_0" high="15" low="8"><doc>This field stores the automatic loop index register step value. This is an 8-bit 2's comp signed value -128-127. This field is only used if the corresponding control flow instruction is a loop.</doc></bitfield>
+ <bitfield name="PVS_FC_LOOP_REPEAT_NO_FLI_0" high="31" low="31"><doc>When this field is set, the automatic loop index register init value is not used at loop activation. The intial loop index is inherited from outer loop. The loop index register step value is used at the end of each loop iteration ; after loop completion, the outer loop index register is restored</doc></bitfield>
+ </reg32>
+ </stripe>
+ <reg32 name="VAP_TEX_TO_COLOR_CNTL" access="rw" offset="0x2218">
+ <doc>For VS3.0 color2texture - flat shading on textures - limitation: only first 8 vectors can have clipping with wrap shortest or point sprite generated textures</doc>
+ </reg32>
+ <reg32 name="VAP_VF_CNTL" access="rw" offset="0x2084">
+ <doc>Vertex Fetcher Control</doc>
+ <bitfield name="PRIM_TYPE" high="3" low="0">
+ <doc>Primitive Type</doc>
+ <use-enum ref="PRIM_TYPE" />
+ </bitfield>
+ <bitfield name="PRIM_WALK" high="5" low="4">
+ <doc>Method of Passing Vertex Data.</doc>
+ <use-enum ref="VERTEX_DATA_PASS_MODE" />
+ </bitfield>
+ <bitfield name="RSVD_PREV_USED" high="10" low="6"><doc>Reserved bits</doc></bitfield>
+ <bitfield name="INDEX_SIZE" high="11" low="11"><doc>When set, vertex indices are 32-bits/indx, otherwise, 16- bits/indx.</doc></bitfield>
+ <bitfield name="VTX_REUSE_DIS" high="12" low="12"><doc>When set, vertex reuse is disabled. DO NOT SET unless PRIM_WALK is Indexes.</doc></bitfield>
+ <bitfield name="DUAL_INDEX_MODE" high="13" low="13"><doc>When set, the incoming index is treated as two separate indices. Bits 23-16 are used as the index for AOS 0 (These are 0 for 16-bit indices) Bits 15-0 are used as the index for AOS 1-15. This mode was added specifically for HOS usage</doc></bitfield>
+ <bitfield name="USE_ALT_NUM_VERTS" high="14" low="14"><doc>When set, the number of vertices in the command packet is taken from VAP_ALT_NUM_VERTICES register instead of bits 31:16 of VAP_VF_CNTL</doc></bitfield>
+ <bitfield name="NUM_VERTICES" high="31" low="16"><doc>Number of vertices in the command packet.</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VTX_NUM_ARRAYS" access="rw" offset="0x20C0">
+ <doc>Vertex Array of Structures Control</doc>
+ <bitfield name="VTX_NUM_ARRAYS" high="4" low="0"><doc>The number of arrays required to represent the current vertex type. Each Array is described by the following three fields: VTX_AOS_ADDR, VTX_AOS_COUNT, VTX_AOS_STRIDE.</doc></bitfield>
+ <bitfield name="VC_FORCE_PREFETCH" high="5" low="5"><doc>Force Vertex Data Pre-fetching. If this bit is set, then a 256-bit word will always be fetched, regardless of which dwords are needed. Typically useful when VAP_VF_CNTL.PRIM_WALK is set to Vertex List (Auto-incremented indices).</doc></bitfield>
+ <bitfield name="VC_DIS_CACHE_INVLD" high="6" low="6"><doc>If set, the vertex cache is not invalidated between draw packets. This allows vertex cache hits to occur from packet to packet. This must be set with caution with respect to multiple contexts in the driver.</doc></bitfield>
+ <bitfield name="AOS_0_FETCH_SIZE" high="16" low="16"><doc>Granule Size to Fetch for AOS 0. 0 = 128-bit granule size 1 = 256-bit granule size This allows the driver to program the fetch size based on DWORDS/VTX/AOS combined with AGP vs. LOC Memory. The general belief is that the granule size should always be 256-bits for LOC memory and AGP8X data, but should be 128-bit for AGP2X/4X data if the DWORDS/VTX/AOS is less than TBD (128?) bits.</doc></bitfield>
+ <bitfield name="AOS_1_FETCH_SIZE" high="17" low="17"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_2_FETCH_SIZE" high="18" low="18"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_3_FETCH_SIZE" high="19" low="19"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_4_FETCH_SIZE" high="20" low="20"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_5_FETCH_SIZE" high="21" low="21"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_6_FETCH_SIZE" high="22" low="22"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_7_FETCH_SIZE" high="23" low="23"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_8_FETCH_SIZE" high="24" low="24"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_9_FETCH_SIZE" high="25" low="25"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_10_FETCH_SIZE" high="26" low="26"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_11_FETCH_SIZE" high="27" low="27"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_12_FETCH_SIZE" high="28" low="28"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_13_FETCH_SIZE" high="29" low="29"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_14_FETCH_SIZE" high="30" low="30"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ <bitfield name="AOS_15_FETCH_SIZE" high="31" low="31"><doc>See AOS_0_FETCH_SIZE</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VTX_STATE_CNTL" access="rw" offset="0x2180">
+ <doc>VAP Vertex State Control Register</doc>
+ <bitfield name="COLOR_0_ASSEMBLY_CNTL" high="1" low="0"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_1_ASSEMBLY_CNTL" high="3" low="2"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_2_ASSEMBLY_CNTL" high="5" low="4"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_3_ASSEMBLY_CNTL" high="7" low="6"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_4_ASSEMBLY_CNTL" high="9" low="8"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_5_ASSEMBLY_CNTL" high="11" low="10"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_6_ASSEMBLY_CNTL" high="13" low="12"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="COLOR_7_ASSEMBLY_CNTL" high="15" low="14"><use-enum ref="COLOR_SELECT" /></bitfield>
+ <bitfield name="UPDATE_USER_COLOR_0_ENA" high="16" low="16"><use-enum ref="ENUM127" /></bitfield>
+ <bitfield name="Reserved" high="18" low="18"><doc>Set to 0</doc></bitfield>
+ </reg32>
+ <reg32 name="VAP_VTX_ST_EDGE_FLAGS" access="rw" offset="0x245C">
+ <doc>Data register</doc>
+ <bitfield name="DATA_REGISTER" high="0" low="0"><doc>EDGE_FLAGS</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_BW_CNTL" access="rw" offset="0x4F1C">
+ <doc>Z Buffer Band-Width Control Defa</doc>
+ <bitfield name="HIZ_ENABLE" high="0" low="0">
+ <doc>Enables hierarchical Z.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="HIZ_MIN" high="1" low="1"><use-enum ref="HZ_UPDATE_VAL" /></bitfield>
+ <bitfield name="FAST_FILL" high="2" low="2"><use-enum ref="ENABLE" /></bitfield>
+ <bitfield name="RD_COMP_ENABLE" high="3" low="3">
+ <doc>Enables reading of compressed Z data from memory to the cache.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="WR_COMP_ENABLE" high="4" low="4">
+ <doc>Enables writing of compressed Z data from cache to memory,</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZB_CB_CLEAR" high="5" low="5">
+ <doc>This bit is set when the Z buffer is used to help the CB in clearing a region. Part of the region is cleared by the color buffer and part will be cleared by the Z buffer. Since the Z buffer does not have any write masks in the cache, full micro- tiles need to be written. If a partial micro-tile is touched, then the un-touched part will be unknowns. The cache will operate in write-allocate mode and quads will be accumulated in the cache and then evicted to main memory. The color value is supplied through the ZB_DEPTHCLEARVALUE register.</doc>
+ <use-enum ref="ENUM130" />
+ </bitfield>
+ <bitfield name="FORCE_COMPRESSED_STENCIL_V" high="6" low="6"><doc>Enabling this bit will force all the compressed stencil values</doc></bitfield>
+ <bitfield name="ZEQUAL_OPTIMIZE_DISABLE" high="7" low="7">
+ <doc>By default this is 0 (enabled). When NEWZ=OLDZ, then writes do not occur to save BW.</doc>
+ <value value="0" name="ENABLE_NOT_UPDATING_THE_Z_BUFFER_IF_NEWZ"><doc>Enable not updating the Z buffer if NewZ=OldZ</doc></value>
+ <value value="1" name="DISABLE_ABOVE_FEATURE"><doc>Disable above feature (in case there is a bug)</doc></value>
+ </bitfield>
+ <bitfield name="SEQUAL_OPTIMIZE_DISABLE" high="8" low="8">
+ <doc>By default this is 0 (enabled). When NEW_STENCIL=OLD_STENCIL, then writes do not occur to save BW.</doc>
+ <value value="0" name="ENABLE_NOT_UPDATING_THE_STENCIL_BUFFER_IF_NEWS"><doc>Enable not updating the Stencil buffer if NewS=OldS</doc></value>
+ <value value="1" name="DISABLE_ABOVE_FEATURE"><doc>Disable above feature (in case there is a bug)</doc></value>
+ </bitfield>
+ <bitfield name="BMASK_DISABLE" high="10" low="10">
+ <doc>Controls whether bytemasking is used or not.</doc>
+ <value value="0" name="ENABLE_BYTEMASKING"><doc>Enable bytemasking</doc></value>
+ <value value="1" name="DISABLE_BYTEMASKING"><doc>Disable bytemasking</doc></value>
+ </bitfield>
+ <bitfield name="HIZ_EQUAL_REJECT_ENABLE" high="11" low="11">
+ <doc>Enables hiz rejects when the z function is equals.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="HIZ_FP_INVERT" high="15" low="15">
+ <doc>Determines whether leading zeros or ones are eliminated.</doc>
+ <value value="0" name="COUNT_LEADING_1S"><doc>Count leading 1s</doc></value>
+ <value value="1" name="COUNT_LEADING_0S"><doc>Count leading 0s</doc></value>
+ </bitfield>
+ <bitfield name="TILE_OVERWRITE_RECOMPRESSI" high="16" low="16"><doc>The zb tries to detect single plane equations that completely</doc></bitfield>
+ <bitfield name="CONTIGUOUS_6XAA_SAMPLES_DI" high="17" low="17"><doc>This disables storing samples contiguously in 6xaa.</doc></bitfield>
+ <bitfield name="PEQ_PACKING_ENABLE" high="18" low="18">
+ <doc>Enables packing of the plane equations to eliminate wasted peq slots.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="COVERED_PTR_MASKING_ENABL" high="19" low="19"><doc>Enables discarding of pointers from pixels that are going to be</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_CNTL" access="rw" offset="0x4F00">
+ <doc>Z Buffer Control</doc>
+ <bitfield name="STENCIL_ENABLE" high="0" low="0">
+ <doc>Enables stenciling.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="Z_ENABLE" high="1" low="1">
+ <doc>Enables Z functions.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZWRITEENABLE" high="2" low="2">
+ <doc>Enables writing of the Z buffer.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZSIGNED_COMPARE" high="3" low="3">
+ <doc>Enable signed Z buffer comparison , for W-buffering.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="STENCIL_FRONT_BACK" high="4" low="4">
+ <doc>When STENCIL_ENABLE is set, setting STENCIL_FRONT_BACK bit to one specifies that stencilfunc/stencilfail/stencilzpass/stencilzfail registers are used if the quad is generated from front faced primitive and stencilfunc_bf/stencilfail_bf/stencilzpass_bf/stencilzfail_bf are used if the quad is generated from a back faced primitive. If the STENCIL_FRONT_BACK is not set, then stencilfunc/stencilfail/stencilzpass/stencilzfail registers determine the operation independent of the front/back face state of the quad.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ <bitfield name="ZSIGNED_MAGNITUDE" high="5" low="5">
+ <doc>Specifies the signed number type to use for the Z buffer comparison. This only has an effect when ZSIGNED_COMPARE is enabled.</doc>
+ <value value="0" name="TWOS_COMPLEMENT"><doc>Twos complement</doc></value>
+ <value value="1" name="SIGNED_MAGNITUDE"><doc>Signed magnitude</doc></value>
+ </bitfield>
+ <bitfield name="STENCIL_REFMASK_FRONT_BACK" high="6" low="6"><use-enum ref="ENABLE" /></bitfield>
+ </reg32>
+ <reg32 name="ZB_FIFO_SIZE" access="rw" offset="0x4FD0">
+ <doc>Sets the fifo sizes</doc>
+ <bitfield name="OP_FIFO_SIZE" high="1" low="0">
+ <doc>Determines the size of the op fifo</doc>
+ <use-enum ref="FIFO_SIZE" />
+ </bitfield>
+ </reg32>
+ <reg32 name="ZB_FORMAT" access="rw" offset="0x4F10">
+ <doc>Format of the Data in the Z buffer</doc>
+ <bitfield name="DEPTHFORMAT" high="3" low="0">
+ <doc>Specifies the format of the Z buffer.</doc>
+ <use-enum ref="DSFORMAT" />
+ </bitfield>
+ <bitfield name="INVERT" high="4" low="4">
+ <value value="0" name="IN_13E3_FORMAT"><doc>in 13E3 format , count leading 1's</doc></value>
+ <value value="1" name="IN_13E3_FORMAT"><doc>in 13E3 format , count leading 0's.</doc></value>
+ </bitfield>
+ <bitfield name="PEQ8" high="5" low="5"><doc>This bit is unused</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_DWORD" access="rw" offset="0x4F4C">
+ <doc>Hierarchical Z Data. This DWORD contains 8-bit values for 4 blocks.. Reading this register causes a read from the address pointed to by RDINDEX. Writing to this register causes a write to the address pointed to by WRINDEX.</doc>
+ </reg32>
+ <reg32 name="ZB_HIZ_OFFSET" access="rw" offset="0x4F44">
+ <doc>Hierarchical Z Memory Offset</doc>
+ <bitfield name="HIZ_OFFSET" high="17" low="2"><doc>DWORD offset into HiZ RAM.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_RDINDEX" access="rw" offset="0x4F50">
+ <doc>Hierarchical Z Read Index</doc>
+ <bitfield name="HIZ_RDINDEX" high="17" low="2"><doc>Read index into HiZ RAM.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_HIZ_WRINDEX" access="rw" offset="0x4F48">
+ <doc>Hierarchical Z Write Index</doc>
+ <bitfield name="HIZ_WRINDEX" high="17" low="2"><doc>Self-incrementing write index into the HiZ RAM. Starting write index must start on a DWORD boundary. Each time ZB_HIZ_DWORD is written, this index will autoincrement. HIZ_OFFSET and HIZ_PITCH are not used to compute read/write address to HIZ ram, when it is accessed through WRINDEX and DWORD</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_STENCILREFMASK_BF" access="rw" offset="0x4FD4">
+ <doc>Stencil Reference Value and Mask for backfacing quads</doc>
+ <bitfield name="STENCILREF" high="7" low="0"><doc>Specifies the reference stencil value.</doc></bitfield>
+ <bitfield name="STENCILMASK" high="15" low="8"><doc>This value is ANDed with both the reference and the current stencil value prior to the stencil test.</doc></bitfield>
+ <bitfield name="STENCILWRITEMASK" high="23" low="16"><doc>Specifies the write mask for the stencil planes.</doc></bitfield>
+ </reg32>
+ <reg32 name="ZB_ZPASS_DATA" access="rw" offset="0x4F58">
+ <doc>Z Buffer Z Pass Counter Data. Contains the number of Z passed pixels since the last write to this location. Writing this location resets the count to the value written.</doc>
+ </reg32>
+ <reg32 name="ZB_ZSTENCILCNTL" access="rw" offset="0x4F04">
+ <doc>Z and Stencil Function Control</doc>
+ <bitfield name="ZFUNC" high="2" low="0">
+ <doc>Specifies the Z function.</doc>
+ <use-enum ref="DSCOMPARE_FUNC" />
+ </bitfield>
+ <bitfield name="STENCILFUNC" high="5" low="3">
+ <doc>Specifies the stencil function.</doc>
+ <use-enum ref="DSCOMPARE_FUNC" />
+ </bitfield>
+ <bitfield name="STENCILFAIL" high="8" low="6">
+ <doc>Specifies the stencil value to be written if the stencil test fails.</doc>
+ <use-enum ref="STENCILFAIL_VAL" />
+ </bitfield>
+ <bitfield name="STENCILZPASS" high="11" low="9"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test passes (or is not enabled).</doc></bitfield>
+ <bitfield name="STENCILZFAIL" high="14" low="12"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test fails.</doc></bitfield>
+ <bitfield name="STENCILFUNC_BF" high="17" low="15"><doc>Same encoding as STENCILFUNC. Specifies the stencil function for back faced quads , if STENCIL_FRONT_BACK = 1.</doc></bitfield>
+ <bitfield name="STENCILFAIL_BF" high="20" low="18"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test fails for back faced quads, if STENCIL_FRONT_BACK = 1</doc></bitfield>
+ <bitfield name="STENCILZPASS_BF" high="23" low="21"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test passes (or is not enabled) for back faced quads, if STENCIL_FRONT_BACK = 1</doc></bitfield>
+ <bitfield name="STENCILZFAIL_BF" high="26" low="24"><doc>Same encoding as STENCILFAIL. Specifies the stencil value to be written if the stencil test passes and the Z test fails for back faced quads, if STENCIL_FRONT_BACK =1</doc></bitfield>
+ <bitfield name="ZERO_OUTPUT_MASK" high="27" low="27">
+ <doc>Zeroes the zb coverage mask output. This does not affect the updating of the depth or stencil values.</doc>
+ <use-enum ref="ENABLE" />
+ </bitfield>
+ </reg32>
+</group>
+
+<variant id="r300">
+ <use-group ref="rX00_regs" />
+ <use-group ref="r300_regs" />
+</variant>
+<variant id="r500">
+ <use-group ref="rX00_regs" />
+ <use-group ref="r500_regs" />
+</variant>
+</database>
diff --git a/data/rsim.desktop b/data/rsim.desktop
new file mode 100644
index 0000000..f7cfe84
--- /dev/null
+++ b/data/rsim.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Radeon Simulator
+Comment=View and simulate a command stream
+Exec=rsim
+Icon=rsim
+Terminal=false
+Type=Application
+Categories=GTK;Application;Utility;
+StartupNotify=true
diff --git a/data/rsim.png b/data/rsim.png
new file mode 100644
index 0000000..46dcbd5
--- /dev/null
+++ b/data/rsim.png
Binary files differ
diff --git a/src/cs.c b/src/cs.c
new file mode 100644
index 0000000..613753c
--- /dev/null
+++ b/src/cs.c
@@ -0,0 +1,1036 @@
+
+#include <glib.h>
+#include <glib-object.h>
+#include <string.h>
+
+
+#define EMULATION_TYPE_CHIP (emulation_chip_get_type ())
+
+#define EMULATION_TYPE_PACKET_BASE (emulation_packet_base_get_type ())
+#define EMULATION_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBase))
+#define EMULATION_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+#define EMULATION_IS_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_IS_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_PACKET_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+
+typedef struct _EmulationPacketBase EmulationPacketBase;
+typedef struct _EmulationPacketBaseClass EmulationPacketBaseClass;
+
+#define EMULATION_TYPE_PACKET0 (emulation_packet0_get_type ())
+#define EMULATION_PACKET0(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET0, EmulationPacket0))
+#define EMULATION_PACKET0_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET0, EmulationPacket0Class))
+#define EMULATION_IS_PACKET0(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET0))
+#define EMULATION_IS_PACKET0_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET0))
+#define EMULATION_PACKET0_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET0, EmulationPacket0Class))
+
+typedef struct _EmulationPacket0 EmulationPacket0;
+typedef struct _EmulationPacket0Class EmulationPacket0Class;
+
+#define EMULATION_TYPE_PACKET1 (emulation_packet1_get_type ())
+#define EMULATION_PACKET1(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET1, EmulationPacket1))
+#define EMULATION_PACKET1_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET1, EmulationPacket1Class))
+#define EMULATION_IS_PACKET1(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET1))
+#define EMULATION_IS_PACKET1_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET1))
+#define EMULATION_PACKET1_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET1, EmulationPacket1Class))
+
+typedef struct _EmulationPacket1 EmulationPacket1;
+typedef struct _EmulationPacket1Class EmulationPacket1Class;
+
+#define EMULATION_TYPE_PACKET2 (emulation_packet2_get_type ())
+#define EMULATION_PACKET2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET2, EmulationPacket2))
+#define EMULATION_PACKET2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET2, EmulationPacket2Class))
+#define EMULATION_IS_PACKET2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET2))
+#define EMULATION_IS_PACKET2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET2))
+#define EMULATION_PACKET2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET2, EmulationPacket2Class))
+
+typedef struct _EmulationPacket2 EmulationPacket2;
+typedef struct _EmulationPacket2Class EmulationPacket2Class;
+
+#define EMULATION_TYPE_PACKET3 (emulation_packet3_get_type ())
+#define EMULATION_PACKET3(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET3, EmulationPacket3))
+#define EMULATION_PACKET3_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET3, EmulationPacket3Class))
+#define EMULATION_IS_PACKET3(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET3))
+#define EMULATION_IS_PACKET3_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET3))
+#define EMULATION_PACKET3_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET3, EmulationPacket3Class))
+
+typedef struct _EmulationPacket3 EmulationPacket3;
+typedef struct _EmulationPacket3Class EmulationPacket3Class;
+
+#define EMULATION_TYPE_PACKET_ITERATOR (emulation_packet_iterator_get_type ())
+#define EMULATION_PACKET_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET_ITERATOR, EmulationPacketIterator))
+#define EMULATION_PACKET_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET_ITERATOR, EmulationPacketIteratorClass))
+#define EMULATION_IS_PACKET_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET_ITERATOR))
+#define EMULATION_IS_PACKET_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET_ITERATOR))
+#define EMULATION_PACKET_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET_ITERATOR, EmulationPacketIteratorClass))
+
+typedef struct _EmulationPacketIterator EmulationPacketIterator;
+typedef struct _EmulationPacketIteratorClass EmulationPacketIteratorClass;
+typedef struct _EmulationPacketIteratorPrivate EmulationPacketIteratorPrivate;
+typedef struct _EmulationPacketBasePrivate EmulationPacketBasePrivate;
+typedef struct _EmulationPacket0Private EmulationPacket0Private;
+typedef struct _EmulationPacket1Private EmulationPacket1Private;
+typedef struct _EmulationPacket2Private EmulationPacket2Private;
+typedef struct _EmulationPacket3Private EmulationPacket3Private;
+
+#define EMULATION_TYPE_CS (emulation_cs_get_type ())
+#define EMULATION_CS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_CS, EmulationCS))
+#define EMULATION_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_CS, EmulationCSClass))
+#define EMULATION_IS_CS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_CS))
+#define EMULATION_IS_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_CS))
+#define EMULATION_CS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_CS, EmulationCSClass))
+
+typedef struct _EmulationCS EmulationCS;
+typedef struct _EmulationCSClass EmulationCSClass;
+typedef struct _EmulationCSPrivate EmulationCSPrivate;
+
+typedef enum {
+ EMULATION_CHIP_R300,
+ EMULATION_CHIP_R500
+} EmulationChip;
+
+struct _EmulationPacketIterator {
+ GObject parent_instance;
+ EmulationPacketIteratorPrivate * priv;
+};
+
+struct _EmulationPacketIteratorClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationPacketIteratorPrivate {
+ EmulationPacketBase* m_packet;
+ guint m_pos;
+};
+
+struct _EmulationPacketBase {
+ GObject parent_instance;
+ EmulationPacketBasePrivate * priv;
+ guint32* dwords;
+ guint32 header;
+};
+
+struct _EmulationPacketBaseClass {
+ GObjectClass parent_class;
+ guint (*get_length) (EmulationPacketBase* self);
+};
+
+struct _EmulationPacket0 {
+ EmulationPacketBase parent_instance;
+ EmulationPacket0Private * priv;
+};
+
+struct _EmulationPacket0Class {
+ EmulationPacketBaseClass parent_class;
+};
+
+struct _EmulationPacket1 {
+ EmulationPacketBase parent_instance;
+ EmulationPacket1Private * priv;
+};
+
+struct _EmulationPacket1Class {
+ EmulationPacketBaseClass parent_class;
+};
+
+struct _EmulationPacket2 {
+ EmulationPacketBase parent_instance;
+ EmulationPacket2Private * priv;
+};
+
+struct _EmulationPacket2Class {
+ EmulationPacketBaseClass parent_class;
+};
+
+struct _EmulationPacket3 {
+ EmulationPacketBase parent_instance;
+ EmulationPacket3Private * priv;
+};
+
+struct _EmulationPacket3Class {
+ EmulationPacketBaseClass parent_class;
+};
+
+struct _EmulationCS {
+ GObject parent_instance;
+ EmulationCSPrivate * priv;
+ EmulationPacketBase** packets;
+ gint packets_length1;
+ guint32* dwords;
+ gint dwords_length1;
+};
+
+struct _EmulationCSClass {
+ GObjectClass parent_class;
+};
+
+
+static gpointer emulation_packet_iterator_parent_class = NULL;
+static gpointer emulation_packet_base_parent_class = NULL;
+static gpointer emulation_packet0_parent_class = NULL;
+static gpointer emulation_packet1_parent_class = NULL;
+static gpointer emulation_packet2_parent_class = NULL;
+static gpointer emulation_packet3_parent_class = NULL;
+static gpointer emulation_cs_parent_class = NULL;
+
+GType emulation_chip_get_type (void);
+guint emulation_packet_typeid (guint32 header);
+EmulationPacket0* emulation_packet0_new (guint32 header, guint32* dwords);
+EmulationPacket0* emulation_packet0_construct (GType object_type, guint32 header, guint32* dwords);
+GType emulation_packet_base_get_type (void);
+GType emulation_packet0_get_type (void);
+EmulationPacket1* emulation_packet1_new (guint32 header, guint32* dwords);
+EmulationPacket1* emulation_packet1_construct (GType object_type, guint32 header, guint32* dwords);
+GType emulation_packet1_get_type (void);
+EmulationPacket2* emulation_packet2_new (guint32 header, guint32* dwords);
+EmulationPacket2* emulation_packet2_construct (GType object_type, guint32 header, guint32* dwords);
+GType emulation_packet2_get_type (void);
+EmulationPacket3* emulation_packet3_new (guint32 header, guint32* dwords);
+EmulationPacket3* emulation_packet3_construct (GType object_type, guint32 header, guint32* dwords);
+GType emulation_packet3_get_type (void);
+EmulationPacketBase* emulation_packet_base_new (void);
+EmulationPacketBase* emulation_packet_base_construct (GType object_type);
+EmulationPacketBase* emulation_make_packet (guint32 header, guint32* dwords);
+GType emulation_packet_iterator_get_type (void);
+#define EMULATION_PACKET_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_PACKET_ITERATOR, EmulationPacketIteratorPrivate))
+enum {
+ EMULATION_PACKET_ITERATOR_DUMMY_PROPERTY
+};
+EmulationPacketIterator* emulation_packet_iterator_new (EmulationPacketBase* p);
+EmulationPacketIterator* emulation_packet_iterator_construct (GType object_type, EmulationPacketBase* p);
+guint emulation_packet_base_get_length (EmulationPacketBase* self);
+gboolean emulation_packet_iterator_next (EmulationPacketIterator* self);
+guint32 emulation_packet_iterator_get (EmulationPacketIterator* self);
+static void emulation_packet_iterator_finalize (GObject* obj);
+enum {
+ EMULATION_PACKET_BASE_DUMMY_PROPERTY,
+ EMULATION_PACKET_BASE_EXTRACT_TYPE,
+ EMULATION_PACKET_BASE_TYPE_ID,
+ EMULATION_PACKET_BASE_LENGTH
+};
+EmulationPacketIterator* emulation_packet_base_iterator (EmulationPacketBase* self);
+guint32 emulation_packet_base_get (EmulationPacketBase* self, guint index);
+guint32 emulation_packet_base_extract_bits (EmulationPacketBase* self, guint high, guint low);
+GType emulation_packet_base_get_extract_type (EmulationPacketBase* self);
+guint emulation_packet_base_get_type_id (EmulationPacketBase* self);
+static void emulation_packet_base_finalize (GObject* obj);
+static void emulation_packet_base_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+enum {
+ EMULATION_PACKET0_DUMMY_PROPERTY,
+ EMULATION_PACKET0_ADDR,
+ EMULATION_PACKET0_ONE_REG_WR,
+ EMULATION_PACKET0_LENGTH
+};
+guint32 emulation_packet0_get__ADDR (EmulationPacket0* self);
+guint32 emulation_packet0_get_addr (EmulationPacket0* self);
+guint32 emulation_packet0_get__ONE_REG_WR (EmulationPacket0* self);
+gboolean emulation_packet0_get_one_reg_wr (EmulationPacket0* self);
+guint32 emulation_packet0_get__COUNT (EmulationPacket0* self);
+static void emulation_packet0_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+enum {
+ EMULATION_PACKET1_DUMMY_PROPERTY,
+ EMULATION_PACKET1_ADDR1,
+ EMULATION_PACKET1_ADDR2,
+ EMULATION_PACKET1_LENGTH
+};
+guint32 emulation_packet1_get__ADDR1 (EmulationPacket1* self);
+guint32 emulation_packet1_get_addr1 (EmulationPacket1* self);
+guint32 emulation_packet1_get__ADDR2 (EmulationPacket1* self);
+guint32 emulation_packet1_get_addr2 (EmulationPacket1* self);
+static void emulation_packet1_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+enum {
+ EMULATION_PACKET2_DUMMY_PROPERTY,
+ EMULATION_PACKET2_LENGTH
+};
+static void emulation_packet2_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+enum {
+ EMULATION_PACKET3_DUMMY_PROPERTY,
+ EMULATION_PACKET3_OPCODE,
+ EMULATION_PACKET3_LENGTH
+};
+guint32 emulation_packet3_get__IT_OPCODE (EmulationPacket3* self);
+guint32 emulation_packet3_get_opcode (EmulationPacket3* self);
+guint32 emulation_packet3_get__COUNT (EmulationPacket3* self);
+static void emulation_packet3_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+GType emulation_cs_get_type (void);
+enum {
+ EMULATION_CS_DUMMY_PROPERTY
+};
+static guint emulation_cs_check (guint32* cs, guint len);
+static guint32* _vala_array_dup1 (guint32* self, int length);
+static EmulationPacketBase** _vala_array_dup2 (EmulationPacketBase** self, int length);
+EmulationCS* emulation_cs_new (guint32* cs, guint len);
+EmulationCS* emulation_cs_construct (GType object_type, guint32* cs, guint len);
+static void emulation_cs_finalize (GObject* obj);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
+
+
+
+
+GType emulation_chip_get_type (void) {
+ static GType emulation_chip_type_id = 0;
+ if (G_UNLIKELY (emulation_chip_type_id == 0)) {
+ static const GEnumValue values[] = {{EMULATION_CHIP_R300, "EMULATION_CHIP_R300", "r300"}, {EMULATION_CHIP_R500, "EMULATION_CHIP_R500", "r500"}, {0, NULL, NULL}};
+ emulation_chip_type_id = g_enum_register_static ("EmulationChip", values);
+ }
+ return emulation_chip_type_id;
+}
+
+
+inline guint emulation_packet_typeid (guint32 header) {
+ guint result;
+ result = (guint) ((header >> 30) & 3);
+ return result;
+}
+
+
+inline EmulationPacketBase* emulation_make_packet (guint32 header, guint32* dwords) {
+ EmulationPacketBase* result;
+ switch (emulation_packet_typeid (header)) {
+ case 0:
+ {
+ result = (EmulationPacketBase*) emulation_packet0_new (header, dwords);
+ return result;
+ }
+ case 1:
+ {
+ result = (EmulationPacketBase*) emulation_packet1_new (header, dwords);
+ return result;
+ }
+ case 2:
+ {
+ result = (EmulationPacketBase*) emulation_packet2_new (header, dwords);
+ return result;
+ }
+ case 3:
+ {
+ result = (EmulationPacketBase*) emulation_packet3_new (header, dwords);
+ return result;
+ }
+ }
+ g_assert (FALSE);
+ result = emulation_packet_base_new ();
+ return result;
+}
+
+
+EmulationPacketIterator* emulation_packet_iterator_construct (GType object_type, EmulationPacketBase* p) {
+ EmulationPacketIterator * self;
+ EmulationPacketBase* _tmp1_;
+ EmulationPacketBase* _tmp0_;
+ g_return_val_if_fail (p != NULL, NULL);
+ self = g_object_newv (object_type, 0, NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->m_packet = (_tmp1_ = (_tmp0_ = p, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (self->priv->m_packet == NULL) ? NULL : (self->priv->m_packet = (g_object_unref (self->priv->m_packet), NULL)), _tmp1_);
+ self->priv->m_pos = (guint) 0;
+ return self;
+}
+
+
+EmulationPacketIterator* emulation_packet_iterator_new (EmulationPacketBase* p) {
+ return emulation_packet_iterator_construct (EMULATION_TYPE_PACKET_ITERATOR, p);
+}
+
+
+gboolean emulation_packet_iterator_next (EmulationPacketIterator* self) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = self->priv->m_pos < emulation_packet_base_get_length (self->priv->m_packet);
+ return result;
+}
+
+
+guint32 emulation_packet_iterator_get (EmulationPacketIterator* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->m_packet->dwords[self->priv->m_pos++];
+ return result;
+}
+
+
+static void emulation_packet_iterator_class_init (EmulationPacketIteratorClass * klass) {
+ emulation_packet_iterator_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationPacketIteratorPrivate));
+ G_OBJECT_CLASS (klass)->finalize = emulation_packet_iterator_finalize;
+}
+
+
+static void emulation_packet_iterator_instance_init (EmulationPacketIterator * self) {
+ self->priv = EMULATION_PACKET_ITERATOR_GET_PRIVATE (self);
+}
+
+
+static void emulation_packet_iterator_finalize (GObject* obj) {
+ EmulationPacketIterator * self;
+ self = EMULATION_PACKET_ITERATOR (obj);
+ (self->priv->m_packet == NULL) ? NULL : (self->priv->m_packet = (g_object_unref (self->priv->m_packet), NULL));
+ G_OBJECT_CLASS (emulation_packet_iterator_parent_class)->finalize (obj);
+}
+
+
+GType emulation_packet_iterator_get_type (void) {
+ static GType emulation_packet_iterator_type_id = 0;
+ if (emulation_packet_iterator_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationPacketIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_packet_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationPacketIterator), 0, (GInstanceInitFunc) emulation_packet_iterator_instance_init, NULL };
+ emulation_packet_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationPacketIterator", &g_define_type_info, 0);
+ }
+ return emulation_packet_iterator_type_id;
+}
+
+
+EmulationPacketIterator* emulation_packet_base_iterator (EmulationPacketBase* self) {
+ EmulationPacketIterator* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = emulation_packet_iterator_new (self);
+ return result;
+}
+
+
+guint32 emulation_packet_base_get (EmulationPacketBase* self, guint index) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->dwords[index];
+ return result;
+}
+
+
+inline guint32 emulation_packet_base_extract_bits (EmulationPacketBase* self, guint high, guint low) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = (self->header >> low) & ((1 << ((high - low) + 1)) - 1);
+ return result;
+}
+
+
+EmulationPacketBase* emulation_packet_base_construct (GType object_type) {
+ EmulationPacketBase * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationPacketBase* emulation_packet_base_new (void) {
+ return emulation_packet_base_construct (EMULATION_TYPE_PACKET_BASE);
+}
+
+
+GType emulation_packet_base_get_extract_type (EmulationPacketBase* self) {
+ GType result;
+ g_return_val_if_fail (self != NULL, 0UL);
+ result = G_TYPE_UINT;
+ return result;
+}
+
+
+guint emulation_packet_base_get_type_id (EmulationPacketBase* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_typeid (self->header);
+ return result;
+}
+
+
+guint emulation_packet_base_get_length (EmulationPacketBase* self) {
+ return EMULATION_PACKET_BASE_GET_CLASS (self)->get_length (self);
+}
+
+
+static void emulation_packet_base_class_init (EmulationPacketBaseClass * klass) {
+ emulation_packet_base_parent_class = g_type_class_peek_parent (klass);
+ G_OBJECT_CLASS (klass)->get_property = emulation_packet_base_get_property;
+ G_OBJECT_CLASS (klass)->finalize = emulation_packet_base_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET_BASE_EXTRACT_TYPE, g_param_spec_gtype ("extract-type", "extract-type", "extract-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET_BASE_TYPE_ID, g_param_spec_uint ("type-id", "type-id", "type-id", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET_BASE_LENGTH, g_param_spec_uint ("length", "length", "length", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+}
+
+
+static void emulation_packet_base_instance_init (EmulationPacketBase * self) {
+}
+
+
+static void emulation_packet_base_finalize (GObject* obj) {
+ EmulationPacketBase * self;
+ self = EMULATION_PACKET_BASE (obj);
+ G_OBJECT_CLASS (emulation_packet_base_parent_class)->finalize (obj);
+}
+
+
+GType emulation_packet_base_get_type (void) {
+ static GType emulation_packet_base_type_id = 0;
+ if (emulation_packet_base_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationPacketBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_packet_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationPacketBase), 0, (GInstanceInitFunc) emulation_packet_base_instance_init, NULL };
+ emulation_packet_base_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationPacketBase", &g_define_type_info, 0);
+ }
+ return emulation_packet_base_type_id;
+}
+
+
+static void emulation_packet_base_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationPacketBase * self;
+ gpointer boxed;
+ self = EMULATION_PACKET_BASE (object);
+ switch (property_id) {
+ case EMULATION_PACKET_BASE_EXTRACT_TYPE:
+ g_value_set_gtype (value, emulation_packet_base_get_extract_type (self));
+ break;
+ case EMULATION_PACKET_BASE_TYPE_ID:
+ g_value_set_uint (value, emulation_packet_base_get_type_id (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationPacket0* emulation_packet0_construct (GType object_type, guint32 header, guint32* dwords) {
+ EmulationPacket0 * self;
+ self = (EmulationPacket0*) emulation_packet_base_construct (object_type);
+ ((EmulationPacketBase*) self)->header = header;
+ ((EmulationPacketBase*) self)->dwords = dwords;
+ return self;
+}
+
+
+EmulationPacket0* emulation_packet0_new (guint32 header, guint32* dwords) {
+ return emulation_packet0_construct (EMULATION_TYPE_PACKET0, header, dwords);
+}
+
+
+guint32 emulation_packet0_get_addr (EmulationPacket0* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet0_get__ADDR (self) << 2;
+ return result;
+}
+
+
+gboolean emulation_packet0_get_one_reg_wr (EmulationPacket0* self) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = (gboolean) emulation_packet0_get__ONE_REG_WR (self);
+ return result;
+}
+
+
+static guint emulation_packet0_real_get_length (EmulationPacketBase* base) {
+ guint result;
+ EmulationPacket0* self;
+ self = (EmulationPacket0*) base;
+ result = ((guint) emulation_packet0_get__COUNT (self)) + 1;
+ return result;
+}
+
+
+guint32 emulation_packet0_get__ADDR (EmulationPacket0* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 12, (guint) 0);
+ return result;
+}
+
+
+guint32 emulation_packet0_get__ONE_REG_WR (EmulationPacket0* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 15, (guint) 15);
+ return result;
+}
+
+
+guint32 emulation_packet0_get__COUNT (EmulationPacket0* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 29, (guint) 16);
+ return result;
+}
+
+
+static void emulation_packet0_class_init (EmulationPacket0Class * klass) {
+ emulation_packet0_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_PACKET_BASE_CLASS (klass)->get_length = emulation_packet0_real_get_length;
+ G_OBJECT_CLASS (klass)->get_property = emulation_packet0_get_property;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET0_ADDR, g_param_spec_uint ("addr", "addr", "addr", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET0_ONE_REG_WR, g_param_spec_boolean ("one-reg-wr", "one-reg-wr", "one-reg-wr", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_override_property (G_OBJECT_CLASS (klass), EMULATION_PACKET0_LENGTH, "length");
+}
+
+
+static void emulation_packet0_instance_init (EmulationPacket0 * self) {
+}
+
+
+GType emulation_packet0_get_type (void) {
+ static GType emulation_packet0_type_id = 0;
+ if (emulation_packet0_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationPacket0Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_packet0_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationPacket0), 0, (GInstanceInitFunc) emulation_packet0_instance_init, NULL };
+ emulation_packet0_type_id = g_type_register_static (EMULATION_TYPE_PACKET_BASE, "EmulationPacket0", &g_define_type_info, 0);
+ }
+ return emulation_packet0_type_id;
+}
+
+
+static void emulation_packet0_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationPacket0 * self;
+ gpointer boxed;
+ self = EMULATION_PACKET0 (object);
+ switch (property_id) {
+ case EMULATION_PACKET0_ADDR:
+ g_value_set_uint (value, emulation_packet0_get_addr (self));
+ break;
+ case EMULATION_PACKET0_ONE_REG_WR:
+ g_value_set_boolean (value, emulation_packet0_get_one_reg_wr (self));
+ break;
+ case EMULATION_PACKET0_LENGTH:
+ g_value_set_uint (value, emulation_packet_base_get_length ((EmulationPacketBase*) self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationPacket1* emulation_packet1_construct (GType object_type, guint32 header, guint32* dwords) {
+ EmulationPacket1 * self;
+ self = (EmulationPacket1*) emulation_packet_base_construct (object_type);
+ ((EmulationPacketBase*) self)->header = header;
+ ((EmulationPacketBase*) self)->dwords = dwords;
+ return self;
+}
+
+
+EmulationPacket1* emulation_packet1_new (guint32 header, guint32* dwords) {
+ return emulation_packet1_construct (EMULATION_TYPE_PACKET1, header, dwords);
+}
+
+
+guint32 emulation_packet1_get_addr1 (EmulationPacket1* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet1_get__ADDR1 (self) << 2;
+ return result;
+}
+
+
+guint32 emulation_packet1_get_addr2 (EmulationPacket1* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet1_get__ADDR2 (self) << 2;
+ return result;
+}
+
+
+static guint emulation_packet1_real_get_length (EmulationPacketBase* base) {
+ guint result;
+ EmulationPacket1* self;
+ self = (EmulationPacket1*) base;
+ result = (guint) 2;
+ return result;
+}
+
+
+guint32 emulation_packet1_get__ADDR1 (EmulationPacket1* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 10, (guint) 0);
+ return result;
+}
+
+
+guint32 emulation_packet1_get__ADDR2 (EmulationPacket1* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 21, (guint) 11);
+ return result;
+}
+
+
+static void emulation_packet1_class_init (EmulationPacket1Class * klass) {
+ emulation_packet1_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_PACKET_BASE_CLASS (klass)->get_length = emulation_packet1_real_get_length;
+ G_OBJECT_CLASS (klass)->get_property = emulation_packet1_get_property;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET1_ADDR1, g_param_spec_uint ("addr1", "addr1", "addr1", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET1_ADDR2, g_param_spec_uint ("addr2", "addr2", "addr2", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_override_property (G_OBJECT_CLASS (klass), EMULATION_PACKET1_LENGTH, "length");
+}
+
+
+static void emulation_packet1_instance_init (EmulationPacket1 * self) {
+}
+
+
+GType emulation_packet1_get_type (void) {
+ static GType emulation_packet1_type_id = 0;
+ if (emulation_packet1_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationPacket1Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_packet1_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationPacket1), 0, (GInstanceInitFunc) emulation_packet1_instance_init, NULL };
+ emulation_packet1_type_id = g_type_register_static (EMULATION_TYPE_PACKET_BASE, "EmulationPacket1", &g_define_type_info, 0);
+ }
+ return emulation_packet1_type_id;
+}
+
+
+static void emulation_packet1_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationPacket1 * self;
+ gpointer boxed;
+ self = EMULATION_PACKET1 (object);
+ switch (property_id) {
+ case EMULATION_PACKET1_ADDR1:
+ g_value_set_uint (value, emulation_packet1_get_addr1 (self));
+ break;
+ case EMULATION_PACKET1_ADDR2:
+ g_value_set_uint (value, emulation_packet1_get_addr2 (self));
+ break;
+ case EMULATION_PACKET1_LENGTH:
+ g_value_set_uint (value, emulation_packet_base_get_length ((EmulationPacketBase*) self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationPacket2* emulation_packet2_construct (GType object_type, guint32 header, guint32* dwords) {
+ EmulationPacket2 * self;
+ self = (EmulationPacket2*) emulation_packet_base_construct (object_type);
+ ((EmulationPacketBase*) self)->header = header;
+ ((EmulationPacketBase*) self)->dwords = dwords;
+ return self;
+}
+
+
+EmulationPacket2* emulation_packet2_new (guint32 header, guint32* dwords) {
+ return emulation_packet2_construct (EMULATION_TYPE_PACKET2, header, dwords);
+}
+
+
+static guint emulation_packet2_real_get_length (EmulationPacketBase* base) {
+ guint result;
+ EmulationPacket2* self;
+ self = (EmulationPacket2*) base;
+ result = (guint) 0;
+ return result;
+}
+
+
+static void emulation_packet2_class_init (EmulationPacket2Class * klass) {
+ emulation_packet2_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_PACKET_BASE_CLASS (klass)->get_length = emulation_packet2_real_get_length;
+ G_OBJECT_CLASS (klass)->get_property = emulation_packet2_get_property;
+ g_object_class_override_property (G_OBJECT_CLASS (klass), EMULATION_PACKET2_LENGTH, "length");
+}
+
+
+static void emulation_packet2_instance_init (EmulationPacket2 * self) {
+}
+
+
+GType emulation_packet2_get_type (void) {
+ static GType emulation_packet2_type_id = 0;
+ if (emulation_packet2_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationPacket2Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_packet2_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationPacket2), 0, (GInstanceInitFunc) emulation_packet2_instance_init, NULL };
+ emulation_packet2_type_id = g_type_register_static (EMULATION_TYPE_PACKET_BASE, "EmulationPacket2", &g_define_type_info, 0);
+ }
+ return emulation_packet2_type_id;
+}
+
+
+static void emulation_packet2_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationPacket2 * self;
+ gpointer boxed;
+ self = EMULATION_PACKET2 (object);
+ switch (property_id) {
+ case EMULATION_PACKET2_LENGTH:
+ g_value_set_uint (value, emulation_packet_base_get_length ((EmulationPacketBase*) self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationPacket3* emulation_packet3_construct (GType object_type, guint32 header, guint32* dwords) {
+ EmulationPacket3 * self;
+ self = (EmulationPacket3*) emulation_packet_base_construct (object_type);
+ ((EmulationPacketBase*) self)->header = header;
+ ((EmulationPacketBase*) self)->dwords = dwords;
+ return self;
+}
+
+
+EmulationPacket3* emulation_packet3_new (guint32 header, guint32* dwords) {
+ return emulation_packet3_construct (EMULATION_TYPE_PACKET3, header, dwords);
+}
+
+
+guint32 emulation_packet3_get_opcode (EmulationPacket3* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet3_get__IT_OPCODE (self);
+ return result;
+}
+
+
+static guint emulation_packet3_real_get_length (EmulationPacketBase* base) {
+ guint result;
+ EmulationPacket3* self;
+ self = (EmulationPacket3*) base;
+ result = ((guint) emulation_packet3_get__COUNT (self)) + 1;
+ return result;
+}
+
+
+guint32 emulation_packet3_get__IT_OPCODE (EmulationPacket3* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 15, (guint) 8);
+ return result;
+}
+
+
+guint32 emulation_packet3_get__COUNT (EmulationPacket3* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = emulation_packet_base_extract_bits ((EmulationPacketBase*) self, (guint) 29, (guint) 16);
+ return result;
+}
+
+
+static void emulation_packet3_class_init (EmulationPacket3Class * klass) {
+ emulation_packet3_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_PACKET_BASE_CLASS (klass)->get_length = emulation_packet3_real_get_length;
+ G_OBJECT_CLASS (klass)->get_property = emulation_packet3_get_property;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_PACKET3_OPCODE, g_param_spec_uint ("opcode", "opcode", "opcode", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_override_property (G_OBJECT_CLASS (klass), EMULATION_PACKET3_LENGTH, "length");
+}
+
+
+static void emulation_packet3_instance_init (EmulationPacket3 * self) {
+}
+
+
+GType emulation_packet3_get_type (void) {
+ static GType emulation_packet3_type_id = 0;
+ if (emulation_packet3_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationPacket3Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_packet3_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationPacket3), 0, (GInstanceInitFunc) emulation_packet3_instance_init, NULL };
+ emulation_packet3_type_id = g_type_register_static (EMULATION_TYPE_PACKET_BASE, "EmulationPacket3", &g_define_type_info, 0);
+ }
+ return emulation_packet3_type_id;
+}
+
+
+static void emulation_packet3_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationPacket3 * self;
+ gpointer boxed;
+ self = EMULATION_PACKET3 (object);
+ switch (property_id) {
+ case EMULATION_PACKET3_OPCODE:
+ g_value_set_uint (value, emulation_packet3_get_opcode (self));
+ break;
+ case EMULATION_PACKET3_LENGTH:
+ g_value_set_uint (value, emulation_packet_base_get_length ((EmulationPacketBase*) self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static guint emulation_cs_check (guint32* cs, guint len) {
+ guint result;
+ gint pkt_count;
+ pkt_count = 0;
+ {
+ guint i;
+ i = (guint) 0;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ EmulationPacketBase* _tmp1_;
+ if (!_tmp0_) {
+ i++;
+ pkt_count++;
+ }
+ _tmp0_ = FALSE;
+ if (!(i < len)) {
+ break;
+ }
+ _tmp1_ = NULL;
+ i = i + emulation_packet_base_get_length (_tmp1_ = emulation_make_packet (cs[i], NULL));
+ (_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_object_unref (_tmp1_), NULL));
+ if ((i + 1) > len) {
+ result = (guint) 0;
+ return result;
+ }
+ }
+ }
+ }
+ result = (guint) pkt_count;
+ return result;
+}
+
+
+static guint32* _vala_array_dup1 (guint32* self, int length) {
+ return g_memdup (self, length * sizeof (guint32));
+}
+
+
+static EmulationPacketBase** _vala_array_dup2 (EmulationPacketBase** self, int length) {
+ EmulationPacketBase** result;
+ int i;
+ EmulationPacketBase* _tmp8_;
+ result = g_new0 (EmulationPacketBase*, length);
+ for (i = 0; i < length; i++) {
+ result[i] = (_tmp8_ = self[i], (_tmp8_ == NULL) ? NULL : g_object_ref (_tmp8_));
+ }
+ return result;
+}
+
+
+EmulationCS* emulation_cs_construct (GType object_type, guint32* cs, guint len) {
+ EmulationCS * self;
+ gint _tmp0__size;
+ gint _tmp0__length1;
+ guint32* _tmp0_;
+ guint32* _tmp4_;
+ guint32* _tmp3_;
+ guint pkt_count;
+ gint _tmp5__size;
+ gint _tmp5__length1;
+ EmulationPacketBase** _tmp5_;
+ EmulationPacketBase** _tmp10_;
+ EmulationPacketBase** _tmp9_;
+ EmulationPacketBase* _tmp8_;
+ self = g_object_newv (object_type, 0, NULL);
+ if (len > 0) {
+ g_assert (cs != NULL);
+ }
+ _tmp0_ = (_tmp0__length1 = 0, NULL);
+ if (len > 0) {
+ guint32* _tmp1_;
+ _tmp1_ = NULL;
+ _tmp0_ = (_tmp1_ = g_new0 (guint32, len), _tmp0_ = (g_free (_tmp0_), NULL), _tmp0__length1 = len, _tmp0__size = _tmp0__length1, _tmp1_);
+ } else {
+ guint32* _tmp2_;
+ _tmp2_ = NULL;
+ _tmp0_ = (_tmp2_ = NULL, _tmp0_ = (g_free (_tmp0_), NULL), _tmp0__length1 = 0, _tmp0__size = _tmp0__length1, _tmp2_);
+ }
+ _tmp4_ = NULL;
+ _tmp3_ = NULL;
+ self->dwords = (_tmp4_ = (_tmp3_ = _tmp0_, (_tmp3_ == NULL) ? ((gpointer) _tmp3_) : _vala_array_dup1 (_tmp3_, _tmp0__length1)), self->dwords = (g_free (self->dwords), NULL), self->dwords_length1 = _tmp0__length1, _tmp4_);
+ if (len > 0) {
+ memcpy (self->dwords, cs, (gsize) (len * sizeof (guint32)));
+ }
+ pkt_count = emulation_cs_check (cs, len);
+ _tmp5_ = (_tmp5__length1 = 0, NULL);
+ if (pkt_count > 0) {
+ EmulationPacketBase** _tmp6_;
+ _tmp6_ = NULL;
+ _tmp5_ = (_tmp6_ = g_new0 (EmulationPacketBase*, pkt_count + 1), _tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL), _tmp5__length1 = pkt_count, _tmp5__size = _tmp5__length1, _tmp6_);
+ } else {
+ EmulationPacketBase** _tmp7_;
+ _tmp7_ = NULL;
+ _tmp5_ = (_tmp7_ = NULL, _tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL), _tmp5__length1 = 0, _tmp5__size = _tmp5__length1, _tmp7_);
+ }
+ _tmp10_ = NULL;
+ _tmp9_ = NULL;
+ _tmp8_ = NULL;
+ self->packets = (_tmp10_ = (_tmp9_ = _tmp5_, (_tmp9_ == NULL) ? ((gpointer) _tmp9_) : _vala_array_dup2 (_tmp9_, _tmp5__length1)), self->packets = (_vala_array_free (self->packets, self->packets_length1, (GDestroyNotify) g_object_unref), NULL), self->packets_length1 = _tmp5__length1, _tmp10_);
+ if (pkt_count > 0) {
+ guint pkt;
+ pkt = (guint) 0;
+ {
+ guint i;
+ i = (guint) 0;
+ {
+ gboolean _tmp11_;
+ _tmp11_ = TRUE;
+ while (TRUE) {
+ guint32* _tmp12_;
+ EmulationPacketBase* _tmp13_;
+ if (!_tmp11_) {
+ i++;
+ }
+ _tmp11_ = FALSE;
+ if (!(i < len)) {
+ break;
+ }
+ _tmp12_ = NULL;
+ if (i < (len - 1)) {
+ _tmp12_ = &self->dwords[i + 1];
+ } else {
+ _tmp12_ = NULL;
+ }
+ _tmp13_ = NULL;
+ self->packets[pkt] = (_tmp13_ = emulation_make_packet (self->dwords[i], _tmp12_), (self->packets[pkt] == NULL) ? NULL : (self->packets[pkt] = (g_object_unref (self->packets[pkt]), NULL)), _tmp13_);
+ i = i + emulation_packet_base_get_length (self->packets[pkt++]);
+ }
+ }
+ }
+ }
+ _tmp0_ = (g_free (_tmp0_), NULL);
+ _tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL);
+ return self;
+}
+
+
+EmulationCS* emulation_cs_new (guint32* cs, guint len) {
+ return emulation_cs_construct (EMULATION_TYPE_CS, cs, len);
+}
+
+
+static void emulation_cs_class_init (EmulationCSClass * klass) {
+ emulation_cs_parent_class = g_type_class_peek_parent (klass);
+ G_OBJECT_CLASS (klass)->finalize = emulation_cs_finalize;
+}
+
+
+static void emulation_cs_instance_init (EmulationCS * self) {
+}
+
+
+static void emulation_cs_finalize (GObject* obj) {
+ EmulationCS * self;
+ self = EMULATION_CS (obj);
+ self->packets = (_vala_array_free (self->packets, self->packets_length1, (GDestroyNotify) g_object_unref), NULL);
+ self->dwords = (g_free (self->dwords), NULL);
+ G_OBJECT_CLASS (emulation_cs_parent_class)->finalize (obj);
+}
+
+
+GType emulation_cs_get_type (void) {
+ static GType emulation_cs_type_id = 0;
+ if (emulation_cs_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationCSClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_cs_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationCS), 0, (GInstanceInitFunc) emulation_cs_instance_init, NULL };
+ emulation_cs_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationCS", &g_define_type_info, 0);
+ }
+ return emulation_cs_type_id;
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+
+
diff --git a/src/cs.vala b/src/cs.vala
new file mode 100644
index 0000000..b1fb500
--- /dev/null
+++ b/src/cs.vala
@@ -0,0 +1,149 @@
+namespace Emulation
+{
+ public enum Chip {
+ R300,
+ R500
+ }
+
+ private static inline uint packet_typeid(uint32 header) { return (header >> 30) & 3; }
+
+ public static inline PacketBase make_packet(uint32 header, uint32 *dwords = null)
+ {
+ switch (packet_typeid(header)) {
+ case 0: return new Packet0(header, dwords);
+ case 1: return new Packet1(header, dwords);
+ case 2: return new Packet2(header, dwords);
+ case 3: return new Packet3(header, dwords);
+ }
+ assert(false);
+ return new PacketBase();
+ }
+
+ public class PacketIterator : Object
+ {
+ private PacketBase m_packet;
+ private uint m_pos;
+
+ public PacketIterator(PacketBase p)
+ {
+ m_packet = p;
+ m_pos = 0;
+ }
+
+ public bool next() { return m_pos < m_packet.length; }
+ public new uint32 get() { return m_packet.dwords[m_pos++]; }
+ }
+
+ public class PacketBase : Object
+ {
+ public uint32 *dwords;
+ public Type extract_type { get { return typeof(uint32); } }
+ public PacketIterator iterator() { return new PacketIterator(this); }
+
+ public uint32 header;
+ public uint type_id { get { return packet_typeid(header); } }
+
+ public abstract uint length { get; }
+ public new uint32 get(uint index) { return dwords[index]; }
+
+ protected inline uint32 extract_bits(uint high, uint low)
+ {
+ return (header >> low) & ((1 << (high-low+1))-1);
+ }
+ }
+
+ public class Packet0 : PacketBase
+ {
+ public uint32 addr { get { return _ADDR << 2; } }
+ public bool one_reg_wr { get { return (bool)_ONE_REG_WR; } }
+ public override uint length { get { return (uint)_COUNT+1; } }
+
+ public uint32 _ADDR { get { return extract_bits(12, 0); } }
+ public uint32 _ONE_REG_WR { get { return extract_bits(15, 15); } }
+ public uint32 _COUNT { get { return extract_bits(29, 16); } }
+
+ public Packet0(uint32 header, uint32 *dwords = null)
+ {
+ this.header = header;
+ this.dwords = dwords;
+ }
+ }
+
+ public class Packet1 : PacketBase
+ {
+ public uint32 addr1 { get { return _ADDR1 << 2; } }
+ public uint32 addr2 { get { return _ADDR2 << 2; } }
+ public override uint length { get { return 2; } }
+
+ public uint32 _ADDR1 { get { return extract_bits(10, 0); } }
+ public uint32 _ADDR2 { get { return extract_bits(21, 11); } }
+
+ public Packet1(uint32 header, uint32 *dwords = null)
+ {
+ this.header = header;
+ this.dwords = dwords;
+ }
+ }
+
+ public class Packet2 : PacketBase
+ {
+ public override uint length { get { return 0; } }
+
+ public Packet2(uint32 header, uint32 *dwords = null)
+ {
+ this.header = header;
+ this.dwords = dwords;
+ }
+ }
+
+ public class Packet3 : PacketBase
+ {
+ public uint32 opcode { get { return _IT_OPCODE; } }
+ public override uint length { get { return (uint)_COUNT+1; } }
+
+ public uint32 _IT_OPCODE { get { return extract_bits(15, 8); } }
+ public uint32 _COUNT { get { return extract_bits(29, 16); } }
+
+ public Packet3(uint32 header, uint32 *dwords = null)
+ {
+ this.header = header;
+ this.dwords = dwords;
+ }
+ }
+
+ public class CS : Object
+ {
+ public PacketBase[] packets;
+ public uint32[] dwords;
+
+ private static uint check(uint32 *cs, uint len)
+ {
+ int pkt_count = 0;
+ for (uint i = 0; i < len; i++, pkt_count++) {
+ i += make_packet(cs[i]).length;
+ if (i+1 > len) { return 0; }
+ }
+ return pkt_count;
+ }
+
+ public CS(uint32 *cs, uint len)
+ {
+ if (len > 0) { assert(cs != null); }
+
+ dwords = (len > 0) ? new uint32[len] : null;
+ if (len > 0) {
+ Memory.copy(dwords, cs, len*sizeof(uint32));
+ }
+
+ var pkt_count = check(cs, len);
+ packets = (pkt_count > 0) ? new PacketBase[pkt_count] : null;
+ if (pkt_count > 0) {
+ uint pkt = 0;
+ for (uint i = 0; i < len; i++) {
+ packets[pkt] = make_packet(dwords[i], (i < (len-1)) ? &dwords[i+1] : null);
+ i += packets[pkt++].length;
+ }
+ }
+ }
+ }
+}
diff --git a/src/csimport.c b/src/csimport.c
new file mode 100644
index 0000000..710f82d
--- /dev/null
+++ b/src/csimport.c
@@ -0,0 +1,501 @@
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gdk/gdk.h>
+#include <stdio.h>
+
+
+#define GUI_TYPE_CMAIN (gui_cmain_get_type ())
+#define GUI_CMAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CMAIN, GUICMain))
+#define GUI_CMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CMAIN, GUICMainClass))
+#define GUI_IS_CMAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CMAIN))
+#define GUI_IS_CMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CMAIN))
+#define GUI_CMAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CMAIN, GUICMainClass))
+
+typedef struct _GUICMain GUICMain;
+typedef struct _GUICMainClass GUICMainClass;
+typedef struct _GUICMainPrivate GUICMainPrivate;
+
+#define GUI_TYPE_CMENUS (gui_cmenus_get_type ())
+#define GUI_CMENUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CMENUS, GUICMenus))
+#define GUI_CMENUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CMENUS, GUICMenusClass))
+#define GUI_IS_CMENUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CMENUS))
+#define GUI_IS_CMENUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CMENUS))
+#define GUI_CMENUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CMENUS, GUICMenusClass))
+
+typedef struct _GUICMenus GUICMenus;
+typedef struct _GUICMenusClass GUICMenusClass;
+
+#define EMULATION_TYPE_CS (emulation_cs_get_type ())
+#define EMULATION_CS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_CS, EmulationCS))
+#define EMULATION_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_CS, EmulationCSClass))
+#define EMULATION_IS_CS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_CS))
+#define EMULATION_IS_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_CS))
+#define EMULATION_CS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_CS, EmulationCSClass))
+
+typedef struct _EmulationCS EmulationCS;
+typedef struct _EmulationCSClass EmulationCSClass;
+
+#define GUI_TYPE_CS_IMPORT (gui_cs_import_get_type ())
+#define GUI_CS_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_IMPORT, GUICSImport))
+#define GUI_CS_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_IMPORT, GUICSImportClass))
+#define GUI_IS_CS_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_IMPORT))
+#define GUI_IS_CS_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_IMPORT))
+#define GUI_CS_IMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_IMPORT, GUICSImportClass))
+
+typedef struct _GUICSImport GUICSImport;
+typedef struct _GUICSImportClass GUICSImportClass;
+typedef struct _GUICSImportPrivate GUICSImportPrivate;
+
+#define EMULATION_TYPE_PACKET_BASE (emulation_packet_base_get_type ())
+#define EMULATION_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBase))
+#define EMULATION_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+#define EMULATION_IS_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_IS_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_PACKET_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+
+typedef struct _EmulationPacketBase EmulationPacketBase;
+typedef struct _EmulationPacketBaseClass EmulationPacketBaseClass;
+
+struct _GUICMain {
+ GtkWindow parent_instance;
+ GUICMainPrivate * priv;
+ GUICMenus* menu;
+ GtkMenuBar* menubar;
+ GtkToolbar* toolbar;
+ GtkListStore* cs_store;
+};
+
+struct _GUICMainClass {
+ GtkWindowClass parent_class;
+};
+
+struct _GUICSImport {
+ GtkDialog parent_instance;
+ GUICSImportPrivate * priv;
+};
+
+struct _GUICSImportClass {
+ GtkDialogClass parent_class;
+};
+
+struct _GUICSImportPrivate {
+ GtkEntry* m_name_entry;
+ GtkLabel* m_status_label;
+ GtkListStore* m_dwords_store;
+ GtkButton* m_okbtn;
+ GArray* m_dwords;
+ gboolean m_validcs;
+};
+
+
+extern GUICMain* gui_main;
+static gpointer gui_cs_import_parent_class = NULL;
+
+GType gui_cmain_get_type (void);
+gpointer gui_cmenus_ref (gpointer instance);
+void gui_cmenus_unref (gpointer instance);
+GParamSpec* gui_param_spec_cmenus (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
+void gui_value_set_cmenus (GValue* value, gpointer v_object);
+gpointer gui_value_get_cmenus (const GValue* value);
+GType gui_cmenus_get_type (void);
+GType emulation_cs_get_type (void);
+void emulation_add_cs (const char* name, EmulationCS* cs);
+GType gui_cs_import_get_type (void);
+#define GUI_CS_IMPORT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUI_TYPE_CS_IMPORT, GUICSImportPrivate))
+enum {
+ GUI_CS_IMPORT_DUMMY_PROPERTY
+};
+static void gui_cs_import_dword_cellrenderer (GUICSImport* self, GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
+static inline void gui_cs_import_create_name_frame (GUICSImport* self);
+static void _gui_cs_import_dword_cellrenderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
+static void gui_cs_import_load_cs (GUICSImport* self, GtkButton* source);
+static void _gui_cs_import_load_cs_gtk_button_clicked (GtkButton* _sender, gpointer self);
+static inline void gui_cs_import_create_dwords_frame (GUICSImport* self);
+EmulationCS* emulation_cs_new (guint32* cs, guint len);
+EmulationCS* emulation_cs_construct (GType object_type, guint32* cs, guint len);
+static void gui_cs_import_on_response (GUICSImport* self, GtkDialog* source, gint response_id);
+static void gui_cs_import_open_cs (GUICSImport* self, const char* filename);
+GType emulation_packet_base_get_type (void);
+EmulationPacketBase* emulation_make_packet (guint32 header, guint32* dwords);
+guint emulation_packet_base_get_length (EmulationPacketBase* self);
+guint emulation_packet_base_get_type_id (EmulationPacketBase* self);
+static void gui_cs_import_update_okbtn (GUICSImport* self);
+GUICSImport* gui_cs_import_new (void);
+GUICSImport* gui_cs_import_construct (GType object_type);
+static void _gui_cs_import_update_okbtn_gtk_editable_changed (GtkEntry* _sender, gpointer self);
+static void _gui_cs_import_on_response_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self);
+static GObject * gui_cs_import_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void gui_cs_import_finalize (GObject* obj);
+
+
+
+void emulation_add_cs (const char* name, EmulationCS* cs) {
+ GtkTreeIter iter = {0};
+ g_return_if_fail (name != NULL);
+ g_return_if_fail (cs != NULL);
+ gtk_list_store_append (gui_main->cs_store, &iter);
+ gtk_list_store_set (gui_main->cs_store, &iter, 0, name, 1, cs, -1, -1);
+}
+
+
+static void gui_cs_import_dword_cellrenderer (GUICSImport* self, GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
+ guint32 id;
+ char* _tmp0_;
+ GtkCellRenderer* _tmp1_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (tree_column != NULL);
+ g_return_if_fail (cell != NULL);
+ g_return_if_fail (model != NULL);
+ id = (guint32) 0;
+ gtk_tree_model_get (model, &(*iter), 0, &id, -1, -1);
+ g_assert (id < self->priv->m_dwords->len);
+ _tmp0_ = NULL;
+ _tmp1_ = NULL;
+ g_object_set ((_tmp1_ = cell, GTK_IS_CELL_RENDERER_TEXT (_tmp1_) ? ((GtkCellRendererText*) _tmp1_) : NULL), "text", _tmp0_ = g_strdup_printf ("0x%08X", g_array_index (self->priv->m_dwords, guint32, (guint) id)), NULL);
+ _tmp0_ = (g_free (_tmp0_), NULL);
+}
+
+
+static inline void gui_cs_import_create_name_frame (GUICSImport* self) {
+ GtkAlignment* namealign;
+ GtkEntry* _tmp0_;
+ GtkFrame* nameframe;
+ GtkWidget* _tmp1_;
+ g_return_if_fail (self != NULL);
+ namealign = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new (1.0f, 0.5f, 1.0f, 1.0f));
+ g_object_set (namealign, "left-padding", (guint) 12, NULL);
+ g_object_set (namealign, "bottom-padding", (guint) 4, NULL);
+ _tmp0_ = NULL;
+ gtk_container_add ((GtkContainer*) namealign, (GtkWidget*) (self->priv->m_name_entry = (_tmp0_ = g_object_ref_sink ((GtkEntry*) gtk_entry_new ()), (self->priv->m_name_entry == NULL) ? NULL : (self->priv->m_name_entry = (g_object_unref (self->priv->m_name_entry), NULL)), _tmp0_)));
+ nameframe = g_object_ref_sink ((GtkFrame*) gtk_frame_new ("<b>Name</b>"));
+ _tmp1_ = NULL;
+ gtk_label_set_use_markup ((_tmp1_ = gtk_frame_get_label_widget (nameframe), GTK_IS_LABEL (_tmp1_) ? ((GtkLabel*) _tmp1_) : NULL), TRUE);
+ g_object_set (nameframe, "shadow", GTK_SHADOW_NONE, NULL);
+ gtk_container_add ((GtkContainer*) nameframe, (GtkWidget*) namealign);
+ gtk_box_pack_start ((GtkBox*) ((GtkDialog*) self)->vbox, (GtkWidget*) nameframe, FALSE, TRUE, (guint) 0);
+ (namealign == NULL) ? NULL : (namealign = (g_object_unref (namealign), NULL));
+ (nameframe == NULL) ? NULL : (nameframe = (g_object_unref (nameframe), NULL));
+}
+
+
+static void _gui_cs_import_dword_cellrenderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
+ gui_cs_import_dword_cellrenderer (self, tree_column, cell, tree_model, iter);
+}
+
+
+static void _gui_cs_import_load_cs_gtk_button_clicked (GtkButton* _sender, gpointer self) {
+ gui_cs_import_load_cs (self, _sender);
+}
+
+
+static inline void gui_cs_import_create_dwords_frame (GUICSImport* self) {
+ GtkListStore* _tmp0_;
+ GtkTreeView* dwords_list;
+ GtkCellRendererText* _tmp1_;
+ GtkCellRendererText* _tmp2_;
+ GtkCellRendererText* _tmp3_;
+ GtkScrolledWindow* sw;
+ GdkColor _tmp4_ = {0};
+ GdkColor col;
+ GtkLabel* _tmp5_;
+ GtkButton* loadbtn;
+ GtkAlignment* loadalign;
+ GtkHButtonBox* loadbox;
+ GtkImage* _tmp6_;
+ GtkHBox* bbox;
+ GtkVBox* dbox;
+ GtkAlignment* dwordsalign;
+ GtkFrame* dwordsframe;
+ GtkWidget* _tmp7_;
+ g_return_if_fail (self != NULL);
+ _tmp0_ = NULL;
+ self->priv->m_dwords_store = (_tmp0_ = gtk_list_store_new (2, G_TYPE_UINT, G_TYPE_STRING, NULL), (self->priv->m_dwords_store == NULL) ? NULL : (self->priv->m_dwords_store = (g_object_unref (self->priv->m_dwords_store), NULL)), _tmp0_);
+ dwords_list = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ());
+ _tmp1_ = NULL;
+ gtk_tree_view_insert_column_with_attributes (dwords_list, -1, "#", (GtkCellRenderer*) (_tmp1_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", 0, NULL, NULL);
+ (_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_object_unref (_tmp1_), NULL));
+ _tmp2_ = NULL;
+ gtk_tree_view_insert_column_with_data_func (dwords_list, -1, "Value", (GtkCellRenderer*) (_tmp2_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), _gui_cs_import_dword_cellrenderer_gtk_tree_cell_data_func, g_object_ref (self), g_object_unref);
+ (_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_object_unref (_tmp2_), NULL));
+ _tmp3_ = NULL;
+ gtk_tree_view_insert_column_with_attributes (dwords_list, -1, "Meta", (GtkCellRenderer*) (_tmp3_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", 1, NULL, NULL);
+ (_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_object_unref (_tmp3_), NULL));
+ gtk_container_set_border_width ((GtkContainer*) dwords_list, (guint) 5);
+ gtk_tree_view_set_model (dwords_list, (GtkTreeModel*) self->priv->m_dwords_store);
+ sw = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
+ gtk_container_add ((GtkContainer*) sw, (GtkWidget*) dwords_list);
+ gtk_scrolled_window_set_shadow_type (sw, GTK_SHADOW_ETCHED_IN);
+ g_object_set (sw, "hscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ g_object_set (sw, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ col = (memset (&_tmp4_, 0, sizeof (GdkColor)), _tmp4_);
+ col.red = (guint16) 0xFFFF;
+ col.green = (guint16) 0x0000;
+ col.blue = (guint16) 0x0000;
+ _tmp5_ = NULL;
+ self->priv->m_status_label = (_tmp5_ = g_object_ref_sink ((GtkLabel*) gtk_label_new (NULL)), (self->priv->m_status_label == NULL) ? NULL : (self->priv->m_status_label = (g_object_unref (self->priv->m_status_label), NULL)), _tmp5_);
+ loadbtn = g_object_ref_sink ((GtkButton*) gtk_button_new_with_label ("Load"));
+ loadalign = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new (0.5f, 0.5f, 1.0f, 1.0f));
+ loadbox = g_object_ref_sink ((GtkHButtonBox*) gtk_hbutton_box_new ());
+ gtk_widget_modify_fg ((GtkWidget*) self->priv->m_status_label, GTK_STATE_NORMAL, &col);
+ _tmp6_ = NULL;
+ gtk_button_set_image (loadbtn, (GtkWidget*) (_tmp6_ = g_object_ref_sink ((GtkImage*) gtk_image_new_from_stock ("gtk-convert", GTK_ICON_SIZE_BUTTON))));
+ (_tmp6_ == NULL) ? NULL : (_tmp6_ = (g_object_unref (_tmp6_), NULL));
+ g_signal_connect_object (loadbtn, "clicked", (GCallback) _gui_cs_import_load_cs_gtk_button_clicked, self, 0);
+ gtk_box_pack_end ((GtkBox*) loadbox, (GtkWidget*) loadbtn, FALSE, TRUE, (guint) 0);
+ g_object_set (loadalign, "right-padding", (guint) 3, NULL);
+ gtk_container_add ((GtkContainer*) loadalign, (GtkWidget*) loadbox);
+ bbox = g_object_ref_sink ((GtkHBox*) gtk_hbox_new (FALSE, 0));
+ gtk_box_pack_start ((GtkBox*) bbox, (GtkWidget*) self->priv->m_status_label, TRUE, TRUE, (guint) 0);
+ gtk_box_pack_start ((GtkBox*) bbox, (GtkWidget*) loadalign, FALSE, TRUE, (guint) 0);
+ dbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 4));
+ gtk_box_pack_start ((GtkBox*) dbox, (GtkWidget*) sw, TRUE, TRUE, (guint) 0);
+ gtk_box_pack_start ((GtkBox*) dbox, (GtkWidget*) bbox, FALSE, FALSE, (guint) 0);
+ dwordsalign = g_object_ref_sink ((GtkAlignment*) gtk_alignment_new (1.0f, 0.5f, 1.0f, 1.0f));
+ g_object_set (dwordsalign, "left-padding", (guint) 12, NULL);
+ g_object_set (dwordsalign, "bottom-padding", (guint) 3, NULL);
+ gtk_container_add ((GtkContainer*) dwordsalign, (GtkWidget*) dbox);
+ dwordsframe = g_object_ref_sink ((GtkFrame*) gtk_frame_new ("<b>DWORDs</b>"));
+ _tmp7_ = NULL;
+ gtk_label_set_use_markup ((_tmp7_ = gtk_frame_get_label_widget (dwordsframe), GTK_IS_LABEL (_tmp7_) ? ((GtkLabel*) _tmp7_) : NULL), TRUE);
+ g_object_set (dwordsframe, "shadow", GTK_SHADOW_NONE, NULL);
+ gtk_container_add ((GtkContainer*) dwordsframe, (GtkWidget*) dwordsalign);
+ gtk_box_pack_start ((GtkBox*) ((GtkDialog*) self)->vbox, (GtkWidget*) dwordsframe, TRUE, TRUE, (guint) 0);
+ gtk_window_set_transient_for ((GtkWindow*) self, (GtkWindow*) gui_main);
+ (dwords_list == NULL) ? NULL : (dwords_list = (g_object_unref (dwords_list), NULL));
+ (sw == NULL) ? NULL : (sw = (g_object_unref (sw), NULL));
+ (loadbtn == NULL) ? NULL : (loadbtn = (g_object_unref (loadbtn), NULL));
+ (loadalign == NULL) ? NULL : (loadalign = (g_object_unref (loadalign), NULL));
+ (loadbox == NULL) ? NULL : (loadbox = (g_object_unref (loadbox), NULL));
+ (bbox == NULL) ? NULL : (bbox = (g_object_unref (bbox), NULL));
+ (dbox == NULL) ? NULL : (dbox = (g_object_unref (dbox), NULL));
+ (dwordsalign == NULL) ? NULL : (dwordsalign = (g_object_unref (dwordsalign), NULL));
+ (dwordsframe == NULL) ? NULL : (dwordsframe = (g_object_unref (dwordsframe), NULL));
+}
+
+
+static void gui_cs_import_on_response (GUICSImport* self, GtkDialog* source, gint response_id) {
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (source != NULL);
+ switch (response_id) {
+ case GTK_RESPONSE_APPLY:
+ {
+ EmulationCS* _tmp0_;
+ _tmp0_ = NULL;
+ emulation_add_cs (gtk_entry_get_text (self->priv->m_name_entry), _tmp0_ = emulation_cs_new (&g_array_index (self->priv->m_dwords, guint32, (guint) 0), self->priv->m_dwords->len));
+ (_tmp0_ == NULL) ? NULL : (_tmp0_ = (g_object_unref (_tmp0_), NULL));
+ gtk_object_destroy ((GtkObject*) self);
+ break;
+ }
+ case GTK_RESPONSE_CLOSE:
+ {
+ gtk_object_destroy ((GtkObject*) self);
+ break;
+ }
+ }
+}
+
+
+static void gui_cs_import_load_cs (GUICSImport* self, GtkButton* source) {
+ GtkFileChooserDialog* fc;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (source != NULL);
+ fc = g_object_ref_sink ((GtkFileChooserDialog*) gtk_file_chooser_dialog_new ("Open File", (GtkWindow*) self, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL, NULL));
+ if (gtk_dialog_run ((GtkDialog*) fc) == GTK_RESPONSE_ACCEPT) {
+ char* _tmp0_;
+ _tmp0_ = NULL;
+ gui_cs_import_open_cs (self, _tmp0_ = gtk_file_chooser_get_filename ((GtkFileChooser*) fc));
+ _tmp0_ = (g_free (_tmp0_), NULL);
+ }
+ gtk_object_destroy ((GtkObject*) fc);
+ (fc == NULL) ? NULL : (fc = (g_object_unref (fc), NULL));
+}
+
+
+static void gui_cs_import_open_cs (GUICSImport* self, const char* filename) {
+ FILE* fs;
+ GtkTreeIter iter = {0};
+ guint32 dword;
+ guint dword_count;
+ char* pktname;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (filename != NULL);
+ fs = fopen (filename, "r");
+ if (fs == NULL) {
+ char* _tmp0_;
+ GtkMessageDialog* _tmp1_;
+ GtkMessageDialog* dlg;
+ _tmp0_ = NULL;
+ _tmp1_ = NULL;
+ dlg = (_tmp1_ = g_object_ref_sink ((GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _tmp0_ = g_strconcat ("Unable to open the selected file: ", filename, NULL), NULL)), _tmp0_ = (g_free (_tmp0_), NULL), _tmp1_);
+ gtk_dialog_run ((GtkDialog*) dlg);
+ gtk_object_destroy ((GtkObject*) dlg);
+ (dlg == NULL) ? NULL : (dlg = (g_object_unref (dlg), NULL));
+ (fs == NULL) ? NULL : (fs = (fclose (fs), NULL));
+ return;
+ }
+ gtk_list_store_clear (self->priv->m_dwords_store);
+ g_array_set_size (self->priv->m_dwords, (guint) 0);
+ dword = 0U;
+ dword_count = (guint) 0;
+ pktname = NULL;
+ {
+ guint id;
+ id = (guint) 0;
+ {
+ gboolean _tmp2_;
+ _tmp2_ = TRUE;
+ while (TRUE) {
+ char* _tmp3_;
+ if (!_tmp2_) {
+ id++;
+ }
+ _tmp2_ = FALSE;
+ if (!(fscanf (fs, "%x", &dword) == 1)) {
+ break;
+ }
+ gtk_list_store_append (self->priv->m_dwords_store, &iter);
+ _tmp3_ = NULL;
+ pktname = (_tmp3_ = NULL, pktname = (g_free (pktname), NULL), _tmp3_);
+ if (dword_count > 0) {
+ dword_count--;
+ } else {
+ EmulationPacketBase* p;
+ char* _tmp5_;
+ char* _tmp4_;
+ p = emulation_make_packet (dword, NULL);
+ dword_count = emulation_packet_base_get_length (p);
+ _tmp5_ = NULL;
+ _tmp4_ = NULL;
+ pktname = (_tmp5_ = g_strconcat ("packet", _tmp4_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)), NULL), pktname = (g_free (pktname), NULL), _tmp5_);
+ _tmp4_ = (g_free (_tmp4_), NULL);
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ }
+ gtk_list_store_set (self->priv->m_dwords_store, &iter, 0, id, 1, pktname, -1, -1);
+ g_array_append_val (self->priv->m_dwords, dword);
+ }
+ }
+ }
+ self->priv->m_validcs = dword_count == 0;
+ gui_cs_import_update_okbtn (self);
+ (fs == NULL) ? NULL : (fs = (fclose (fs), NULL));
+ pktname = (g_free (pktname), NULL);
+}
+
+
+static void gui_cs_import_update_okbtn (GUICSImport* self) {
+ g_return_if_fail (self != NULL);
+ if (self->priv->m_validcs) {
+ gboolean _tmp0_;
+ _tmp0_ = FALSE;
+ if (gtk_entry_get_text_length (self->priv->m_name_entry) > 0) {
+ _tmp0_ = self->priv->m_dwords->len > 0;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ g_object_set ((GtkWidget*) self->priv->m_okbtn, "sensitive", _tmp0_, NULL);
+ gtk_label_set_label (self->priv->m_status_label, "");
+ } else {
+ g_object_set ((GtkWidget*) self->priv->m_okbtn, "sensitive", FALSE, NULL);
+ gtk_label_set_label (self->priv->m_status_label, "This CS is invalid!");
+ }
+}
+
+
+GUICSImport* gui_cs_import_construct (GType object_type) {
+ GUICSImport * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+GUICSImport* gui_cs_import_new (void) {
+ return gui_cs_import_construct (GUI_TYPE_CS_IMPORT);
+}
+
+
+static void _gui_cs_import_update_okbtn_gtk_editable_changed (GtkEntry* _sender, gpointer self) {
+ gui_cs_import_update_okbtn (self);
+}
+
+
+static void _gui_cs_import_on_response_gtk_dialog_response (GtkDialog* _sender, gint response_id, gpointer self) {
+ gui_cs_import_on_response (self, _sender, response_id);
+}
+
+
+static GObject * gui_cs_import_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ GUICSImportClass * klass;
+ GObjectClass * parent_class;
+ GUICSImport * self;
+ klass = GUI_CS_IMPORT_CLASS (g_type_class_peek (GUI_TYPE_CS_IMPORT));
+ parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = GUI_CS_IMPORT (obj);
+ {
+ GtkButton* _tmp2_;
+ GtkButton* _tmp1_;
+ GtkWidget* _tmp0_;
+ GArray* _tmp3_;
+ gui_cs_import_create_name_frame (self);
+ gui_cs_import_create_dwords_frame (self);
+ gtk_dialog_add_button ((GtkDialog*) self, GTK_STOCK_CLOSE, (gint) GTK_RESPONSE_CLOSE);
+ _tmp2_ = NULL;
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->m_okbtn = (_tmp2_ = (_tmp1_ = (_tmp0_ = gtk_dialog_add_button ((GtkDialog*) self, GTK_STOCK_OK, (gint) GTK_RESPONSE_APPLY), GTK_IS_BUTTON (_tmp0_) ? ((GtkButton*) _tmp0_) : NULL), (_tmp1_ == NULL) ? NULL : g_object_ref (_tmp1_)), (self->priv->m_okbtn == NULL) ? NULL : (self->priv->m_okbtn = (g_object_unref (self->priv->m_okbtn), NULL)), _tmp2_);
+ g_object_set ((GtkWidget*) self->priv->m_okbtn, "sensitive", FALSE, NULL);
+ self->priv->m_validcs = FALSE;
+ _tmp3_ = NULL;
+ self->priv->m_dwords = (_tmp3_ = g_array_new (FALSE, FALSE, (guint) sizeof (guint32)), (self->priv->m_dwords == NULL) ? NULL : (self->priv->m_dwords = (g_array_free (self->priv->m_dwords, TRUE), NULL)), _tmp3_);
+ g_signal_connect_object ((GtkEditable*) self->priv->m_name_entry, "changed", (GCallback) _gui_cs_import_update_okbtn_gtk_editable_changed, self, 0);
+ gtk_window_set_title ((GtkWindow*) self, "Import CS");
+ g_signal_connect_object ((GtkDialog*) self, "response", (GCallback) _gui_cs_import_on_response_gtk_dialog_response, self, 0);
+ gtk_window_set_default_size ((GtkWindow*) self, 300, 400);
+ gtk_widget_show_all ((GtkWidget*) self);
+ }
+ return obj;
+}
+
+
+static void gui_cs_import_class_init (GUICSImportClass * klass) {
+ gui_cs_import_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (GUICSImportPrivate));
+ G_OBJECT_CLASS (klass)->constructor = gui_cs_import_constructor;
+ G_OBJECT_CLASS (klass)->finalize = gui_cs_import_finalize;
+}
+
+
+static void gui_cs_import_instance_init (GUICSImport * self) {
+ self->priv = GUI_CS_IMPORT_GET_PRIVATE (self);
+}
+
+
+static void gui_cs_import_finalize (GObject* obj) {
+ GUICSImport * self;
+ self = GUI_CS_IMPORT (obj);
+ (self->priv->m_name_entry == NULL) ? NULL : (self->priv->m_name_entry = (g_object_unref (self->priv->m_name_entry), NULL));
+ (self->priv->m_status_label == NULL) ? NULL : (self->priv->m_status_label = (g_object_unref (self->priv->m_status_label), NULL));
+ (self->priv->m_dwords_store == NULL) ? NULL : (self->priv->m_dwords_store = (g_object_unref (self->priv->m_dwords_store), NULL));
+ (self->priv->m_okbtn == NULL) ? NULL : (self->priv->m_okbtn = (g_object_unref (self->priv->m_okbtn), NULL));
+ (self->priv->m_dwords == NULL) ? NULL : (self->priv->m_dwords = (g_array_free (self->priv->m_dwords, TRUE), NULL));
+ G_OBJECT_CLASS (gui_cs_import_parent_class)->finalize (obj);
+}
+
+
+GType gui_cs_import_get_type (void) {
+ static GType gui_cs_import_type_id = 0;
+ if (gui_cs_import_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (GUICSImportClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cs_import_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICSImport), 0, (GInstanceInitFunc) gui_cs_import_instance_init, NULL };
+ gui_cs_import_type_id = g_type_register_static (GTK_TYPE_DIALOG, "GUICSImport", &g_define_type_info, 0);
+ }
+ return gui_cs_import_type_id;
+}
+
+
+
+
diff --git a/src/csimport.vala b/src/csimport.vala
new file mode 100644
index 0000000..5743db4
--- /dev/null
+++ b/src/csimport.vala
@@ -0,0 +1,187 @@
+using Gtk;
+
+namespace Emulation
+{
+ public void add_cs(string name, CS cs)
+ {
+ TreeIter iter;
+ GUI.main.cs_store.append(out iter);
+ GUI.main.cs_store.set(iter, 0, name, 1, cs, -1);
+ }
+}
+
+namespace GUI
+{
+ class CSImport : Dialog
+ {
+ private Entry m_name_entry;
+ private Label m_status_label;
+ private ListStore m_dwords_store;
+ private Button m_okbtn;
+ private Array<uint32> m_dwords;
+ private bool m_validcs;
+
+ private void dword_cellrenderer(TreeViewColumn tree_column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ uint32 id = 0;
+ model.get(iter, 0, &id, -1);
+ assert(id < m_dwords.length);
+ (cell as CellRendererText).text = m_dwords.index(id).to_string("0x%08X");
+ }
+
+ private inline void create_name_frame()
+ {
+ var namealign = new Alignment(1.0f, 0.5f, 1.0f, 1.0f);
+ namealign.left_padding = 12;
+ namealign.bottom_padding = 4;
+ namealign.add(m_name_entry = new Entry());
+
+ var nameframe = new Frame("<b>Name</b>");
+ (nameframe.label_widget as Label).use_markup = true;
+ nameframe.shadow = ShadowType.NONE;
+ nameframe.add(namealign);
+
+ this.vbox.pack_start(nameframe, false, true, 0);
+ }
+
+ private inline void create_dwords_frame()
+ {
+ m_dwords_store = new ListStore(2, typeof(uint32), typeof(string));
+ var dwords_list = new TreeView();
+ dwords_list.insert_column_with_attributes(-1, "#", new CellRendererText(), "text", 0, null);
+ dwords_list.insert_column_with_data_func(-1, "Value", new CellRendererText(), dword_cellrenderer);
+ dwords_list.insert_column_with_attributes(-1, "Meta", new CellRendererText(), "text", 1, null);
+ dwords_list.border_width = 5;
+ dwords_list.set_model(m_dwords_store);
+ var sw = new ScrolledWindow(null, null);
+ sw.add(dwords_list);
+ sw.shadow_type = ShadowType.ETCHED_IN;
+ sw.hscrollbar_policy = PolicyType.AUTOMATIC;
+ sw.vscrollbar_policy = PolicyType.AUTOMATIC;
+
+ Gdk.Color col = Gdk.Color();
+ col.red = 0xFFFF; col.green = 0x0000; col.blue = 0x0000;
+
+ m_status_label = new Label(null);
+ var loadbtn = new Button.with_label("Load");
+ var loadalign = new Alignment(0.5f, 0.5f, 1.0f, 1.0f);
+ var loadbox = new HButtonBox();
+ m_status_label.modify_fg(StateType.NORMAL, col);
+ loadbtn.image = new Image.from_stock("gtk-convert", IconSize.BUTTON);
+ loadbtn.clicked += load_cs;
+ loadbox.pack_end(loadbtn, false, true, 0);
+ loadalign.right_padding = 3;
+ loadalign.add(loadbox);
+
+ var bbox = new HBox(false, 0);
+ bbox.pack_start(m_status_label, true, true, 0);
+ bbox.pack_start(loadalign, false, true, 0);
+
+ var dbox = new VBox(false, 4);
+ dbox.pack_start(sw, true, true, 0);
+ dbox.pack_start(bbox, false, false, 0);
+
+ var dwordsalign = new Alignment(1.0f, 0.5f, 1.0f, 1.0f);
+ dwordsalign.left_padding = 12;
+ dwordsalign.bottom_padding = 3;
+ dwordsalign.add(dbox);
+
+ var dwordsframe = new Frame("<b>DWORDs</b>");
+ (dwordsframe.label_widget as Label).use_markup = true;
+ dwordsframe.shadow = ShadowType.NONE;
+ dwordsframe.add(dwordsalign);
+
+ vbox.pack_start(dwordsframe, true, true, 0);
+ set_transient_for(main);
+ }
+
+ construct {
+ create_name_frame();
+ create_dwords_frame();
+
+ add_button(STOCK_CLOSE, ResponseType.CLOSE);
+ m_okbtn = add_button(STOCK_OK, ResponseType.APPLY) as Button;
+ m_okbtn.sensitive = false;
+
+ m_validcs = false;
+ m_dwords = new Array<uint32>(false, false, (uint)sizeof(uint32));
+ m_name_entry.changed += update_okbtn;
+
+ title = "Import CS";
+ response.connect(on_response);
+ set_default_size(300, 400);
+ show_all();
+ }
+
+ private void on_response(Dialog source, int response_id)
+ {
+ switch (response_id) {
+ case ResponseType.APPLY:
+ Emulation.add_cs(m_name_entry.text, new Emulation.CS(&m_dwords.index(0), m_dwords.length));
+ destroy();
+ break;
+
+ case ResponseType.CLOSE:
+ destroy();
+ break;
+ }
+ }
+
+ private void load_cs(Button source)
+ {
+ var fc = new FileChooserDialog("Open File", this,
+ FileChooserAction.OPEN,
+ STOCK_CANCEL, ResponseType.CANCEL,
+ STOCK_OPEN, ResponseType.ACCEPT, null);
+
+ if (fc.run() == ResponseType.ACCEPT) { open_cs(fc.get_filename()); }
+ fc.destroy();
+ }
+
+ private void open_cs(string filename)
+ {
+ FileStream fs = FileStream.open(filename, "r");
+ if (fs == null) {
+ var dlg = new MessageDialog(this, DialogFlags.MODAL, MessageType.ERROR, ButtonsType.OK, "Unable to open the selected file: " + filename);
+ dlg.run();
+ dlg.destroy();
+ return;
+ }
+
+ m_dwords_store.clear();
+ m_dwords.set_size(0);
+ TreeIter iter;
+
+ uint32 dword;
+ uint dword_count = 0;
+ string pktname;
+ for (uint id = 0; fs.scanf("%x", out dword) == 1; id++) {
+ m_dwords_store.append(out iter);
+ pktname = null;
+ if (dword_count > 0) {
+ dword_count--;
+ } else {
+ Emulation.PacketBase p = Emulation.make_packet(dword);
+ dword_count = p.length;
+ pktname = "packet" + p.type_id.to_string();
+ }
+ m_dwords_store.set(iter, 0, id, 1, pktname, -1);
+ m_dwords.append_val(dword);
+ }
+
+ m_validcs = (dword_count == 0);
+ update_okbtn();
+ }
+
+ private void update_okbtn()
+ {
+ if (m_validcs) {
+ m_okbtn.sensitive = (m_name_entry.text_length > 0 && m_dwords.length > 0);
+ m_status_label.label = "";
+ } else {
+ m_okbtn.sensitive = false;
+ m_status_label.label = "This CS is invalid!";
+ }
+ }
+ }
+}
diff --git a/src/csview.c b/src/csview.c
new file mode 100644
index 0000000..9412a32
--- /dev/null
+++ b/src/csview.c
@@ -0,0 +1,1755 @@
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define GUI_TYPE_CS_LIST_MODEL (gui_cs_list_model_get_type ())
+#define GUI_CS_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_LIST_MODEL, GUICSListModel))
+#define GUI_CS_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_LIST_MODEL, GUICSListModelClass))
+#define GUI_IS_CS_LIST_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_LIST_MODEL))
+#define GUI_IS_CS_LIST_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_LIST_MODEL))
+#define GUI_CS_LIST_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_LIST_MODEL, GUICSListModelClass))
+
+typedef struct _GUICSListModel GUICSListModel;
+typedef struct _GUICSListModelClass GUICSListModelClass;
+typedef struct _GUICSListModelPrivate GUICSListModelPrivate;
+
+#define EMULATION_TYPE_CS (emulation_cs_get_type ())
+#define EMULATION_CS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_CS, EmulationCS))
+#define EMULATION_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_CS, EmulationCSClass))
+#define EMULATION_IS_CS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_CS))
+#define EMULATION_IS_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_CS))
+#define EMULATION_CS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_CS, EmulationCSClass))
+
+typedef struct _EmulationCS EmulationCS;
+typedef struct _EmulationCSClass EmulationCSClass;
+
+#define EMULATION_TYPE_SPEC (emulation_spec_get_type ())
+#define EMULATION_SPEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_SPEC, EmulationSpec))
+#define EMULATION_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_SPEC, EmulationSpecClass))
+#define EMULATION_IS_SPEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_SPEC))
+#define EMULATION_IS_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_SPEC))
+#define EMULATION_SPEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_SPEC, EmulationSpecClass))
+
+typedef struct _EmulationSpec EmulationSpec;
+typedef struct _EmulationSpecClass EmulationSpecClass;
+
+#define GUI_CS_LIST_MODEL_TYPE_COLUMNS (gui_cs_list_model_columns_get_type ())
+
+#define GUI_CS_LIST_MODEL_TYPE_ROW_TYPE (gui_cs_list_model_row_type_get_type ())
+typedef struct _EmulationCSPrivate EmulationCSPrivate;
+
+#define EMULATION_TYPE_PACKET_BASE (emulation_packet_base_get_type ())
+#define EMULATION_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBase))
+#define EMULATION_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+#define EMULATION_IS_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_IS_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_PACKET_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+
+typedef struct _EmulationPacketBase EmulationPacketBase;
+typedef struct _EmulationPacketBaseClass EmulationPacketBaseClass;
+typedef struct _EmulationPacketBasePrivate EmulationPacketBasePrivate;
+
+#define EMULATION_TYPE_PACKET0 (emulation_packet0_get_type ())
+#define EMULATION_PACKET0(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET0, EmulationPacket0))
+#define EMULATION_PACKET0_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET0, EmulationPacket0Class))
+#define EMULATION_IS_PACKET0(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET0))
+#define EMULATION_IS_PACKET0_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET0))
+#define EMULATION_PACKET0_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET0, EmulationPacket0Class))
+
+typedef struct _EmulationPacket0 EmulationPacket0;
+typedef struct _EmulationPacket0Class EmulationPacket0Class;
+
+#define EMULATION_TYPE_PACKET1 (emulation_packet1_get_type ())
+#define EMULATION_PACKET1(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET1, EmulationPacket1))
+#define EMULATION_PACKET1_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET1, EmulationPacket1Class))
+#define EMULATION_IS_PACKET1(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET1))
+#define EMULATION_IS_PACKET1_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET1))
+#define EMULATION_PACKET1_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET1, EmulationPacket1Class))
+
+typedef struct _EmulationPacket1 EmulationPacket1;
+typedef struct _EmulationPacket1Class EmulationPacket1Class;
+
+#define EMULATION_TYPE_PACKET3 (emulation_packet3_get_type ())
+#define EMULATION_PACKET3(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET3, EmulationPacket3))
+#define EMULATION_PACKET3_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET3, EmulationPacket3Class))
+#define EMULATION_IS_PACKET3(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET3))
+#define EMULATION_IS_PACKET3_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET3))
+#define EMULATION_PACKET3_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET3, EmulationPacket3Class))
+
+typedef struct _EmulationPacket3 EmulationPacket3;
+typedef struct _EmulationPacket3Class EmulationPacket3Class;
+
+#define EMULATION_TYPE_REGISTER_LIST (emulation_register_list_get_type ())
+#define EMULATION_REGISTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterList))
+#define EMULATION_REGISTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListClass))
+#define EMULATION_IS_REGISTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_LIST))
+#define EMULATION_IS_REGISTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_LIST))
+#define EMULATION_REGISTER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListClass))
+
+typedef struct _EmulationRegisterList EmulationRegisterList;
+typedef struct _EmulationRegisterListClass EmulationRegisterListClass;
+
+#define EMULATION_TYPE_REGISTER (emulation_register_get_type ())
+#define EMULATION_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER, EmulationRegister))
+#define EMULATION_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER, EmulationRegisterClass))
+#define EMULATION_IS_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER))
+#define EMULATION_IS_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER))
+#define EMULATION_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER, EmulationRegisterClass))
+
+typedef struct _EmulationRegister EmulationRegister;
+typedef struct _EmulationRegisterClass EmulationRegisterClass;
+
+#define EMULATION_TYPE_REGISTER_INFO (emulation_register_info_get_type ())
+#define EMULATION_REGISTER_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfo))
+#define EMULATION_REGISTER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoClass))
+#define EMULATION_IS_REGISTER_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_INFO))
+#define EMULATION_IS_REGISTER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_INFO))
+#define EMULATION_REGISTER_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoClass))
+
+typedef struct _EmulationRegisterInfo EmulationRegisterInfo;
+typedef struct _EmulationRegisterInfoClass EmulationRegisterInfoClass;
+
+#define GUI_TYPE_CS_VIEW (gui_cs_view_get_type ())
+#define GUI_CS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_VIEW, GUICSView))
+#define GUI_CS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_VIEW, GUICSViewClass))
+#define GUI_IS_CS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_VIEW))
+#define GUI_IS_CS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_VIEW))
+#define GUI_CS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_VIEW, GUICSViewClass))
+
+typedef struct _GUICSView GUICSView;
+typedef struct _GUICSViewClass GUICSViewClass;
+typedef struct _GUICSViewPrivate GUICSViewPrivate;
+
+struct _GUICSListModel {
+ GObject parent_instance;
+ GUICSListModelPrivate * priv;
+};
+
+struct _GUICSListModelClass {
+ GObjectClass parent_class;
+};
+
+struct _GUICSListModelPrivate {
+ EmulationCS* m_cs;
+ EmulationSpec* m_spec;
+ gint m_stamp;
+};
+
+typedef enum {
+ GUI_CS_LIST_MODEL_COLUMNS_NAME = 0,
+ GUI_CS_LIST_MODEL_COLUMNS_VALUE,
+ GUI_CS_LIST_MODEL_COLUMNS_TARGET,
+ GUI_CS_LIST_MODEL_COLUMNS_COUNT
+} GUICSListModelColumns;
+
+typedef enum {
+ GUI_CS_LIST_MODEL_ROW_TYPE_PACKET = 0,
+ GUI_CS_LIST_MODEL_ROW_TYPE_HEADER,
+ GUI_CS_LIST_MODEL_ROW_TYPE_DWORD,
+ GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD,
+ GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD
+} GUICSListModelRowType;
+
+struct _EmulationCS {
+ GObject parent_instance;
+ EmulationCSPrivate * priv;
+ EmulationPacketBase** packets;
+ gint packets_length1;
+ guint32* dwords;
+ gint dwords_length1;
+};
+
+struct _EmulationCSClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationPacketBase {
+ GObject parent_instance;
+ EmulationPacketBasePrivate * priv;
+ guint32* dwords;
+ guint32 header;
+};
+
+struct _EmulationPacketBaseClass {
+ GObjectClass parent_class;
+ guint (*get_length) (EmulationPacketBase* self);
+};
+
+struct _GUICSView {
+ GtkWindow parent_instance;
+ GUICSViewPrivate * priv;
+};
+
+struct _GUICSViewClass {
+ GtkWindowClass parent_class;
+};
+
+struct _GUICSViewPrivate {
+ GtkButton* m_pkgup;
+ GtkButton* m_pkgdown;
+ GUICSListModel* m_pkg_store;
+ GtkListStore* m_reg_store;
+ GtkListStore* m_raw_store;
+ guint m_pos;
+};
+
+
+static char** gui_cs_list_model_packet_strings;
+static gint gui_cs_list_model_packet_strings_length1;
+static char** gui_cs_list_model_packet_strings = NULL;
+static gint gui_cs_list_model_packet_strings_length1 = 0;
+static gint gui_cs_list_model_packet_strings_size = 0;
+static char** gui_cs_list_model_packet0_headers;
+static gint gui_cs_list_model_packet0_headers_length1;
+static char** gui_cs_list_model_packet0_headers = NULL;
+static gint gui_cs_list_model_packet0_headers_length1 = 0;
+static gint gui_cs_list_model_packet0_headers_size = 0;
+static char** gui_cs_list_model_packet1_headers;
+static gint gui_cs_list_model_packet1_headers_length1;
+static char** gui_cs_list_model_packet1_headers = NULL;
+static gint gui_cs_list_model_packet1_headers_length1 = 0;
+static gint gui_cs_list_model_packet1_headers_size = 0;
+static char** gui_cs_list_model_packet2_headers;
+static gint gui_cs_list_model_packet2_headers_length1;
+static char** gui_cs_list_model_packet2_headers = NULL;
+static gint gui_cs_list_model_packet2_headers_length1 = 0;
+static gint gui_cs_list_model_packet2_headers_size = 0;
+static char** gui_cs_list_model_packet3_headers;
+static gint gui_cs_list_model_packet3_headers_length1;
+static char** gui_cs_list_model_packet3_headers = NULL;
+static gint gui_cs_list_model_packet3_headers_length1 = 0;
+static gint gui_cs_list_model_packet3_headers_size = 0;
+static char*** gui_cs_list_model_packet_headers;
+static gint gui_cs_list_model_packet_headers_length1;
+static char*** gui_cs_list_model_packet_headers = NULL;
+static gint gui_cs_list_model_packet_headers_length1 = 0;
+static gint gui_cs_list_model_packet_headers_size = 0;
+static guint* gui_cs_list_model_packet_headers_length;
+static gint gui_cs_list_model_packet_headers_length_length1;
+static guint* gui_cs_list_model_packet_headers_length = NULL;
+static gint gui_cs_list_model_packet_headers_length_length1 = 0;
+static gint gui_cs_list_model_packet_headers_length_size = 0;
+static gpointer gui_cs_list_model_parent_class = NULL;
+static GtkTreeModelIface* gui_cs_list_model_gtk_tree_model_parent_iface = NULL;
+static gpointer gui_cs_view_parent_class = NULL;
+
+GType gui_cs_list_model_get_type (void);
+GType emulation_cs_get_type (void);
+GType emulation_spec_get_type (void);
+#define GUI_CS_LIST_MODEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUI_TYPE_CS_LIST_MODEL, GUICSListModelPrivate))
+enum {
+ GUI_CS_LIST_MODEL_DUMMY_PROPERTY
+};
+GType gui_cs_list_model_columns_get_type (void);
+GType gui_cs_list_model_row_type_get_type (void);
+static char** _vala_array_dup3 (char** self, int length);
+static char** _vala_array_dup4 (char** self, int length);
+static char** _vala_array_dup5 (char** self, int length);
+static char** _vala_array_dup6 (char** self, int length);
+guint gui_cs_list_model_get_packet_num (GUICSListModel* self, GtkTreeIter* iter);
+static inline guint gui_cs_list_model_get_dword_num (GUICSListModel* self, GtkTreeIter* iter);
+static inline guint gui_cs_list_model_get_bitfield_num (GUICSListModel* self, GtkTreeIter* iter);
+static inline void gui_cs_list_model_set_packet_num (GUICSListModel* self, GtkTreeIter* iter, guint n);
+static inline void gui_cs_list_model_set_dword_num (GUICSListModel* self, GtkTreeIter* iter, guint n);
+static inline void gui_cs_list_model_set_bitfield_num (GUICSListModel* self, GtkTreeIter* iter, guint n);
+static inline gboolean gui_cs_list_model_is_header (GUICSListModel* self, GtkTreeIter* iter);
+static inline gboolean gui_cs_list_model_has_dwords (GUICSListModel* self, GtkTreeIter* iter);
+static inline gboolean gui_cs_list_model_has_bitfields (GUICSListModel* self, GtkTreeIter* iter);
+static inline guint gui_cs_list_model_dword_index (GUICSListModel* self, GtkTreeIter* iter);
+static inline guint gui_cs_list_model_bitfield_index (GUICSListModel* self, GtkTreeIter* iter);
+static inline void gui_cs_list_model_set_iter (GUICSListModel* self, GtkTreeIter* iter, guint p, guint d, guint b, gboolean stamp);
+GUICSListModel* gui_cs_list_model_new (EmulationCS* cs, EmulationSpec* spec);
+GUICSListModel* gui_cs_list_model_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec);
+GUICSListModelRowType gui_cs_list_model_get_row_type (GUICSListModel* self, GtkTreeIter* iter);
+static GtkTreeModelFlags gui_cs_list_model_real_get_flags (GtkTreeModel* base);
+static gint gui_cs_list_model_real_get_n_columns (GtkTreeModel* base);
+static GType gui_cs_list_model_real_get_column_type (GtkTreeModel* base, gint i);
+GType emulation_packet_base_get_type (void);
+guint emulation_packet_base_get_length (EmulationPacketBase* self);
+guint emulation_packet_base_get_type_id (EmulationPacketBase* self);
+static gboolean gui_cs_list_model_real_get_iter (GtkTreeModel* base, GtkTreeIter* iter, const GtkTreePath* path);
+static GtkTreePath* gui_cs_list_model_real_get_path (GtkTreeModel* base, GtkTreeIter* iter);
+guint32 emulation_packet_base_get (EmulationPacketBase* self, guint index);
+GType emulation_packet0_get_type (void);
+guint32 emulation_packet0_get__ADDR (EmulationPacket0* self);
+guint32 emulation_packet0_get__ONE_REG_WR (EmulationPacket0* self);
+guint32 emulation_packet0_get__COUNT (EmulationPacket0* self);
+GType emulation_packet1_get_type (void);
+guint32 emulation_packet1_get__ADDR1 (EmulationPacket1* self);
+guint32 emulation_packet1_get__ADDR2 (EmulationPacket1* self);
+GType emulation_packet3_get_type (void);
+guint32 emulation_packet3_get__IT_OPCODE (EmulationPacket3* self);
+guint32 emulation_packet3_get__COUNT (EmulationPacket3* self);
+guint32 gui_cs_list_model_get_numeric_value (GUICSListModel* self, GtkTreeIter* iter);
+GType emulation_register_list_get_type (void);
+EmulationRegisterList* emulation_spec_translate_addr (EmulationSpec* self, guint addr);
+GType emulation_register_get_type (void);
+EmulationRegister* emulation_register_list_get (EmulationRegisterList* self, guint index);
+GType emulation_register_info_get_type (void);
+EmulationRegisterInfo* emulation_register_get_info (EmulationRegister* self);
+const char* emulation_register_info_get_name (EmulationRegisterInfo* self);
+static char* gui_cs_list_model_translate_addr (GUICSListModel* self, guint32 addr);
+guint32 emulation_packet0_get_addr (EmulationPacket0* self);
+guint32 emulation_packet1_get_addr1 (EmulationPacket1* self);
+guint32 emulation_packet1_get_addr2 (EmulationPacket1* self);
+gboolean emulation_packet0_get_one_reg_wr (EmulationPacket0* self);
+static void gui_cs_list_model_real_get_value (GtkTreeModel* base, GtkTreeIter* iter, gint column, GValue* val);
+static gboolean gui_cs_list_model_real_iter_next (GtkTreeModel* base, GtkTreeIter* iter);
+static gboolean gui_cs_list_model_real_iter_children (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent);
+static gboolean gui_cs_list_model_real_iter_has_child (GtkTreeModel* base, GtkTreeIter* iter);
+static gint gui_cs_list_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter);
+static gboolean gui_cs_list_model_real_iter_nth_child (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent, gint n);
+static gboolean gui_cs_list_model_real_iter_parent (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* child);
+static void gui_cs_list_model_real_ref_node (GtkTreeModel* base, GtkTreeIter* iter);
+static void gui_cs_list_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter);
+static void gui_cs_list_model_finalize (GObject* obj);
+GType gui_cs_view_get_type (void);
+#define GUI_CS_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GUI_TYPE_CS_VIEW, GUICSViewPrivate))
+enum {
+ GUI_CS_VIEW_DUMMY_PROPERTY
+};
+static void gui_cs_view_current_dword_renderer (GUICSView* self, GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
+static void _gui_cs_view_current_dword_renderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
+GUICSView* gui_cs_view_new (EmulationCS* cs, EmulationSpec* spec);
+GUICSView* gui_cs_view_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec);
+static void gui_cs_view_finalize (GObject* obj);
+
+
+
+
+GType gui_cs_list_model_columns_get_type (void) {
+ static GType gui_cs_list_model_columns_type_id = 0;
+ if (G_UNLIKELY (gui_cs_list_model_columns_type_id == 0)) {
+ static const GEnumValue values[] = {{GUI_CS_LIST_MODEL_COLUMNS_NAME, "GUI_CS_LIST_MODEL_COLUMNS_NAME", "name"}, {GUI_CS_LIST_MODEL_COLUMNS_VALUE, "GUI_CS_LIST_MODEL_COLUMNS_VALUE", "value"}, {GUI_CS_LIST_MODEL_COLUMNS_TARGET, "GUI_CS_LIST_MODEL_COLUMNS_TARGET", "target"}, {GUI_CS_LIST_MODEL_COLUMNS_COUNT, "GUI_CS_LIST_MODEL_COLUMNS_COUNT", "count"}, {0, NULL, NULL}};
+ gui_cs_list_model_columns_type_id = g_enum_register_static ("GUICSListModelColumns", values);
+ }
+ return gui_cs_list_model_columns_type_id;
+}
+
+
+
+GType gui_cs_list_model_row_type_get_type (void) {
+ static GType gui_cs_list_model_row_type_type_id = 0;
+ if (G_UNLIKELY (gui_cs_list_model_row_type_type_id == 0)) {
+ static const GEnumValue values[] = {{GUI_CS_LIST_MODEL_ROW_TYPE_PACKET, "GUI_CS_LIST_MODEL_ROW_TYPE_PACKET", "packet"}, {GUI_CS_LIST_MODEL_ROW_TYPE_HEADER, "GUI_CS_LIST_MODEL_ROW_TYPE_HEADER", "header"}, {GUI_CS_LIST_MODEL_ROW_TYPE_DWORD, "GUI_CS_LIST_MODEL_ROW_TYPE_DWORD", "dword"}, {GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD, "GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD", "bitfield"}, {GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD, "GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD", "header-bitfield"}, {0, NULL, NULL}};
+ gui_cs_list_model_row_type_type_id = g_enum_register_static ("GUICSListModelRowType", values);
+ }
+ return gui_cs_list_model_row_type_type_id;
+}
+
+
+static char** _vala_array_dup3 (char** self, int length) {
+ char** result;
+ int i;
+ const char* _tmp5_;
+ result = g_new0 (char*, length);
+ for (i = 0; i < length; i++) {
+ result[i] = (_tmp5_ = self[i], (_tmp5_ == NULL) ? NULL : g_strdup (_tmp5_));
+ }
+ return result;
+}
+
+
+static char** _vala_array_dup4 (char** self, int length) {
+ char** result;
+ int i;
+ const char* _tmp7_;
+ char** _tmp6_;
+ const char* _tmp5_;
+ result = g_new0 (char*, length);
+ for (i = 0; i < length; i++) {
+ result[i] = (_tmp7_ = self[i], (_tmp7_ == NULL) ? NULL : g_strdup (_tmp7_));
+ }
+ return result;
+}
+
+
+static char** _vala_array_dup5 (char** self, int length) {
+ char** result;
+ int i;
+ const char* _tmp9_;
+ char** _tmp8_;
+ const char* _tmp7_;
+ char** _tmp6_;
+ const char* _tmp5_;
+ result = g_new0 (char*, length);
+ for (i = 0; i < length; i++) {
+ result[i] = (_tmp9_ = self[i], (_tmp9_ == NULL) ? NULL : g_strdup (_tmp9_));
+ }
+ return result;
+}
+
+
+static char** _vala_array_dup6 (char** self, int length) {
+ char** result;
+ int i;
+ const char* _tmp11_;
+ char** _tmp10_;
+ const char* _tmp9_;
+ char** _tmp8_;
+ const char* _tmp7_;
+ char** _tmp6_;
+ const char* _tmp5_;
+ result = g_new0 (char*, length);
+ for (i = 0; i < length; i++) {
+ result[i] = (_tmp11_ = self[i], (_tmp11_ == NULL) ? NULL : g_strdup (_tmp11_));
+ }
+ return result;
+}
+
+
+inline guint gui_cs_list_model_get_packet_num (GUICSListModel* self, GtkTreeIter* iter) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = *((guint*) (&(*iter).user_data));
+ return result;
+}
+
+
+static inline guint gui_cs_list_model_get_dword_num (GUICSListModel* self, GtkTreeIter* iter) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = *((guint*) (&(*iter).user_data2));
+ return result;
+}
+
+
+static inline guint gui_cs_list_model_get_bitfield_num (GUICSListModel* self, GtkTreeIter* iter) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = *((guint*) (&(*iter).user_data3));
+ return result;
+}
+
+
+static inline void gui_cs_list_model_set_packet_num (GUICSListModel* self, GtkTreeIter* iter, guint n) {
+ g_return_if_fail (self != NULL);
+ (*iter).user_data = *((void**) (&n));
+}
+
+
+static inline void gui_cs_list_model_set_dword_num (GUICSListModel* self, GtkTreeIter* iter, guint n) {
+ g_return_if_fail (self != NULL);
+ (*iter).user_data2 = *((void**) (&n));
+}
+
+
+static inline void gui_cs_list_model_set_bitfield_num (GUICSListModel* self, GtkTreeIter* iter, guint n) {
+ g_return_if_fail (self != NULL);
+ (*iter).user_data3 = *((void**) (&n));
+}
+
+
+/* for dwords, 0 means no dwords, 1 means just the header, and 2+ means header and packets
+ for bitfields, 0 means no bitfields, 1+ means bitfields */
+static inline gboolean gui_cs_list_model_is_header (GUICSListModel* self, GtkTreeIter* iter) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = gui_cs_list_model_get_dword_num (self, &(*iter)) == 1;
+ return result;
+}
+
+
+static inline gboolean gui_cs_list_model_has_dwords (GUICSListModel* self, GtkTreeIter* iter) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = gui_cs_list_model_get_dword_num (self, &(*iter)) >= 1;
+ return result;
+}
+
+
+static inline gboolean gui_cs_list_model_has_bitfields (GUICSListModel* self, GtkTreeIter* iter) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = gui_cs_list_model_get_bitfield_num (self, &(*iter)) >= 1;
+ return result;
+}
+
+
+static inline guint gui_cs_list_model_dword_index (GUICSListModel* self, GtkTreeIter* iter) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = gui_cs_list_model_get_dword_num (self, &(*iter)) - 2;
+ return result;
+}
+
+
+static inline guint gui_cs_list_model_bitfield_index (GUICSListModel* self, GtkTreeIter* iter) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = gui_cs_list_model_get_bitfield_num (self, &(*iter)) - 1;
+ return result;
+}
+
+
+static inline void gui_cs_list_model_set_iter (GUICSListModel* self, GtkTreeIter* iter, guint p, guint d, guint b, gboolean stamp) {
+ gint _tmp0_;
+ g_return_if_fail (self != NULL);
+ gui_cs_list_model_set_packet_num (self, &(*iter), p);
+ gui_cs_list_model_set_dword_num (self, &(*iter), d);
+ gui_cs_list_model_set_bitfield_num (self, &(*iter), b);
+ _tmp0_ = 0;
+ if (stamp) {
+ _tmp0_ = self->priv->m_stamp;
+ } else {
+ _tmp0_ = 0;
+ }
+ (*iter).stamp = _tmp0_;
+}
+
+
+GUICSListModel* gui_cs_list_model_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec) {
+ GUICSListModel * self;
+ EmulationCS* _tmp1_;
+ EmulationCS* _tmp0_;
+ EmulationSpec* _tmp3_;
+ EmulationSpec* _tmp2_;
+ g_return_val_if_fail (cs != NULL, NULL);
+ g_return_val_if_fail (spec != NULL, NULL);
+ self = g_object_newv (object_type, 0, NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->m_cs = (_tmp1_ = (_tmp0_ = cs, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (self->priv->m_cs == NULL) ? NULL : (self->priv->m_cs = (g_object_unref (self->priv->m_cs), NULL)), _tmp1_);
+ _tmp3_ = NULL;
+ _tmp2_ = NULL;
+ self->priv->m_spec = (_tmp3_ = (_tmp2_ = spec, (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_)), (self->priv->m_spec == NULL) ? NULL : (self->priv->m_spec = (g_object_unref (self->priv->m_spec), NULL)), _tmp3_);
+ self->priv->m_stamp = 19449216;
+ return self;
+}
+
+
+GUICSListModel* gui_cs_list_model_new (EmulationCS* cs, EmulationSpec* spec) {
+ return gui_cs_list_model_construct (GUI_TYPE_CS_LIST_MODEL, cs, spec);
+}
+
+
+GUICSListModelRowType gui_cs_list_model_get_row_type (GUICSListModel* self, GtkTreeIter* iter) {
+ GUICSListModelRowType result;
+ g_return_val_if_fail (self != NULL, 0);
+ if (gui_cs_list_model_has_bitfields (self, &(*iter))) {
+ GUICSListModelRowType _tmp0_;
+ _tmp0_ = 0;
+ if (gui_cs_list_model_is_header (self, &(*iter))) {
+ _tmp0_ = GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD;
+ } else {
+ _tmp0_ = GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD;
+ }
+ result = _tmp0_;
+ return result;
+ } else {
+ if (gui_cs_list_model_has_dwords (self, &(*iter))) {
+ GUICSListModelRowType _tmp1_;
+ _tmp1_ = 0;
+ if (gui_cs_list_model_is_header (self, &(*iter))) {
+ _tmp1_ = GUI_CS_LIST_MODEL_ROW_TYPE_HEADER;
+ } else {
+ _tmp1_ = GUI_CS_LIST_MODEL_ROW_TYPE_DWORD;
+ }
+ result = _tmp1_;
+ return result;
+ }
+ }
+ result = GUI_CS_LIST_MODEL_ROW_TYPE_PACKET;
+ return result;
+}
+
+
+static GtkTreeModelFlags gui_cs_list_model_real_get_flags (GtkTreeModel* base) {
+ GUICSListModel * self;
+ GtkTreeModelFlags result;
+ self = (GUICSListModel*) base;
+ result = GTK_TREE_MODEL_ITERS_PERSIST;
+ return result;
+}
+
+
+static gint gui_cs_list_model_real_get_n_columns (GtkTreeModel* base) {
+ GUICSListModel * self;
+ gint result;
+ self = (GUICSListModel*) base;
+ result = (gint) GUI_CS_LIST_MODEL_COLUMNS_COUNT;
+ return result;
+}
+
+
+static GType gui_cs_list_model_real_get_column_type (GtkTreeModel* base, gint i) {
+ GUICSListModel * self;
+ GType result;
+ self = (GUICSListModel*) base;
+ result = G_TYPE_STRING;
+ return result;
+}
+
+
+static gboolean gui_cs_list_model_real_get_iter (GtkTreeModel* base, GtkTreeIter* iter, const GtkTreePath* path) {
+ GUICSListModel * self;
+ gboolean result;
+ gint depth;
+ gboolean _tmp0_;
+ gint* indices;
+ gboolean _tmp1_;
+ self = (GUICSListModel*) base;
+ g_return_val_if_fail (path != NULL, FALSE);
+ depth = gtk_tree_path_get_depth (path);
+ _tmp0_ = FALSE;
+ if (depth <= 3) {
+ _tmp0_ = depth >= 1;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ g_assert (_tmp0_);
+ indices = gtk_tree_path_get_indices (path);
+ _tmp1_ = FALSE;
+ if (indices[0] >= self->priv->m_cs->packets_length1) {
+ _tmp1_ = TRUE;
+ } else {
+ _tmp1_ = indices[0] < 0;
+ }
+ if (_tmp1_) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_iter (self, &(*iter), (guint) indices[0], (guint) 0, (guint) 0, FALSE);
+ if (depth >= 2) {
+ gboolean _tmp2_;
+ _tmp2_ = FALSE;
+ if (indices[1] > emulation_packet_base_get_length (self->priv->m_cs->packets[indices[0]])) {
+ _tmp2_ = TRUE;
+ } else {
+ _tmp2_ = indices[1] < 0;
+ }
+ if (_tmp2_) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_dword_num (self, &(*iter), (guint) (indices[1] + 1));
+ }
+ if (depth >= 3) {
+ if (indices[2] < 0) {
+ result = FALSE;
+ return result;
+ }
+ if (indices[1] == 0) {
+ /* Header */
+ if (indices[2] >= gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[indices[0]])]) {
+ result = FALSE;
+ return result;
+ }
+ } else {
+ /* XXX: DWORD */
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_bitfield_num (self, &(*iter), (guint) (indices[2] + 1));
+ }
+ (*iter).stamp = self->priv->m_stamp;
+ result = TRUE;
+ return result;
+}
+
+
+static GtkTreePath* gui_cs_list_model_real_get_path (GtkTreeModel* base, GtkTreeIter* iter) {
+ GUICSListModel * self;
+ GtkTreePath* result;
+ GtkTreePath* path;
+ self = (GUICSListModel*) base;
+ path = gtk_tree_path_new ();
+ gtk_tree_path_append_index (path, (gint) gui_cs_list_model_get_packet_num (self, &(*iter)));
+ if (gui_cs_list_model_has_dwords (self, &(*iter))) {
+ gtk_tree_path_append_index (path, ((gint) gui_cs_list_model_get_dword_num (self, &(*iter))) - 1);
+ }
+ if (gui_cs_list_model_has_bitfields (self, &(*iter))) {
+ gtk_tree_path_append_index (path, ((gint) gui_cs_list_model_get_bitfield_num (self, &(*iter))) - 1);
+ }
+ result = path;
+ return result;
+}
+
+
+guint32 gui_cs_list_model_get_numeric_value (GUICSListModel* self, GtkTreeIter* iter) {
+ guint32 result;
+ EmulationPacketBase* _tmp0_;
+ EmulationPacketBase* p;
+ g_return_val_if_fail (self != NULL, 0U);
+ _tmp0_ = NULL;
+ p = (_tmp0_ = self->priv->m_cs->packets[gui_cs_list_model_get_packet_num (self, &(*iter))], (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
+ switch (gui_cs_list_model_get_row_type (self, &(*iter))) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ result = p->header;
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ result = emulation_packet_base_get (p, gui_cs_list_model_dword_index (self, &(*iter)));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ {
+ result = p->header;
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ switch (emulation_packet_base_get_type_id (p)) {
+ case 0:
+ {
+ EmulationPacket0* _tmp2_;
+ EmulationPacketBase* _tmp1_;
+ EmulationPacket0* p0;
+ _tmp2_ = NULL;
+ _tmp1_ = NULL;
+ p0 = (_tmp2_ = (_tmp1_ = p, EMULATION_IS_PACKET0 (_tmp1_) ? ((EmulationPacket0*) _tmp1_) : NULL), (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_));
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ result = emulation_packet0_get__ADDR (p0);
+ (p0 == NULL) ? NULL : (p0 = (g_object_unref (p0), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 1:
+ {
+ result = emulation_packet0_get__ONE_REG_WR (p0);
+ (p0 == NULL) ? NULL : (p0 = (g_object_unref (p0), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 2:
+ {
+ result = emulation_packet0_get__COUNT (p0);
+ (p0 == NULL) ? NULL : (p0 = (g_object_unref (p0), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 3:
+ {
+ result = (guint32) emulation_packet_base_get_type_id (p);
+ (p0 == NULL) ? NULL : (p0 = (g_object_unref (p0), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ }
+ (p0 == NULL) ? NULL : (p0 = (g_object_unref (p0), NULL));
+ break;
+ }
+ case 1:
+ {
+ EmulationPacket1* _tmp4_;
+ EmulationPacketBase* _tmp3_;
+ EmulationPacket1* p1;
+ _tmp4_ = NULL;
+ _tmp3_ = NULL;
+ p1 = (_tmp4_ = (_tmp3_ = p, EMULATION_IS_PACKET1 (_tmp3_) ? ((EmulationPacket1*) _tmp3_) : NULL), (_tmp4_ == NULL) ? NULL : g_object_ref (_tmp4_));
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ result = emulation_packet1_get__ADDR1 (p1);
+ (p1 == NULL) ? NULL : (p1 = (g_object_unref (p1), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 1:
+ {
+ result = emulation_packet1_get__ADDR2 (p1);
+ (p1 == NULL) ? NULL : (p1 = (g_object_unref (p1), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 2:
+ {
+ result = (guint32) emulation_packet_base_get_type_id (p);
+ (p1 == NULL) ? NULL : (p1 = (g_object_unref (p1), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ }
+ (p1 == NULL) ? NULL : (p1 = (g_object_unref (p1), NULL));
+ break;
+ }
+ case 2:
+ {
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ result = (guint32) emulation_packet_base_get_type_id (p);
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ }
+ break;
+ }
+ case 3:
+ {
+ EmulationPacket3* _tmp6_;
+ EmulationPacketBase* _tmp5_;
+ EmulationPacket3* p3;
+ _tmp6_ = NULL;
+ _tmp5_ = NULL;
+ p3 = (_tmp6_ = (_tmp5_ = p, EMULATION_IS_PACKET3 (_tmp5_) ? ((EmulationPacket3*) _tmp5_) : NULL), (_tmp6_ == NULL) ? NULL : g_object_ref (_tmp6_));
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ result = emulation_packet3_get__IT_OPCODE (p3);
+ (p3 == NULL) ? NULL : (p3 = (g_object_unref (p3), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 1:
+ {
+ result = emulation_packet3_get__COUNT (p3);
+ (p3 == NULL) ? NULL : (p3 = (g_object_unref (p3), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ case 2:
+ {
+ result = (guint32) emulation_packet_base_get_type_id (p);
+ (p3 == NULL) ? NULL : (p3 = (g_object_unref (p3), NULL));
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+ }
+ }
+ (p3 == NULL) ? NULL : (p3 = (g_object_unref (p3), NULL));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ result = (guint32) 0;
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+ return result;
+}
+
+
+static char* gui_cs_list_model_translate_addr (GUICSListModel* self, guint32 addr) {
+ char* result;
+ EmulationRegisterList* regs;
+ const char* _tmp0_;
+ g_return_val_if_fail (self != NULL, NULL);
+ regs = emulation_spec_translate_addr (self->priv->m_spec, (guint) addr);
+ if (regs == NULL) {
+ result = g_strdup_printf ("0x%04X", addr);
+ (regs == NULL) ? NULL : (regs = (g_object_unref (regs), NULL));
+ return result;
+ }
+ _tmp0_ = NULL;
+ result = (_tmp0_ = emulation_register_info_get_name (emulation_register_get_info (emulation_register_list_get (regs, (guint) 0))), (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_));
+ (regs == NULL) ? NULL : (regs = (g_object_unref (regs), NULL));
+ return result;
+ (regs == NULL) ? NULL : (regs = (g_object_unref (regs), NULL));
+}
+
+
+static void gui_cs_list_model_real_get_value (GtkTreeModel* base, GtkTreeIter* iter, gint column, GValue* val) {
+ GUICSListModel * self;
+ EmulationPacketBase* _tmp0_;
+ EmulationPacketBase* p;
+ self = (GUICSListModel*) base;
+ _tmp0_ = NULL;
+ p = (_tmp0_ = self->priv->m_cs->packets[gui_cs_list_model_get_packet_num (self, &(*iter))], (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
+ g_value_init (&(*val), G_TYPE_STRING);
+ switch (gui_cs_list_model_get_row_type (self, &(*iter))) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ switch (column) {
+ case GUI_CS_LIST_MODEL_COLUMNS_NAME:
+ {
+ g_value_set_static_string (&(*val), gui_cs_list_model_packet_strings[emulation_packet_base_get_type_id (p)]);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
+ {
+ char* _tmp1_;
+ _tmp1_ = NULL;
+ g_value_set_string (&(*val), _tmp1_ = g_strdup_printf ("0x%08X", p->header));
+ _tmp1_ = (g_free (_tmp1_), NULL);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
+ {
+ switch (emulation_packet_base_get_type_id (p)) {
+ case 0:
+ {
+ char* _tmp3_;
+ EmulationPacketBase* _tmp2_;
+ _tmp3_ = NULL;
+ _tmp2_ = NULL;
+ g_value_set_string (&(*val), _tmp3_ = gui_cs_list_model_translate_addr (self, emulation_packet0_get_addr ((_tmp2_ = p, EMULATION_IS_PACKET0 (_tmp2_) ? ((EmulationPacket0*) _tmp2_) : NULL))));
+ _tmp3_ = (g_free (_tmp3_), NULL);
+ break;
+ }
+ case 1:
+ {
+ char* _tmp9_;
+ char* _tmp8_;
+ char* _tmp6_;
+ char* _tmp5_;
+ EmulationPacketBase* _tmp4_;
+ EmulationPacketBase* _tmp7_;
+ _tmp9_ = NULL;
+ _tmp8_ = NULL;
+ _tmp6_ = NULL;
+ _tmp5_ = NULL;
+ _tmp4_ = NULL;
+ _tmp7_ = NULL;
+ g_value_set_string (&(*val), _tmp9_ = g_strconcat (_tmp6_ = g_strconcat (_tmp5_ = gui_cs_list_model_translate_addr (self, emulation_packet1_get_addr1 ((_tmp4_ = p, EMULATION_IS_PACKET1 (_tmp4_) ? ((EmulationPacket1*) _tmp4_) : NULL))), " | ", NULL), _tmp8_ = gui_cs_list_model_translate_addr (self, emulation_packet1_get_addr2 ((_tmp7_ = p, EMULATION_IS_PACKET1 (_tmp7_) ? ((EmulationPacket1*) _tmp7_) : NULL))), NULL));
+ _tmp9_ = (g_free (_tmp9_), NULL);
+ _tmp8_ = (g_free (_tmp8_), NULL);
+ _tmp6_ = (g_free (_tmp6_), NULL);
+ _tmp5_ = (g_free (_tmp5_), NULL);
+ break;
+ }
+ case 2:
+ {
+ g_value_set_static_string (&(*val), "");
+ break;
+ }
+ case 3:
+ {
+ g_value_set_static_string (&(*val), "TODO");
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ switch (column) {
+ case GUI_CS_LIST_MODEL_COLUMNS_NAME:
+ {
+ char* _tmp10_;
+ _tmp10_ = NULL;
+ g_value_set_string (&(*val), _tmp10_ = g_strdup_printf ("DWORD%u", gui_cs_list_model_dword_index (self, &(*iter))));
+ _tmp10_ = (g_free (_tmp10_), NULL);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
+ {
+ char* _tmp11_;
+ _tmp11_ = NULL;
+ g_value_set_string (&(*val), _tmp11_ = g_strdup_printf ("0x%08X", emulation_packet_base_get (p, gui_cs_list_model_dword_index (self, &(*iter)))));
+ _tmp11_ = (g_free (_tmp11_), NULL);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
+ {
+ switch (emulation_packet_base_get_type_id (p)) {
+ case 0:
+ {
+ gint _tmp12_;
+ EmulationPacketBase* _tmp13_;
+ char* _tmp15_;
+ EmulationPacketBase* _tmp14_;
+ _tmp12_ = 0;
+ _tmp13_ = NULL;
+ if (emulation_packet0_get_one_reg_wr ((_tmp13_ = p, EMULATION_IS_PACKET0 (_tmp13_) ? ((EmulationPacket0*) _tmp13_) : NULL))) {
+ _tmp12_ = 0;
+ } else {
+ _tmp12_ = 1;
+ }
+ _tmp15_ = NULL;
+ _tmp14_ = NULL;
+ g_value_set_string (&(*val), _tmp15_ = gui_cs_list_model_translate_addr (self, emulation_packet0_get_addr ((_tmp14_ = p, EMULATION_IS_PACKET0 (_tmp14_) ? ((EmulationPacket0*) _tmp14_) : NULL)) + ((4 * gui_cs_list_model_dword_index (self, &(*iter))) * _tmp12_)));
+ _tmp15_ = (g_free (_tmp15_), NULL);
+ break;
+ }
+ case 1:
+ {
+ guint32 _tmp16_;
+ char* _tmp19_;
+ _tmp16_ = 0U;
+ if (gui_cs_list_model_dword_index (self, &(*iter)) == 0) {
+ EmulationPacketBase* _tmp17_;
+ _tmp17_ = NULL;
+ _tmp16_ = emulation_packet1_get_addr1 ((_tmp17_ = p, EMULATION_IS_PACKET1 (_tmp17_) ? ((EmulationPacket1*) _tmp17_) : NULL));
+ } else {
+ EmulationPacketBase* _tmp18_;
+ _tmp18_ = NULL;
+ _tmp16_ = emulation_packet1_get_addr2 ((_tmp18_ = p, EMULATION_IS_PACKET1 (_tmp18_) ? ((EmulationPacket1*) _tmp18_) : NULL));
+ }
+ _tmp19_ = NULL;
+ g_value_set_string (&(*val), _tmp19_ = gui_cs_list_model_translate_addr (self, _tmp16_));
+ _tmp19_ = (g_free (_tmp19_), NULL);
+ break;
+ }
+ case 2:
+ {
+ g_value_set_static_string (&(*val), "");
+ break;
+ }
+ case 3:
+ {
+ g_value_set_static_string (&(*val), "TODO");
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ {
+ switch (column) {
+ case GUI_CS_LIST_MODEL_COLUMNS_NAME:
+ {
+ g_value_set_static_string (&(*val), "HEADER");
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
+ {
+ char* _tmp20_;
+ _tmp20_ = NULL;
+ g_value_set_string (&(*val), _tmp20_ = g_strdup_printf ("0x%08X", p->header));
+ _tmp20_ = (g_free (_tmp20_), NULL);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
+ {
+ g_value_set_static_string (&(*val), "");
+ break;
+ }
+ }
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ switch (column) {
+ case GUI_CS_LIST_MODEL_COLUMNS_NAME:
+ {
+ g_value_set_static_string (&(*val), gui_cs_list_model_packet_headers[emulation_packet_base_get_type_id (p)][gui_cs_list_model_bitfield_index (self, &(*iter))]);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_TARGET:
+ {
+ g_value_set_static_string (&(*val), "");
+ break;
+ }
+ case GUI_CS_LIST_MODEL_COLUMNS_VALUE:
+ {
+ switch (emulation_packet_base_get_type_id (p)) {
+ case 0:
+ {
+ EmulationPacket0* _tmp22_;
+ EmulationPacketBase* _tmp21_;
+ EmulationPacket0* p0;
+ _tmp22_ = NULL;
+ _tmp21_ = NULL;
+ p0 = (_tmp22_ = (_tmp21_ = p, EMULATION_IS_PACKET0 (_tmp21_) ? ((EmulationPacket0*) _tmp21_) : NULL), (_tmp22_ == NULL) ? NULL : g_object_ref (_tmp22_));
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ char* _tmp23_;
+ _tmp23_ = NULL;
+ g_value_set_string (&(*val), _tmp23_ = gui_cs_list_model_translate_addr (self, emulation_packet0_get__ADDR (p0)));
+ _tmp23_ = (g_free (_tmp23_), NULL);
+ break;
+ }
+ case 1:
+ {
+ char* _tmp24_;
+ _tmp24_ = NULL;
+ g_value_set_string (&(*val), _tmp24_ = g_strdup_printf ("%u", emulation_packet0_get__ONE_REG_WR (p0)));
+ _tmp24_ = (g_free (_tmp24_), NULL);
+ break;
+ }
+ case 2:
+ {
+ char* _tmp25_;
+ _tmp25_ = NULL;
+ g_value_set_string (&(*val), _tmp25_ = g_strdup_printf ("%u", emulation_packet0_get__COUNT (p0)));
+ _tmp25_ = (g_free (_tmp25_), NULL);
+ break;
+ }
+ case 3:
+ {
+ char* _tmp26_;
+ _tmp26_ = NULL;
+ g_value_set_string (&(*val), _tmp26_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
+ _tmp26_ = (g_free (_tmp26_), NULL);
+ break;
+ }
+ }
+ (p0 == NULL) ? NULL : (p0 = (g_object_unref (p0), NULL));
+ break;
+ }
+ case 1:
+ {
+ EmulationPacket1* _tmp28_;
+ EmulationPacketBase* _tmp27_;
+ EmulationPacket1* p1;
+ _tmp28_ = NULL;
+ _tmp27_ = NULL;
+ p1 = (_tmp28_ = (_tmp27_ = p, EMULATION_IS_PACKET1 (_tmp27_) ? ((EmulationPacket1*) _tmp27_) : NULL), (_tmp28_ == NULL) ? NULL : g_object_ref (_tmp28_));
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ char* _tmp29_;
+ _tmp29_ = NULL;
+ g_value_set_string (&(*val), _tmp29_ = gui_cs_list_model_translate_addr (self, emulation_packet1_get__ADDR1 (p1)));
+ _tmp29_ = (g_free (_tmp29_), NULL);
+ break;
+ }
+ case 1:
+ {
+ char* _tmp30_;
+ _tmp30_ = NULL;
+ g_value_set_string (&(*val), _tmp30_ = gui_cs_list_model_translate_addr (self, emulation_packet1_get__ADDR2 (p1)));
+ _tmp30_ = (g_free (_tmp30_), NULL);
+ break;
+ }
+ case 2:
+ {
+ char* _tmp31_;
+ _tmp31_ = NULL;
+ g_value_set_string (&(*val), _tmp31_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
+ _tmp31_ = (g_free (_tmp31_), NULL);
+ break;
+ }
+ }
+ (p1 == NULL) ? NULL : (p1 = (g_object_unref (p1), NULL));
+ break;
+ }
+ case 2:
+ {
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ char* _tmp32_;
+ _tmp32_ = NULL;
+ g_value_set_string (&(*val), _tmp32_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
+ _tmp32_ = (g_free (_tmp32_), NULL);
+ break;
+ }
+ }
+ break;
+ }
+ case 3:
+ {
+ EmulationPacket3* _tmp34_;
+ EmulationPacketBase* _tmp33_;
+ EmulationPacket3* p3;
+ _tmp34_ = NULL;
+ _tmp33_ = NULL;
+ p3 = (_tmp34_ = (_tmp33_ = p, EMULATION_IS_PACKET3 (_tmp33_) ? ((EmulationPacket3*) _tmp33_) : NULL), (_tmp34_ == NULL) ? NULL : g_object_ref (_tmp34_));
+ switch (gui_cs_list_model_bitfield_index (self, &(*iter))) {
+ case 0:
+ {
+ char* _tmp35_;
+ _tmp35_ = NULL;
+ g_value_set_string (&(*val), _tmp35_ = g_strdup_printf ("0x%02X", emulation_packet3_get__IT_OPCODE (p3)));
+ _tmp35_ = (g_free (_tmp35_), NULL);
+ break;
+ }
+ case 1:
+ {
+ char* _tmp36_;
+ _tmp36_ = NULL;
+ g_value_set_string (&(*val), _tmp36_ = g_strdup_printf ("%u", emulation_packet3_get__COUNT (p3)));
+ _tmp36_ = (g_free (_tmp36_), NULL);
+ break;
+ }
+ case 2:
+ {
+ char* _tmp37_;
+ _tmp37_ = NULL;
+ g_value_set_string (&(*val), _tmp37_ = g_strdup_printf ("%u", emulation_packet_base_get_type_id (p)));
+ _tmp37_ = (g_free (_tmp37_), NULL);
+ break;
+ }
+ }
+ (p3 == NULL) ? NULL : (p3 = (g_object_unref (p3), NULL));
+ break;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+ }
+ (p == NULL) ? NULL : (p = (g_object_unref (p), NULL));
+}
+
+
+static gboolean gui_cs_list_model_real_iter_next (GtkTreeModel* base, GtkTreeIter* iter) {
+ GUICSListModel * self;
+ gboolean result;
+ guint p;
+ self = (GUICSListModel*) base;
+ p = gui_cs_list_model_get_packet_num (self, &(*iter));
+ switch (gui_cs_list_model_get_row_type (self, &(*iter))) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ p++;
+ if (p >= self->priv->m_cs->packets_length1) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_packet_num (self, &(*iter), p);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ guint d;
+ d = gui_cs_list_model_get_dword_num (self, &(*iter)) + 1;
+ if (d > (emulation_packet_base_get_length (self->priv->m_cs->packets[p]) + 1)) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_dword_num (self, &(*iter), d);
+ break;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ guint b;
+ b = gui_cs_list_model_get_bitfield_num (self, &(*iter)) + 1;
+ if (b > gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[p])]) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_bitfield_num (self, &(*iter), b);
+ break;
+ }
+ }
+ result = TRUE;
+ return result;
+}
+
+
+static gboolean gui_cs_list_model_real_iter_children (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent) {
+ GUICSListModel * self;
+ gboolean result;
+ self = (GUICSListModel*) base;
+ if (parent == NULL) {
+ if (self->priv->m_cs->packets_length1 == 0) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_iter (self, &(*iter), (guint) 0, (guint) 0, (guint) 0, TRUE);
+ result = TRUE;
+ return result;
+ }
+ switch (gui_cs_list_model_get_row_type (self, parent)) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ gui_cs_list_model_set_iter (self, &(*iter), gui_cs_list_model_get_packet_num (self, parent), (guint) 1, (guint) 0, TRUE);
+ result = TRUE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ {
+ gui_cs_list_model_set_iter (self, &(*iter), gui_cs_list_model_get_packet_num (self, parent), (guint) 1, (guint) 1, TRUE);
+ result = TRUE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ }
+ result = FALSE;
+ return result;
+}
+
+
+static gboolean gui_cs_list_model_real_iter_has_child (GtkTreeModel* base, GtkTreeIter* iter) {
+ GUICSListModel * self;
+ gboolean result;
+ self = (GUICSListModel*) base;
+ switch (gui_cs_list_model_get_row_type (self, &(*iter))) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ result = TRUE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ {
+ result = TRUE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ }
+ result = FALSE;
+ return result;
+}
+
+
+static gint gui_cs_list_model_real_iter_n_children (GtkTreeModel* base, GtkTreeIter* iter) {
+ GUICSListModel * self;
+ gint result;
+ guint p;
+ self = (GUICSListModel*) base;
+ if (iter == NULL) {
+ result = self->priv->m_cs->packets_length1;
+ return result;
+ }
+ p = gui_cs_list_model_get_packet_num (self, iter);
+ switch (gui_cs_list_model_get_row_type (self, iter)) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ result = ((gint) emulation_packet_base_get_length (self->priv->m_cs->packets[p])) + 1;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ {
+ result = (gint) gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[p])];
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ result = 0;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ result = 0;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ result = 0;
+ return result;
+ }
+ }
+ result = 0;
+ return result;
+}
+
+
+static gboolean gui_cs_list_model_real_iter_nth_child (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* parent, gint n) {
+ GUICSListModel * self;
+ gboolean result;
+ guint p;
+ self = (GUICSListModel*) base;
+ if (parent == NULL) {
+ gboolean _tmp0_;
+ _tmp0_ = FALSE;
+ if (n >= self->priv->m_cs->packets_length1) {
+ _tmp0_ = TRUE;
+ } else {
+ _tmp0_ = n < 0;
+ }
+ if (_tmp0_) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_iter (self, &(*iter), (guint) n, (guint) 0, (guint) 0, TRUE);
+ result = TRUE;
+ return result;
+ }
+ p = gui_cs_list_model_get_packet_num (self, parent);
+ switch (gui_cs_list_model_get_row_type (self, parent)) {
+ case GUI_CS_LIST_MODEL_ROW_TYPE_PACKET:
+ {
+ gboolean _tmp1_;
+ _tmp1_ = FALSE;
+ if (n > emulation_packet_base_get_length (self->priv->m_cs->packets[p])) {
+ _tmp1_ = TRUE;
+ } else {
+ _tmp1_ = n < 0;
+ }
+ if (_tmp1_) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_iter (self, &(*iter), p, (guint) (n + 1), (guint) 0, TRUE);
+ result = TRUE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER:
+ {
+ gboolean _tmp2_;
+ _tmp2_ = FALSE;
+ if (n >= gui_cs_list_model_packet_headers_length[emulation_packet_base_get_type_id (self->priv->m_cs->packets[p])]) {
+ _tmp2_ = TRUE;
+ } else {
+ _tmp2_ = n < 0;
+ }
+ if (_tmp2_) {
+ result = FALSE;
+ return result;
+ }
+ gui_cs_list_model_set_iter (self, &(*iter), p, (guint) 1, (guint) (n + 1), TRUE);
+ result = TRUE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_DWORD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ case GUI_CS_LIST_MODEL_ROW_TYPE_HEADER_BITFIELD:
+ {
+ result = FALSE;
+ return result;
+ }
+ }
+ result = FALSE;
+ return result;
+}
+
+
+static gboolean gui_cs_list_model_real_iter_parent (GtkTreeModel* base, GtkTreeIter* iter, GtkTreeIter* child) {
+ GUICSListModel * self;
+ gboolean result;
+ self = (GUICSListModel*) base;
+ if (gui_cs_list_model_has_bitfields (self, &(*child))) {
+ gui_cs_list_model_set_iter (self, &(*iter), gui_cs_list_model_get_packet_num (self, &(*child)), gui_cs_list_model_get_dword_num (self, &(*child)), (guint) 0, TRUE);
+ result = TRUE;
+ return result;
+ } else {
+ if (gui_cs_list_model_has_dwords (self, &(*child))) {
+ gui_cs_list_model_set_iter (self, &(*iter), gui_cs_list_model_get_packet_num (self, &(*child)), (guint) 0, (guint) 0, TRUE);
+ result = TRUE;
+ return result;
+ }
+ }
+ result = FALSE;
+ return result;
+}
+
+
+static void gui_cs_list_model_real_ref_node (GtkTreeModel* base, GtkTreeIter* iter) {
+ GUICSListModel * self;
+ self = (GUICSListModel*) base;
+ return;
+}
+
+
+static void gui_cs_list_model_real_unref_node (GtkTreeModel* base, GtkTreeIter* iter) {
+ GUICSListModel * self;
+ self = (GUICSListModel*) base;
+ return;
+}
+
+
+static void gui_cs_list_model_class_init (GUICSListModelClass * klass) {
+ char** _tmp0_;
+ char** _tmp1_;
+ char** _tmp2_;
+ char** _tmp3_;
+ char** _tmp4_;
+ char*** _tmp13_;
+ char** _tmp12_;
+ const char* _tmp11_;
+ char** _tmp10_;
+ const char* _tmp9_;
+ char** _tmp8_;
+ const char* _tmp7_;
+ char** _tmp6_;
+ const char* _tmp5_;
+ guint* _tmp14_;
+ gui_cs_list_model_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (GUICSListModelPrivate));
+ G_OBJECT_CLASS (klass)->finalize = gui_cs_list_model_finalize;
+ gui_cs_list_model_packet_strings = (_tmp0_ = g_new0 (char*, 4 + 1), _tmp0_[0] = g_strdup ("packet0"), _tmp0_[1] = g_strdup ("packet1"), _tmp0_[2] = g_strdup ("packet2"), _tmp0_[3] = g_strdup ("packet3"), _tmp0_);
+ gui_cs_list_model_packet_strings_length1 = 4;
+ _tmp0_ = NULL;
+ gui_cs_list_model_packet0_headers = (_tmp1_ = g_new0 (char*, 4 + 1), _tmp1_[0] = g_strdup ("BASE_INDEX"), _tmp1_[1] = g_strdup ("ONE_REG_WR"), _tmp1_[2] = g_strdup ("COUNT"), _tmp1_[3] = g_strdup ("TYPE"), _tmp1_);
+ gui_cs_list_model_packet0_headers_length1 = 4;
+ _tmp1_ = NULL;
+ gui_cs_list_model_packet1_headers = (_tmp2_ = g_new0 (char*, 3 + 1), _tmp2_[0] = g_strdup ("REG_INDEX1"), _tmp2_[1] = g_strdup ("REG_INDEX2"), _tmp2_[2] = g_strdup ("TYPE"), _tmp2_);
+ gui_cs_list_model_packet1_headers_length1 = 3;
+ _tmp2_ = NULL;
+ gui_cs_list_model_packet2_headers = (_tmp3_ = g_new0 (char*, 1 + 1), _tmp3_[0] = g_strdup ("TYPE"), _tmp3_);
+ gui_cs_list_model_packet2_headers_length1 = 1;
+ _tmp3_ = NULL;
+ gui_cs_list_model_packet3_headers = (_tmp4_ = g_new0 (char*, 3 + 1), _tmp4_[0] = g_strdup ("IT_OPCODE"), _tmp4_[1] = g_strdup ("COUNT"), _tmp4_[2] = g_strdup ("TYPE"), _tmp4_);
+ gui_cs_list_model_packet3_headers_length1 = 3;
+ _tmp4_ = NULL;
+ gui_cs_list_model_packet_headers = (_tmp13_ = g_new0 (char**, 4), _tmp13_[0] = (_tmp6_ = gui_cs_list_model_packet0_headers, (_tmp6_ == NULL) ? ((gpointer) _tmp6_) : _vala_array_dup3 (_tmp6_, gui_cs_list_model_packet0_headers_length1)), _tmp13_[1] = (_tmp8_ = gui_cs_list_model_packet1_headers, (_tmp8_ == NULL) ? ((gpointer) _tmp8_) : _vala_array_dup4 (_tmp8_, gui_cs_list_model_packet1_headers_length1)), _tmp13_[2] = (_tmp10_ = gui_cs_list_model_packet2_headers, (_tmp10_ == NULL) ? ((gpointer) _tmp10_) : _vala_array_dup5 (_tmp10_, gui_cs_list_model_packet2_headers_length1)), _tmp13_[3] = (_tmp12_ = gui_cs_list_model_packet3_headers, (_tmp12_ == NULL) ? ((gpointer) _tmp12_) : _vala_array_dup6 (_tmp12_, gui_cs_list_model_packet3_headers_length1)), _tmp13_);
+ gui_cs_list_model_packet_headers_length1 = 4;
+ _tmp13_ = NULL;
+ _tmp12_ = NULL;
+ _tmp11_ = NULL;
+ _tmp10_ = NULL;
+ _tmp9_ = NULL;
+ _tmp8_ = NULL;
+ _tmp7_ = NULL;
+ _tmp6_ = NULL;
+ _tmp5_ = NULL;
+ gui_cs_list_model_packet_headers_length = (_tmp14_ = g_new0 (guint, 4), _tmp14_[0] = (guint) 4, _tmp14_[1] = (guint) 3, _tmp14_[2] = (guint) 1, _tmp14_[3] = (guint) 3, _tmp14_);
+ gui_cs_list_model_packet_headers_length_length1 = 4;
+ _tmp14_ = NULL;
+}
+
+
+static void gui_cs_list_model_gtk_tree_model_interface_init (GtkTreeModelIface * iface) {
+ gui_cs_list_model_gtk_tree_model_parent_iface = g_type_interface_peek_parent (iface);
+ iface->get_flags = gui_cs_list_model_real_get_flags;
+ iface->get_n_columns = gui_cs_list_model_real_get_n_columns;
+ iface->get_column_type = gui_cs_list_model_real_get_column_type;
+ iface->get_iter = gui_cs_list_model_real_get_iter;
+ iface->get_path = gui_cs_list_model_real_get_path;
+ iface->get_value = gui_cs_list_model_real_get_value;
+ iface->iter_next = gui_cs_list_model_real_iter_next;
+ iface->iter_children = gui_cs_list_model_real_iter_children;
+ iface->iter_has_child = gui_cs_list_model_real_iter_has_child;
+ iface->iter_n_children = gui_cs_list_model_real_iter_n_children;
+ iface->iter_nth_child = gui_cs_list_model_real_iter_nth_child;
+ iface->iter_parent = gui_cs_list_model_real_iter_parent;
+ iface->ref_node = gui_cs_list_model_real_ref_node;
+ iface->unref_node = gui_cs_list_model_real_unref_node;
+}
+
+
+static void gui_cs_list_model_instance_init (GUICSListModel * self) {
+ self->priv = GUI_CS_LIST_MODEL_GET_PRIVATE (self);
+}
+
+
+static void gui_cs_list_model_finalize (GObject* obj) {
+ GUICSListModel * self;
+ self = GUI_CS_LIST_MODEL (obj);
+ (self->priv->m_cs == NULL) ? NULL : (self->priv->m_cs = (g_object_unref (self->priv->m_cs), NULL));
+ (self->priv->m_spec == NULL) ? NULL : (self->priv->m_spec = (g_object_unref (self->priv->m_spec), NULL));
+ G_OBJECT_CLASS (gui_cs_list_model_parent_class)->finalize (obj);
+}
+
+
+GType gui_cs_list_model_get_type (void) {
+ static GType gui_cs_list_model_type_id = 0;
+ if (gui_cs_list_model_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (GUICSListModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cs_list_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICSListModel), 0, (GInstanceInitFunc) gui_cs_list_model_instance_init, NULL };
+ static const GInterfaceInfo gtk_tree_model_info = { (GInterfaceInitFunc) gui_cs_list_model_gtk_tree_model_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
+ gui_cs_list_model_type_id = g_type_register_static (G_TYPE_OBJECT, "GUICSListModel", &g_define_type_info, 0);
+ g_type_add_interface_static (gui_cs_list_model_type_id, GTK_TYPE_TREE_MODEL, &gtk_tree_model_info);
+ }
+ return gui_cs_list_model_type_id;
+}
+
+
+static void _gui_cs_view_current_dword_renderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
+ gui_cs_view_current_dword_renderer (self, tree_column, cell, tree_model, iter);
+}
+
+
+GUICSView* gui_cs_view_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec) {
+ GUICSView * self;
+ GtkTreeView* cs_list;
+ GtkCellRendererPixbuf* _tmp0_;
+ GtkCellRendererText* _tmp1_;
+ GtkTreeViewColumn* _tmp2_;
+ GtkTreeViewColumn* ec_name;
+ GtkCellRendererText* _tmp3_;
+ GtkTreeViewColumn* _tmp4_;
+ GtkTreeViewColumn* ec_value;
+ GtkCellRendererText* _tmp5_;
+ GtkTreeViewColumn* _tmp6_;
+ GtkTreeViewColumn* ec_target;
+ GUICSListModel* _tmp7_;
+ GtkScrolledWindow* cs_sw;
+ GtkVBox* vbl;
+ GtkButton* _tmp8_;
+ GtkButton* _tmp9_;
+ GtkTreeView* state_reg_list;
+ GtkListStore* _tmp10_;
+ GtkScrolledWindow* sreg_sw;
+ GtkTreeView* state_raw_list;
+ GtkListStore* _tmp11_;
+ GtkScrolledWindow* sraw_sw;
+ GtkNotebook* nb;
+ GtkLabel* _tmp12_;
+ GtkLabel* _tmp13_;
+ GtkHPaned* paned;
+ g_return_val_if_fail (cs != NULL, NULL);
+ g_return_val_if_fail (spec != NULL, NULL);
+ self = g_object_newv (object_type, 0, NULL);
+ self->priv->m_pos = (guint) 0;
+ cs_list = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ());
+ _tmp0_ = NULL;
+ gtk_tree_view_insert_column_with_data_func (cs_list, -1, "", (GtkCellRenderer*) (_tmp0_ = g_object_ref_sink ((GtkCellRendererPixbuf*) gtk_cell_renderer_pixbuf_new ())), _gui_cs_view_current_dword_renderer_gtk_tree_cell_data_func, g_object_ref (self), g_object_unref);
+ (_tmp0_ == NULL) ? NULL : (_tmp0_ = (g_object_unref (_tmp0_), NULL));
+ _tmp1_ = NULL;
+ _tmp2_ = NULL;
+ ec_name = (_tmp2_ = g_object_ref_sink (gtk_tree_view_column_new_with_attributes ("Name", (GtkCellRenderer*) (_tmp1_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", GUI_CS_LIST_MODEL_COLUMNS_NAME, NULL, NULL)), (_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_object_unref (_tmp1_), NULL)), _tmp2_);
+ _tmp3_ = NULL;
+ _tmp4_ = NULL;
+ ec_value = (_tmp4_ = g_object_ref_sink (gtk_tree_view_column_new_with_attributes ("Value", (GtkCellRenderer*) (_tmp3_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", GUI_CS_LIST_MODEL_COLUMNS_VALUE, NULL, NULL)), (_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_object_unref (_tmp3_), NULL)), _tmp4_);
+ _tmp5_ = NULL;
+ _tmp6_ = NULL;
+ ec_target = (_tmp6_ = g_object_ref_sink (gtk_tree_view_column_new_with_attributes ("Target", (GtkCellRenderer*) (_tmp5_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", GUI_CS_LIST_MODEL_COLUMNS_TARGET, NULL, NULL)), (_tmp5_ == NULL) ? NULL : (_tmp5_ = (g_object_unref (_tmp5_), NULL)), _tmp6_);
+ gtk_tree_view_insert_column (cs_list, ec_name, -1);
+ gtk_tree_view_insert_column (cs_list, ec_value, -1);
+ gtk_tree_view_insert_column (cs_list, ec_target, -1);
+ gtk_tree_view_column_set_resizable (ec_name, TRUE);
+ gtk_tree_view_column_set_resizable (ec_value, TRUE);
+ gtk_tree_view_column_set_resizable (ec_target, TRUE);
+ _tmp7_ = NULL;
+ gtk_tree_view_set_model (cs_list, (GtkTreeModel*) (self->priv->m_pkg_store = (_tmp7_ = gui_cs_list_model_new (cs, spec), (self->priv->m_pkg_store == NULL) ? NULL : (self->priv->m_pkg_store = (g_object_unref (self->priv->m_pkg_store), NULL)), _tmp7_)));
+ gtk_tree_view_set_expander_column (cs_list, ec_name);
+ cs_sw = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
+ gtk_container_add ((GtkContainer*) cs_sw, (GtkWidget*) cs_list);
+ gtk_scrolled_window_set_shadow_type (cs_sw, GTK_SHADOW_ETCHED_IN);
+ g_object_set (cs_sw, "hscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ g_object_set (cs_sw, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ vbl = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 4));
+ _tmp8_ = NULL;
+ gtk_box_pack_start ((GtkBox*) vbl, (GtkWidget*) (self->priv->m_pkgup = (_tmp8_ = g_object_ref_sink ((GtkButton*) gtk_button_new_from_stock ("gtk-go-up")), (self->priv->m_pkgup == NULL) ? NULL : (self->priv->m_pkgup = (g_object_unref (self->priv->m_pkgup), NULL)), _tmp8_)), FALSE, TRUE, (guint) 0);
+ gtk_box_pack_start ((GtkBox*) vbl, (GtkWidget*) cs_sw, TRUE, TRUE, (guint) 0);
+ _tmp9_ = NULL;
+ gtk_box_pack_start ((GtkBox*) vbl, (GtkWidget*) (self->priv->m_pkgdown = (_tmp9_ = g_object_ref_sink ((GtkButton*) gtk_button_new_from_stock ("gtk-go-down")), (self->priv->m_pkgdown == NULL) ? NULL : (self->priv->m_pkgdown = (g_object_unref (self->priv->m_pkgdown), NULL)), _tmp9_)), FALSE, TRUE, (guint) 0);
+ state_reg_list = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ());
+ _tmp10_ = NULL;
+ gtk_tree_view_set_model (state_reg_list, (GtkTreeModel*) (self->priv->m_reg_store = (_tmp10_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_UINT, NULL), (self->priv->m_reg_store == NULL) ? NULL : (self->priv->m_reg_store = (g_object_unref (self->priv->m_reg_store), NULL)), _tmp10_)));
+ sreg_sw = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
+ gtk_container_add ((GtkContainer*) sreg_sw, (GtkWidget*) state_reg_list);
+ gtk_scrolled_window_set_shadow_type (sreg_sw, GTK_SHADOW_ETCHED_IN);
+ g_object_set (sreg_sw, "hscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ g_object_set (sreg_sw, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ state_raw_list = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ());
+ _tmp11_ = NULL;
+ gtk_tree_view_set_model (state_raw_list, (GtkTreeModel*) (self->priv->m_raw_store = (_tmp11_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_UINT, NULL), (self->priv->m_raw_store == NULL) ? NULL : (self->priv->m_raw_store = (g_object_unref (self->priv->m_raw_store), NULL)), _tmp11_)));
+ sraw_sw = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
+ gtk_container_add ((GtkContainer*) sraw_sw, (GtkWidget*) state_raw_list);
+ gtk_scrolled_window_set_shadow_type (sraw_sw, GTK_SHADOW_ETCHED_IN);
+ g_object_set (sraw_sw, "hscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ g_object_set (sraw_sw, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ nb = g_object_ref_sink ((GtkNotebook*) gtk_notebook_new ());
+ _tmp12_ = NULL;
+ gtk_notebook_append_page (nb, (GtkWidget*) sreg_sw, (GtkWidget*) (_tmp12_ = g_object_ref_sink ((GtkLabel*) gtk_label_new ("Registers"))));
+ (_tmp12_ == NULL) ? NULL : (_tmp12_ = (g_object_unref (_tmp12_), NULL));
+ _tmp13_ = NULL;
+ gtk_notebook_append_page (nb, (GtkWidget*) sraw_sw, (GtkWidget*) (_tmp13_ = g_object_ref_sink ((GtkLabel*) gtk_label_new ("Raw"))));
+ (_tmp13_ == NULL) ? NULL : (_tmp13_ = (g_object_unref (_tmp13_), NULL));
+ gtk_notebook_set_scrollable (nb, TRUE);
+ paned = g_object_ref_sink ((GtkHPaned*) gtk_hpaned_new ());
+ gtk_paned_add1 ((GtkPaned*) paned, (GtkWidget*) vbl);
+ gtk_paned_add2 ((GtkPaned*) paned, (GtkWidget*) nb);
+ gtk_paned_set_position ((GtkPaned*) paned, 400);
+ gtk_container_add ((GtkContainer*) self, (GtkWidget*) paned);
+ gtk_container_set_border_width ((GtkContainer*) self, (guint) 10);
+ gtk_window_set_default_size ((GtkWindow*) self, 640, 480);
+ (cs_list == NULL) ? NULL : (cs_list = (g_object_unref (cs_list), NULL));
+ (ec_name == NULL) ? NULL : (ec_name = (g_object_unref (ec_name), NULL));
+ (ec_value == NULL) ? NULL : (ec_value = (g_object_unref (ec_value), NULL));
+ (ec_target == NULL) ? NULL : (ec_target = (g_object_unref (ec_target), NULL));
+ (cs_sw == NULL) ? NULL : (cs_sw = (g_object_unref (cs_sw), NULL));
+ (vbl == NULL) ? NULL : (vbl = (g_object_unref (vbl), NULL));
+ (state_reg_list == NULL) ? NULL : (state_reg_list = (g_object_unref (state_reg_list), NULL));
+ (sreg_sw == NULL) ? NULL : (sreg_sw = (g_object_unref (sreg_sw), NULL));
+ (state_raw_list == NULL) ? NULL : (state_raw_list = (g_object_unref (state_raw_list), NULL));
+ (sraw_sw == NULL) ? NULL : (sraw_sw = (g_object_unref (sraw_sw), NULL));
+ (nb == NULL) ? NULL : (nb = (g_object_unref (nb), NULL));
+ (paned == NULL) ? NULL : (paned = (g_object_unref (paned), NULL));
+ return self;
+}
+
+
+GUICSView* gui_cs_view_new (EmulationCS* cs, EmulationSpec* spec) {
+ return gui_cs_view_construct (GUI_TYPE_CS_VIEW, cs, spec);
+}
+
+
+static void gui_cs_view_current_dword_renderer (GUICSView* self, GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
+ GtkTreeModel* _tmp0_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (tree_column != NULL);
+ g_return_if_fail (cell != NULL);
+ g_return_if_fail (model != NULL);
+ _tmp0_ = NULL;
+ if (self->priv->m_pos == gui_cs_list_model_get_packet_num ((_tmp0_ = model, GUI_IS_CS_LIST_MODEL (_tmp0_) ? ((GUICSListModel*) _tmp0_) : NULL), &(*iter))) {
+ GtkCellRenderer* _tmp1_;
+ _tmp1_ = NULL;
+ g_object_set ((_tmp1_ = cell, GTK_IS_CELL_RENDERER_PIXBUF (_tmp1_) ? ((GtkCellRendererPixbuf*) _tmp1_) : NULL), "stock-id", "gtk-media-record", NULL);
+ } else {
+ GtkCellRenderer* _tmp2_;
+ _tmp2_ = NULL;
+ g_object_set ((_tmp2_ = cell, GTK_IS_CELL_RENDERER_PIXBUF (_tmp2_) ? ((GtkCellRendererPixbuf*) _tmp2_) : NULL), "stock-id", "", NULL);
+ }
+}
+
+
+static void gui_cs_view_class_init (GUICSViewClass * klass) {
+ gui_cs_view_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (GUICSViewPrivate));
+ G_OBJECT_CLASS (klass)->finalize = gui_cs_view_finalize;
+}
+
+
+static void gui_cs_view_instance_init (GUICSView * self) {
+ self->priv = GUI_CS_VIEW_GET_PRIVATE (self);
+}
+
+
+static void gui_cs_view_finalize (GObject* obj) {
+ GUICSView * self;
+ self = GUI_CS_VIEW (obj);
+ (self->priv->m_pkgup == NULL) ? NULL : (self->priv->m_pkgup = (g_object_unref (self->priv->m_pkgup), NULL));
+ (self->priv->m_pkgdown == NULL) ? NULL : (self->priv->m_pkgdown = (g_object_unref (self->priv->m_pkgdown), NULL));
+ (self->priv->m_pkg_store == NULL) ? NULL : (self->priv->m_pkg_store = (g_object_unref (self->priv->m_pkg_store), NULL));
+ (self->priv->m_reg_store == NULL) ? NULL : (self->priv->m_reg_store = (g_object_unref (self->priv->m_reg_store), NULL));
+ (self->priv->m_raw_store == NULL) ? NULL : (self->priv->m_raw_store = (g_object_unref (self->priv->m_raw_store), NULL));
+ G_OBJECT_CLASS (gui_cs_view_parent_class)->finalize (obj);
+}
+
+
+GType gui_cs_view_get_type (void) {
+ static GType gui_cs_view_type_id = 0;
+ if (gui_cs_view_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (GUICSViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cs_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICSView), 0, (GInstanceInitFunc) gui_cs_view_instance_init, NULL };
+ gui_cs_view_type_id = g_type_register_static (GTK_TYPE_WINDOW, "GUICSView", &g_define_type_info, 0);
+ }
+ return gui_cs_view_type_id;
+}
+
+
+
+
diff --git a/src/csview.vala b/src/csview.vala
new file mode 100644
index 0000000..0a2cc24
--- /dev/null
+++ b/src/csview.vala
@@ -0,0 +1,540 @@
+using Gtk;
+using Emulation;
+
+namespace GUI
+{
+ public class CSListModel : GLib.Object, TreeModel
+ {
+ public enum Columns
+ {
+ NAME = 0,
+ VALUE,
+ TARGET,
+ COUNT
+ }
+
+ public enum RowType
+ {
+ PACKET = 0,
+ HEADER,
+ DWORD,
+ BITFIELD,
+ HEADER_BITFIELD
+ }
+
+ private static string[] packet_strings = {
+ "packet0",
+ "packet1",
+ "packet2",
+ "packet3"
+ };
+
+ private static string[] packet0_headers = {
+ "BASE_INDEX",
+ "ONE_REG_WR",
+ "COUNT",
+ "TYPE"
+ };
+
+ private static string[] packet1_headers = {
+ "REG_INDEX1",
+ "REG_INDEX2",
+ "TYPE"
+ };
+
+ private static string[] packet2_headers = {
+ "TYPE"
+ };
+
+ private static string[] packet3_headers = {
+ "IT_OPCODE",
+ "COUNT",
+ "TYPE"
+ };
+
+ private static string[][] packet_headers = {
+ packet0_headers,
+ packet1_headers,
+ packet2_headers,
+ packet3_headers
+ };
+
+ private static uint[] packet_headers_length = { 4, 3, 1, 3 };
+
+ public inline uint get_packet_num(TreeIter iter) { return *((uint*)(&iter.user_data)); }
+ private inline uint get_dword_num(TreeIter iter) { return *((uint*)(&iter.user_data2)); }
+ private inline uint get_bitfield_num(TreeIter iter) { return *((uint*)(&iter.user_data3)); }
+
+ private inline void set_packet_num(ref TreeIter iter, uint n) { iter.user_data = *((void**)(&n)); }
+ private inline void set_dword_num(ref TreeIter iter, uint n) { iter.user_data2 = *((void**)(&n)); }
+ private inline void set_bitfield_num(ref TreeIter iter, uint n) { iter.user_data3 = *((void**)(&n)); }
+
+ /* for dwords, 0 means no dwords, 1 means just the header, and 2+ means header and packets */
+ /* for bitfields, 0 means no bitfields, 1+ means bitfields */
+
+ private inline bool is_header(TreeIter iter) { return get_dword_num(iter) == 1; }
+ private inline bool has_dwords(TreeIter iter) { return get_dword_num(iter) >= 1; }
+ private inline bool has_bitfields(TreeIter iter) { return get_bitfield_num(iter) >= 1; }
+
+ private inline uint dword_index(TreeIter iter) { return get_dword_num(iter) - 2; }
+ private inline uint bitfield_index(TreeIter iter) { return get_bitfield_num(iter) - 1; }
+
+ private inline void set_iter(ref TreeIter iter, uint p, uint d, uint b, bool stamp = true)
+ {
+ set_packet_num(ref iter, p);
+ set_dword_num(ref iter, d);
+ set_bitfield_num(ref iter, b);
+ iter.stamp = (stamp) ? m_stamp : 0;
+ }
+
+ private CS m_cs;
+ private Spec m_spec;
+ private int m_stamp;
+
+ public CSListModel(CS cs, Spec spec)
+ {
+ m_cs = cs;
+ m_spec = spec;
+ m_stamp = 19449216;
+ }
+
+ public RowType get_row_type(TreeIter iter)
+ {
+ if (has_bitfields(iter)) {
+ return is_header(iter) ? RowType.HEADER_BITFIELD : RowType.BITFIELD;
+ } else if (has_dwords(iter)) {
+ return is_header(iter) ? RowType.HEADER : RowType.DWORD;
+ }
+
+ return RowType.PACKET;
+ }
+
+ public TreeModelFlags get_flags()
+ {
+ return TreeModelFlags.ITERS_PERSIST;
+ }
+
+ public int get_n_columns()
+ {
+ return Columns.COUNT;
+ }
+
+ public Type get_column_type(int i)
+ {
+ return typeof(string);
+ }
+
+ public bool get_iter(out TreeIter iter, TreePath path)
+ {
+ var depth = path.get_depth();
+ assert(depth <= 3 && depth >= 1);
+
+ int *indices = path.get_indices();
+
+ if (indices[0] >= m_cs.packets.length || indices[0] < 0) { return false; }
+ set_iter(ref iter, indices[0], 0, 0, false);
+
+ if (depth >= 2) {
+ if (indices[1] > m_cs.packets[indices[0]].length || indices[1] < 0) { return false; }
+ set_dword_num(ref iter, indices[1]+1);
+ }
+
+ if (depth >= 3) {
+ if (indices[2] < 0) { return false; }
+ if (indices[1] == 0) {
+ /* Header */
+ if (indices[2] >= packet_headers_length[m_cs.packets[indices[0]].type_id]) { return false; }
+ } else {
+ /* XXX: DWORD */
+ return false;
+ }
+ set_bitfield_num(ref iter, indices[2]+1);
+ }
+
+ iter.stamp = m_stamp;
+
+ return true;
+ }
+
+ public TreePath get_path(TreeIter iter)
+ {
+ var path = new TreePath();
+
+ path.append_index((int)get_packet_num(iter));
+ if (has_dwords(iter)) { path.append_index((int)get_dword_num(iter) - 1); }
+ if (has_bitfields(iter)) { path.append_index((int)get_bitfield_num(iter) - 1); }
+
+ return path;
+ }
+
+ public uint32 get_numeric_value(TreeIter iter)
+ {
+ PacketBase p = m_cs.packets[get_packet_num(iter)];
+ switch (get_row_type(iter)) {
+ case RowType.PACKET: return p.header;
+ case RowType.DWORD: return p[dword_index(iter)];
+ case RowType.HEADER: return p.header;
+
+ case RowType.BITFIELD:
+ /* TODO */
+ break;
+
+ case RowType.HEADER_BITFIELD:
+ switch (p.type_id) {
+ case 0:
+ Packet0 p0 = p as Packet0;
+ switch (bitfield_index(iter)) {
+ case 0: return p0._ADDR;
+ case 1: return p0._ONE_REG_WR;
+ case 2: return p0._COUNT;
+ case 3: return p.type_id;
+ }
+ break;
+
+ case 1:
+ Packet1 p1 = p as Packet1;
+ switch (bitfield_index(iter)) {
+ case 0: return p1._ADDR1;
+ case 1: return p1._ADDR2;
+ case 2: return p.type_id;
+ }
+ break;
+
+ case 2:
+ switch (bitfield_index(iter)) {
+ case 0: return p.type_id;
+ }
+ break;
+
+ case 3:
+ Packet3 p3 = p as Packet3;
+ switch (bitfield_index(iter)) {
+ case 0: return p3._IT_OPCODE;
+ case 1: return p3._COUNT;
+ case 2: return p.type_id;
+ }
+ break;
+ }
+ break;
+ }
+
+ return 0;
+ }
+
+ private string translate_addr(uint32 addr)
+ {
+ var regs = m_spec.translate_addr((uint)addr);
+ if (regs == null) { return addr.to_string("0x%04X"); }
+ return regs[0].info.name;
+ }
+
+ public void get_value(TreeIter iter, int column, out Value val)
+ {
+ PacketBase p = m_cs.packets[get_packet_num(iter)];
+ val.init(typeof(string));
+
+ switch (get_row_type(iter)) {
+ case RowType.PACKET:
+ switch (column) {
+ case Columns.NAME: val.set_static_string(packet_strings[p.type_id]); break;
+ case Columns.VALUE: val.set_string(p.header.to_string("0x%08X")); break;
+ case Columns.TARGET:
+ switch (p.type_id) {
+ case 0: val.set_string(translate_addr((p as Packet0).addr)); break;
+ case 1: val.set_string(translate_addr((p as Packet1).addr1) + " | " + translate_addr((p as Packet1).addr2)); break;
+ case 2: val.set_static_string(""); break;
+ case 3: val.set_static_string("TODO"); break;
+ }
+ break;
+ }
+ break;
+
+ case RowType.DWORD:
+ switch (column) {
+ case Columns.NAME: val.set_string(dword_index(iter).to_string("DWORD%u")); break;
+ case Columns.VALUE: val.set_string(p[dword_index(iter)].to_string("0x%08X")); break;
+ case Columns.TARGET:
+ switch (p.type_id) {
+ case 0: val.set_string(translate_addr((p as Packet0).addr + 4*dword_index(iter)*((p as Packet0).one_reg_wr ? 0 : 1))); break;
+ case 1: val.set_string(translate_addr((dword_index(iter) == 0) ? (p as Packet1).addr1 : (p as Packet1).addr2)); break;
+ case 2: val.set_static_string(""); break;
+ case 3: val.set_static_string("TODO"); break;
+ }
+ break;
+ }
+ break;
+
+ case RowType.HEADER:
+ switch (column) {
+ case Columns.NAME: val.set_static_string("HEADER"); break;
+ case Columns.VALUE: val.set_string(p.header.to_string("0x%08X")); break;
+ case Columns.TARGET: val.set_static_string(""); break;
+ }
+ break;
+
+ case RowType.BITFIELD:
+ /* TODO */
+ break;
+
+ case RowType.HEADER_BITFIELD:
+ switch (column) {
+ case Columns.NAME: val.set_static_string(packet_headers[p.type_id][bitfield_index(iter)]); break;
+ case Columns.TARGET: val.set_static_string(""); break;
+ case Columns.VALUE:
+ switch (p.type_id) {
+ case 0:
+ Packet0 p0 = p as Packet0;
+ switch (bitfield_index(iter)) {
+ case 0: val.set_string(translate_addr(p0._ADDR)); break;
+ case 1: val.set_string(p0._ONE_REG_WR.to_string()); break;
+ case 2: val.set_string(p0._COUNT.to_string()); break;
+ case 3: val.set_string(p.type_id.to_string()); break;
+ }
+ break;
+ case 1:
+ Packet1 p1 = p as Packet1;
+ switch (bitfield_index(iter)) {
+ case 0: val.set_string(translate_addr(p1._ADDR1)); break;
+ case 1: val.set_string(translate_addr(p1._ADDR2)); break;
+ case 2: val.set_string(p.type_id.to_string()); break;
+ }
+ break;
+ case 2:
+ switch (bitfield_index(iter)) {
+ case 0: val.set_string(p.type_id.to_string()); break;
+ }
+ break;
+ case 3:
+ Packet3 p3 = p as Packet3;
+ switch (bitfield_index(iter)) {
+ case 0: val.set_string(p3._IT_OPCODE.to_string("0x%02X")); break; /* TODO: resolve opcode */
+ case 1: val.set_string(p3._COUNT.to_string()); break;
+ case 2: val.set_string(p.type_id.to_string()); break;
+ }
+ break;
+ }
+ break;
+ }
+ break;
+ }
+ }
+
+ public bool iter_next(ref TreeIter iter)
+ {
+ var p = get_packet_num(iter);
+ switch (get_row_type(iter)) {
+ case RowType.PACKET:
+ p++;
+ if (p >= m_cs.packets.length) { return false; }
+ set_packet_num(ref iter, p);
+ break;
+
+ case RowType.HEADER:
+ case RowType.DWORD:
+ var d = get_dword_num(iter)+1;
+ if (d > m_cs.packets[p].length+1) { return false; }
+ set_dword_num(ref iter, d);
+ break;
+
+ case RowType.BITFIELD:
+ /* TODO */
+ return false;
+
+ case RowType.HEADER_BITFIELD:
+ var b = get_bitfield_num(iter)+1;
+ if (b > packet_headers_length[m_cs.packets[p].type_id]) { return false; }
+ set_bitfield_num(ref iter, b);
+ break;
+ }
+
+ return true;
+ }
+
+ public bool iter_children(out TreeIter iter, TreeIter? parent)
+ {
+ if (parent == null) {
+ if (m_cs.packets.length == 0) {
+ return false;
+ }
+
+ set_iter(ref iter, 0, 0, 0);
+ return true;
+ }
+
+ switch (get_row_type(parent)) {
+ case RowType.PACKET: set_iter(ref iter, get_packet_num(parent), 1, 0); return true;
+ case RowType.HEADER: set_iter(ref iter, get_packet_num(parent), 1, 1); return true;
+ case RowType.DWORD:
+ /* TODO */
+ return false;
+
+ case RowType.BITFIELD: return false;
+ case RowType.HEADER_BITFIELD: return false;
+ }
+
+ return false;
+ }
+
+ public bool iter_has_child(TreeIter iter)
+ {
+ switch (get_row_type(iter)) {
+ case RowType.PACKET: return true;
+ case RowType.HEADER: return true;
+ case RowType.DWORD: return false; /* TODO */
+ case RowType.BITFIELD: return false;
+ case RowType.HEADER_BITFIELD: return false;
+ }
+
+ return false;
+ }
+
+ public int iter_n_children(TreeIter? iter)
+ {
+ if (iter == null) {
+ return m_cs.packets.length;
+ }
+
+ var p = get_packet_num(iter);
+ switch (get_row_type(iter)) {
+ case RowType.PACKET: return (int)m_cs.packets[p].length+1;
+ case RowType.HEADER: return (int)packet_headers_length[m_cs.packets[p].type_id];
+ case RowType.DWORD: return 0; /* TODO */
+ case RowType.BITFIELD: return 0;
+ case RowType.HEADER_BITFIELD: return 0;
+ }
+
+ return 0;
+ }
+
+ public bool iter_nth_child(out TreeIter iter, TreeIter? parent, int n)
+ {
+ if (parent == null) {
+ if (n >= m_cs.packets.length || n < 0) {
+ return false;
+ }
+
+ set_iter(ref iter, n, 0, 0);
+ return true;
+ }
+
+ var p = get_packet_num(parent);
+ switch (get_row_type(parent)) {
+ case RowType.PACKET:
+ if (n > m_cs.packets[p].length || n < 0) { return false; }
+ set_iter(ref iter, p, n+1, 0);
+ return true;
+
+ case RowType.HEADER:
+ if (n >= packet_headers_length[m_cs.packets[p].type_id] || n < 0) { return false; }
+ set_iter(ref iter, p, 1, n+1);
+ return true;
+
+ case RowType.DWORD: return false; /* TODO */
+ case RowType.BITFIELD: return false;
+ case RowType.HEADER_BITFIELD: return false;
+ }
+
+ return false;
+ }
+
+ public bool iter_parent(out TreeIter iter, TreeIter child)
+ {
+ if (has_bitfields(child)) {
+ set_iter(ref iter, get_packet_num(child), get_dword_num(child), 0);
+ return true;
+ } else if (has_dwords(child)) {
+ set_iter(ref iter, get_packet_num(child), 0, 0);
+ return true;
+ }
+
+ return false;
+ }
+
+ public void ref_node(TreeIter iter) { return; }
+ public void unref_node(TreeIter iter) { return; }
+ }
+
+ public class CSView : Window
+ {
+// private CS m_cs;
+ private Button m_pkgup;
+ private Button m_pkgdown;
+ private CSListModel m_pkg_store;
+ private ListStore m_reg_store;
+ private ListStore m_raw_store;
+ private uint m_pos;
+
+ public CSView(CS cs, Spec spec)
+ {
+// m_cs = cs;
+ m_pos = 0;
+
+ var cs_list = new TreeView();
+ cs_list.insert_column_with_data_func(-1, "", new Gtk.CellRendererPixbuf(), current_dword_renderer);
+ var ec_name = new Gtk.TreeViewColumn.with_attributes("Name", new Gtk.CellRendererText(), "text", CSListModel.Columns.NAME, null);
+ var ec_value = new Gtk.TreeViewColumn.with_attributes("Value", new Gtk.CellRendererText(), "text", CSListModel.Columns.VALUE, null);
+ var ec_target = new Gtk.TreeViewColumn.with_attributes("Target", new Gtk.CellRendererText(), "text", CSListModel.Columns.TARGET, null);
+ cs_list.insert_column(ec_name, -1);
+ cs_list.insert_column(ec_value, -1);
+ cs_list.insert_column(ec_target, -1);
+ ec_name.resizable = true;
+ ec_value.resizable = true;
+ ec_target.resizable = true;
+ cs_list.set_model(m_pkg_store = new CSListModel(cs, spec));
+ cs_list.set_expander_column(ec_name);
+
+ var cs_sw = new ScrolledWindow(null, null);
+ cs_sw.add(cs_list);
+ cs_sw.shadow_type = ShadowType.ETCHED_IN;
+ cs_sw.hscrollbar_policy = PolicyType.AUTOMATIC;
+ cs_sw.vscrollbar_policy = PolicyType.AUTOMATIC;
+
+ var vbl = new VBox(false, 4);
+ vbl.pack_start(m_pkgup = new Button.from_stock("gtk-go-up"), false, true, 0);
+ vbl.pack_start(cs_sw, true, true, 0);
+ vbl.pack_start(m_pkgdown = new Button.from_stock("gtk-go-down"), false, true, 0);
+
+ var state_reg_list = new TreeView();
+ state_reg_list.set_model(m_reg_store = new ListStore(2, typeof(string), typeof(uint32)));
+
+ var sreg_sw = new ScrolledWindow(null, null);
+ sreg_sw.add(state_reg_list);
+ sreg_sw.shadow_type = ShadowType.ETCHED_IN;
+ sreg_sw.hscrollbar_policy = PolicyType.AUTOMATIC;
+ sreg_sw.vscrollbar_policy = PolicyType.AUTOMATIC;
+
+ var state_raw_list = new TreeView();
+ state_raw_list.set_model(m_raw_store = new ListStore(2, typeof(string), typeof(uint32)));
+
+ var sraw_sw = new ScrolledWindow(null, null);
+ sraw_sw.add(state_raw_list);
+ sraw_sw.shadow_type = ShadowType.ETCHED_IN;
+ sraw_sw.hscrollbar_policy = PolicyType.AUTOMATIC;
+ sraw_sw.vscrollbar_policy = PolicyType.AUTOMATIC;
+
+ var nb = new Notebook();
+ nb.append_page(sreg_sw, new Label("Registers"));
+ nb.append_page(sraw_sw, new Label("Raw"));
+ nb.scrollable = true;
+
+ var paned = new HPaned();
+ paned.add1(vbl);
+ paned.add2(nb);
+ paned.position = 400;
+
+ this.add(paned);
+ this.border_width = 10;
+ this.set_default_size(640, 480);
+ }
+
+ private void current_dword_renderer(Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
+ {
+ if (m_pos == (model as CSListModel).get_packet_num(iter)) {
+ (cell as Gtk.CellRendererPixbuf).stock_id = "gtk-media-record";
+ } else {
+ (cell as Gtk.CellRendererPixbuf).stock_id = "";
+ }
+ }
+ }
+}
+
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..821fa7e
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,883 @@
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gobject/gvaluecollector.h>
+
+
+#define GUI_TYPE_CACTIONS (gui_cactions_get_type ())
+#define GUI_CACTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CACTIONS, GUICActions))
+#define GUI_CACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CACTIONS, GUICActionsClass))
+#define GUI_IS_CACTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CACTIONS))
+#define GUI_IS_CACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CACTIONS))
+#define GUI_CACTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CACTIONS, GUICActionsClass))
+
+typedef struct _GUICActions GUICActions;
+typedef struct _GUICActionsClass GUICActionsClass;
+typedef struct _GUICActionsPrivate GUICActionsPrivate;
+
+#define EMULATION_TYPE_CHIP (emulation_chip_get_type ())
+
+#define GUI_TYPE_CS_IMPORT (gui_cs_import_get_type ())
+#define GUI_CS_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_IMPORT, GUICSImport))
+#define GUI_CS_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_IMPORT, GUICSImportClass))
+#define GUI_IS_CS_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_IMPORT))
+#define GUI_IS_CS_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_IMPORT))
+#define GUI_CS_IMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_IMPORT, GUICSImportClass))
+
+typedef struct _GUICSImport GUICSImport;
+typedef struct _GUICSImportClass GUICSImportClass;
+typedef struct _GUIParamSpecCActions GUIParamSpecCActions;
+
+#define GUI_TYPE_CMENUS (gui_cmenus_get_type ())
+#define GUI_CMENUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CMENUS, GUICMenus))
+#define GUI_CMENUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CMENUS, GUICMenusClass))
+#define GUI_IS_CMENUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CMENUS))
+#define GUI_IS_CMENUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CMENUS))
+#define GUI_CMENUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CMENUS, GUICMenusClass))
+
+typedef struct _GUICMenus GUICMenus;
+typedef struct _GUICMenusClass GUICMenusClass;
+typedef struct _GUICMenusPrivate GUICMenusPrivate;
+typedef struct _GUIParamSpecCMenus GUIParamSpecCMenus;
+
+#define GUI_TYPE_CMAIN (gui_cmain_get_type ())
+#define GUI_CMAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CMAIN, GUICMain))
+#define GUI_CMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CMAIN, GUICMainClass))
+#define GUI_IS_CMAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CMAIN))
+#define GUI_IS_CMAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CMAIN))
+#define GUI_CMAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CMAIN, GUICMainClass))
+
+typedef struct _GUICMain GUICMain;
+typedef struct _GUICMainClass GUICMainClass;
+typedef struct _GUICMainPrivate GUICMainPrivate;
+
+#define EMULATION_TYPE_CS (emulation_cs_get_type ())
+#define EMULATION_CS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_CS, EmulationCS))
+#define EMULATION_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_CS, EmulationCSClass))
+#define EMULATION_IS_CS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_CS))
+#define EMULATION_IS_CS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_CS))
+#define EMULATION_CS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_CS, EmulationCSClass))
+
+typedef struct _EmulationCS EmulationCS;
+typedef struct _EmulationCSClass EmulationCSClass;
+typedef struct _EmulationCSPrivate EmulationCSPrivate;
+
+#define EMULATION_TYPE_PACKET_BASE (emulation_packet_base_get_type ())
+#define EMULATION_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBase))
+#define EMULATION_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+#define EMULATION_IS_PACKET_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_IS_PACKET_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_PACKET_BASE))
+#define EMULATION_PACKET_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_PACKET_BASE, EmulationPacketBaseClass))
+
+typedef struct _EmulationPacketBase EmulationPacketBase;
+typedef struct _EmulationPacketBaseClass EmulationPacketBaseClass;
+
+#define EMULATION_TYPE_SPEC (emulation_spec_get_type ())
+#define EMULATION_SPEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_SPEC, EmulationSpec))
+#define EMULATION_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_SPEC, EmulationSpecClass))
+#define EMULATION_IS_SPEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_SPEC))
+#define EMULATION_IS_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_SPEC))
+#define EMULATION_SPEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_SPEC, EmulationSpecClass))
+
+typedef struct _EmulationSpec EmulationSpec;
+typedef struct _EmulationSpecClass EmulationSpecClass;
+
+#define GUI_TYPE_CS_VIEW (gui_cs_view_get_type ())
+#define GUI_CS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CS_VIEW, GUICSView))
+#define GUI_CS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CS_VIEW, GUICSViewClass))
+#define GUI_IS_CS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CS_VIEW))
+#define GUI_IS_CS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CS_VIEW))
+#define GUI_CS_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CS_VIEW, GUICSViewClass))
+
+typedef struct _GUICSView GUICSView;
+typedef struct _GUICSViewClass GUICSViewClass;
+
+struct _GUICActions {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ GUICActionsPrivate * priv;
+ GtkAction* New;
+ GtkAction* Open;
+ GtkAction* Save;
+ GtkAction* SaveAs;
+ GtkAction* RemoveCS;
+ GtkAction* ImportCS;
+ GtkAction* ExportCS;
+ GtkAction* Quit;
+ GtkRadioAction* EmulateR300;
+ GtkRadioAction* EmulateR500;
+};
+
+struct _GUICActionsClass {
+ GTypeClass parent_class;
+ void (*finalize) (GUICActions *self);
+};
+
+typedef enum {
+ EMULATION_CHIP_R300,
+ EMULATION_CHIP_R500
+} EmulationChip;
+
+struct _GUIParamSpecCActions {
+ GParamSpec parent_instance;
+};
+
+struct _GUICMenus {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ GUICMenusPrivate * priv;
+ GtkMenu* file;
+ GtkMenu* edit;
+ GtkMenu* emulation;
+};
+
+struct _GUICMenusClass {
+ GTypeClass parent_class;
+ void (*finalize) (GUICMenus *self);
+};
+
+struct _GUIParamSpecCMenus {
+ GParamSpec parent_instance;
+};
+
+struct _GUICMain {
+ GtkWindow parent_instance;
+ GUICMainPrivate * priv;
+ GUICMenus* menu;
+ GtkMenuBar* menubar;
+ GtkToolbar* toolbar;
+ GtkListStore* cs_store;
+};
+
+struct _GUICMainClass {
+ GtkWindowClass parent_class;
+};
+
+struct _EmulationCS {
+ GObject parent_instance;
+ EmulationCSPrivate * priv;
+ EmulationPacketBase** packets;
+ gint packets_length1;
+ guint32* dwords;
+ gint dwords_length1;
+};
+
+struct _EmulationCSClass {
+ GObjectClass parent_class;
+};
+
+
+static gpointer gui_cactions_parent_class = NULL;
+static gpointer gui_cmenus_parent_class = NULL;
+extern EmulationSpec* r500_registers;
+extern GUICActions* gui_actions;
+static gpointer gui_cmain_parent_class = NULL;
+GUICActions* gui_actions = NULL;
+extern GUICMain* gui_main;
+GUICMain* gui_main = NULL;
+extern EmulationSpec* r300_registers;
+EmulationSpec* r300_registers = NULL;
+EmulationSpec* r500_registers = NULL;
+
+gpointer gui_cactions_ref (gpointer instance);
+void gui_cactions_unref (gpointer instance);
+GParamSpec* gui_param_spec_cactions (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
+void gui_value_set_cactions (GValue* value, gpointer v_object);
+gpointer gui_value_get_cactions (const GValue* value);
+GType gui_cactions_get_type (void);
+enum {
+ GUI_CACTIONS_DUMMY_PROPERTY
+};
+GType emulation_chip_get_type (void);
+GUICSImport* gui_cs_import_new (void);
+GUICSImport* gui_cs_import_construct (GType object_type);
+GType gui_cs_import_get_type (void);
+static void _lambda10_ (GtkAction* source, GUICActions* self);
+static void __lambda10__gtk_action_activate (GtkAction* _sender, gpointer self);
+GUICActions* gui_cactions_new (void);
+GUICActions* gui_cactions_construct (GType object_type);
+static void gui_cactions_finalize (GUICActions* obj);
+gpointer gui_cmenus_ref (gpointer instance);
+void gui_cmenus_unref (gpointer instance);
+GParamSpec* gui_param_spec_cmenus (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
+void gui_value_set_cmenus (GValue* value, gpointer v_object);
+gpointer gui_value_get_cmenus (const GValue* value);
+GType gui_cmenus_get_type (void);
+enum {
+ GUI_CMENUS_DUMMY_PROPERTY
+};
+GUICMenus* gui_cmenus_new (void);
+GUICMenus* gui_cmenus_construct (GType object_type);
+static void gui_cmenus_finalize (GUICMenus* obj);
+GType gui_cmain_get_type (void);
+enum {
+ GUI_CMAIN_DUMMY_PROPERTY
+};
+static void gui_cmain_add_toolitem (GUICMain* self, GtkAction* action);
+GType emulation_cs_get_type (void);
+GType emulation_packet_base_get_type (void);
+static void gui_cmain_dwords_cellrenderer (GUICMain* self, GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter);
+GType emulation_spec_get_type (void);
+GUICSView* gui_cs_view_new (EmulationCS* cs, EmulationSpec* spec);
+GUICSView* gui_cs_view_construct (GType object_type, EmulationCS* cs, EmulationSpec* spec);
+GType gui_cs_view_get_type (void);
+static void gui_cmain_open_csview (GUICMain* self, const GtkTreePath* path, GtkTreeViewColumn* column);
+GUICMain* gui_cmain_new (void);
+GUICMain* gui_cmain_construct (GType object_type);
+static void _gui_cmain_dwords_cellrenderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self);
+static void _gui_cmain_open_csview_gtk_tree_view_row_activated (GtkTreeView* _sender, const GtkTreePath* path, GtkTreeViewColumn* column, gpointer self);
+static void _gtk_main_quit_gtk_object_destroy (GUICMain* _sender, gpointer self);
+static GObject * gui_cmain_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void gui_cmain_finalize (GObject* obj);
+void gui_init (char*** args, int* args_length1);
+EmulationSpec* emulation_spec_new (void);
+EmulationSpec* emulation_spec_construct (GType object_type);
+gboolean emulation_spec_load_xml (EmulationSpec* self, const char* filename, const char* variant);
+gint _main (char** args, int args_length1);
+
+
+
+static void _lambda10_ (GtkAction* source, GUICActions* self) {
+ GUICSImport* d;
+ g_return_if_fail (source != NULL);
+ d = g_object_ref_sink (gui_cs_import_new ());
+ gtk_dialog_run ((GtkDialog*) d);
+ (d == NULL) ? NULL : (d = (g_object_unref (d), NULL));
+}
+
+
+static void __lambda10__gtk_action_activate (GtkAction* _sender, gpointer self) {
+ _lambda10_ (_sender, self);
+}
+
+
+GUICActions* gui_cactions_construct (GType object_type) {
+ GUICActions* self;
+ GtkAction* _tmp0_;
+ GtkAction* _tmp1_;
+ GtkAction* _tmp2_;
+ GtkAction* _tmp3_;
+ GtkAction* _tmp4_;
+ GtkAction* _tmp5_;
+ GtkAction* _tmp6_;
+ GtkAction* _tmp7_;
+ GtkRadioAction* _tmp8_;
+ GtkRadioAction* _tmp9_;
+ self = (GUICActions*) g_type_create_instance (object_type);
+ _tmp0_ = NULL;
+ self->New = (_tmp0_ = gtk_action_new ("New", NULL, NULL, "gtk-new"), (self->New == NULL) ? NULL : (self->New = (g_object_unref (self->New), NULL)), _tmp0_);
+ _tmp1_ = NULL;
+ self->Open = (_tmp1_ = gtk_action_new ("Open", NULL, NULL, "gtk-open"), (self->Open == NULL) ? NULL : (self->Open = (g_object_unref (self->Open), NULL)), _tmp1_);
+ _tmp2_ = NULL;
+ self->Save = (_tmp2_ = gtk_action_new ("Save", NULL, NULL, "gtk-save"), (self->Save == NULL) ? NULL : (self->Save = (g_object_unref (self->Save), NULL)), _tmp2_);
+ _tmp3_ = NULL;
+ self->SaveAs = (_tmp3_ = gtk_action_new ("SaveAs", NULL, NULL, "gtk-save-as"), (self->SaveAs == NULL) ? NULL : (self->SaveAs = (g_object_unref (self->SaveAs), NULL)), _tmp3_);
+ _tmp4_ = NULL;
+ self->RemoveCS = (_tmp4_ = gtk_action_new ("RemoveCS", "Remove", "Remove selected CS' from the list", "gtk-remove"), (self->RemoveCS == NULL) ? NULL : (self->RemoveCS = (g_object_unref (self->RemoveCS), NULL)), _tmp4_);
+ _tmp5_ = NULL;
+ self->ImportCS = (_tmp5_ = gtk_action_new ("ImportCS", "Import", "Import a command stream to the list", "gtk-add"), (self->ImportCS == NULL) ? NULL : (self->ImportCS = (g_object_unref (self->ImportCS), NULL)), _tmp5_);
+ _tmp6_ = NULL;
+ self->ExportCS = (_tmp6_ = gtk_action_new ("ExportCS", "Export", "Export a CS to a file", "gtk-convert"), (self->ExportCS == NULL) ? NULL : (self->ExportCS = (g_object_unref (self->ExportCS), NULL)), _tmp6_);
+ _tmp7_ = NULL;
+ self->Quit = (_tmp7_ = gtk_action_new ("Quit", NULL, NULL, "gtk-quit"), (self->Quit == NULL) ? NULL : (self->Quit = (g_object_unref (self->Quit), NULL)), _tmp7_);
+ _tmp8_ = NULL;
+ self->EmulateR300 = (_tmp8_ = gtk_radio_action_new ("EmulateR300", "R300", "Emulate the R300 register space", NULL, (gint) EMULATION_CHIP_R300), (self->EmulateR300 == NULL) ? NULL : (self->EmulateR300 = (g_object_unref (self->EmulateR300), NULL)), _tmp8_);
+ _tmp9_ = NULL;
+ self->EmulateR500 = (_tmp9_ = gtk_radio_action_new ("EmulateR500", "R500", "Emulate the R500 register space", NULL, (gint) EMULATION_CHIP_R500), (self->EmulateR500 == NULL) ? NULL : (self->EmulateR500 = (g_object_unref (self->EmulateR500), NULL)), _tmp9_);
+ gtk_radio_action_set_group (self->EmulateR500, gtk_radio_action_get_group (self->EmulateR300));
+ gtk_radio_action_set_current_value (self->EmulateR300, (gint) EMULATION_CHIP_R300);
+ g_signal_connect (self->ImportCS, "activate", (GCallback) __lambda10__gtk_action_activate, self);
+ return self;
+}
+
+
+GUICActions* gui_cactions_new (void) {
+ return gui_cactions_construct (GUI_TYPE_CACTIONS);
+}
+
+
+static void gui_value_cactions_init (GValue* value) {
+ value->data[0].v_pointer = NULL;
+}
+
+
+static void gui_value_cactions_free_value (GValue* value) {
+ if (value->data[0].v_pointer) {
+ gui_cactions_unref (value->data[0].v_pointer);
+ }
+}
+
+
+static void gui_value_cactions_copy_value (const GValue* src_value, GValue* dest_value) {
+ if (src_value->data[0].v_pointer) {
+ dest_value->data[0].v_pointer = gui_cactions_ref (src_value->data[0].v_pointer);
+ } else {
+ dest_value->data[0].v_pointer = NULL;
+ }
+}
+
+
+static gpointer gui_value_cactions_peek_pointer (const GValue* value) {
+ return value->data[0].v_pointer;
+}
+
+
+static gchar* gui_value_cactions_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ if (collect_values[0].v_pointer) {
+ GUICActions* object;
+ object = collect_values[0].v_pointer;
+ if (object->parent_instance.g_class == NULL) {
+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ }
+ value->data[0].v_pointer = gui_cactions_ref (object);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ return NULL;
+}
+
+
+static gchar* gui_value_cactions_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ GUICActions** object_p;
+ object_p = collect_values[0].v_pointer;
+ if (!object_p) {
+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+ }
+ if (!value->data[0].v_pointer) {
+ *object_p = NULL;
+ } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
+ *object_p = value->data[0].v_pointer;
+ } else {
+ *object_p = gui_cactions_ref (value->data[0].v_pointer);
+ }
+ return NULL;
+}
+
+
+GParamSpec* gui_param_spec_cactions (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
+ GUIParamSpecCActions* spec;
+ g_return_val_if_fail (g_type_is_a (object_type, GUI_TYPE_CACTIONS), NULL);
+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+ G_PARAM_SPEC (spec)->value_type = object_type;
+ return G_PARAM_SPEC (spec);
+}
+
+
+gpointer gui_value_get_cactions (const GValue* value) {
+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_TYPE_CACTIONS), NULL);
+ return value->data[0].v_pointer;
+}
+
+
+void gui_value_set_cactions (GValue* value, gpointer v_object) {
+ GUICActions* old;
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_TYPE_CACTIONS));
+ old = value->data[0].v_pointer;
+ if (v_object) {
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GUI_TYPE_CACTIONS));
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+ value->data[0].v_pointer = v_object;
+ gui_cactions_ref (value->data[0].v_pointer);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ if (old) {
+ gui_cactions_unref (old);
+ }
+}
+
+
+static void gui_cactions_class_init (GUICActionsClass * klass) {
+ gui_cactions_parent_class = g_type_class_peek_parent (klass);
+ GUI_CACTIONS_CLASS (klass)->finalize = gui_cactions_finalize;
+}
+
+
+static void gui_cactions_instance_init (GUICActions * self) {
+ self->ref_count = 1;
+}
+
+
+static void gui_cactions_finalize (GUICActions* obj) {
+ GUICActions * self;
+ self = GUI_CACTIONS (obj);
+ (self->New == NULL) ? NULL : (self->New = (g_object_unref (self->New), NULL));
+ (self->Open == NULL) ? NULL : (self->Open = (g_object_unref (self->Open), NULL));
+ (self->Save == NULL) ? NULL : (self->Save = (g_object_unref (self->Save), NULL));
+ (self->SaveAs == NULL) ? NULL : (self->SaveAs = (g_object_unref (self->SaveAs), NULL));
+ (self->RemoveCS == NULL) ? NULL : (self->RemoveCS = (g_object_unref (self->RemoveCS), NULL));
+ (self->ImportCS == NULL) ? NULL : (self->ImportCS = (g_object_unref (self->ImportCS), NULL));
+ (self->ExportCS == NULL) ? NULL : (self->ExportCS = (g_object_unref (self->ExportCS), NULL));
+ (self->Quit == NULL) ? NULL : (self->Quit = (g_object_unref (self->Quit), NULL));
+ (self->EmulateR300 == NULL) ? NULL : (self->EmulateR300 = (g_object_unref (self->EmulateR300), NULL));
+ (self->EmulateR500 == NULL) ? NULL : (self->EmulateR500 = (g_object_unref (self->EmulateR500), NULL));
+}
+
+
+GType gui_cactions_get_type (void) {
+ static GType gui_cactions_type_id = 0;
+ if (gui_cactions_type_id == 0) {
+ static const GTypeValueTable g_define_type_value_table = { gui_value_cactions_init, gui_value_cactions_free_value, gui_value_cactions_copy_value, gui_value_cactions_peek_pointer, "p", gui_value_cactions_collect_value, "p", gui_value_cactions_lcopy_value };
+ static const GTypeInfo g_define_type_info = { sizeof (GUICActionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cactions_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICActions), 0, (GInstanceInitFunc) gui_cactions_instance_init, &g_define_type_value_table };
+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
+ gui_cactions_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GUICActions", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ }
+ return gui_cactions_type_id;
+}
+
+
+gpointer gui_cactions_ref (gpointer instance) {
+ GUICActions* self;
+ self = instance;
+ g_atomic_int_inc (&self->ref_count);
+ return instance;
+}
+
+
+void gui_cactions_unref (gpointer instance) {
+ GUICActions* self;
+ self = instance;
+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
+ GUI_CACTIONS_GET_CLASS (self)->finalize (self);
+ g_type_free_instance ((GTypeInstance *) self);
+ }
+}
+
+
+GUICMenus* gui_cmenus_construct (GType object_type) {
+ GUICMenus* self;
+ self = (GUICMenus*) g_type_create_instance (object_type);
+ return self;
+}
+
+
+GUICMenus* gui_cmenus_new (void) {
+ return gui_cmenus_construct (GUI_TYPE_CMENUS);
+}
+
+
+static void gui_value_cmenus_init (GValue* value) {
+ value->data[0].v_pointer = NULL;
+}
+
+
+static void gui_value_cmenus_free_value (GValue* value) {
+ if (value->data[0].v_pointer) {
+ gui_cmenus_unref (value->data[0].v_pointer);
+ }
+}
+
+
+static void gui_value_cmenus_copy_value (const GValue* src_value, GValue* dest_value) {
+ if (src_value->data[0].v_pointer) {
+ dest_value->data[0].v_pointer = gui_cmenus_ref (src_value->data[0].v_pointer);
+ } else {
+ dest_value->data[0].v_pointer = NULL;
+ }
+}
+
+
+static gpointer gui_value_cmenus_peek_pointer (const GValue* value) {
+ return value->data[0].v_pointer;
+}
+
+
+static gchar* gui_value_cmenus_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ if (collect_values[0].v_pointer) {
+ GUICMenus* object;
+ object = collect_values[0].v_pointer;
+ if (object->parent_instance.g_class == NULL) {
+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ }
+ value->data[0].v_pointer = gui_cmenus_ref (object);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ return NULL;
+}
+
+
+static gchar* gui_value_cmenus_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ GUICMenus** object_p;
+ object_p = collect_values[0].v_pointer;
+ if (!object_p) {
+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+ }
+ if (!value->data[0].v_pointer) {
+ *object_p = NULL;
+ } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
+ *object_p = value->data[0].v_pointer;
+ } else {
+ *object_p = gui_cmenus_ref (value->data[0].v_pointer);
+ }
+ return NULL;
+}
+
+
+GParamSpec* gui_param_spec_cmenus (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
+ GUIParamSpecCMenus* spec;
+ g_return_val_if_fail (g_type_is_a (object_type, GUI_TYPE_CMENUS), NULL);
+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+ G_PARAM_SPEC (spec)->value_type = object_type;
+ return G_PARAM_SPEC (spec);
+}
+
+
+gpointer gui_value_get_cmenus (const GValue* value) {
+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_TYPE_CMENUS), NULL);
+ return value->data[0].v_pointer;
+}
+
+
+void gui_value_set_cmenus (GValue* value, gpointer v_object) {
+ GUICMenus* old;
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GUI_TYPE_CMENUS));
+ old = value->data[0].v_pointer;
+ if (v_object) {
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GUI_TYPE_CMENUS));
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+ value->data[0].v_pointer = v_object;
+ gui_cmenus_ref (value->data[0].v_pointer);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ if (old) {
+ gui_cmenus_unref (old);
+ }
+}
+
+
+static void gui_cmenus_class_init (GUICMenusClass * klass) {
+ gui_cmenus_parent_class = g_type_class_peek_parent (klass);
+ GUI_CMENUS_CLASS (klass)->finalize = gui_cmenus_finalize;
+}
+
+
+static void gui_cmenus_instance_init (GUICMenus * self) {
+ self->ref_count = 1;
+}
+
+
+static void gui_cmenus_finalize (GUICMenus* obj) {
+ GUICMenus * self;
+ self = GUI_CMENUS (obj);
+ (self->file == NULL) ? NULL : (self->file = (g_object_unref (self->file), NULL));
+ (self->edit == NULL) ? NULL : (self->edit = (g_object_unref (self->edit), NULL));
+ (self->emulation == NULL) ? NULL : (self->emulation = (g_object_unref (self->emulation), NULL));
+}
+
+
+GType gui_cmenus_get_type (void) {
+ static GType gui_cmenus_type_id = 0;
+ if (gui_cmenus_type_id == 0) {
+ static const GTypeValueTable g_define_type_value_table = { gui_value_cmenus_init, gui_value_cmenus_free_value, gui_value_cmenus_copy_value, gui_value_cmenus_peek_pointer, "p", gui_value_cmenus_collect_value, "p", gui_value_cmenus_lcopy_value };
+ static const GTypeInfo g_define_type_info = { sizeof (GUICMenusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cmenus_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICMenus), 0, (GInstanceInitFunc) gui_cmenus_instance_init, &g_define_type_value_table };
+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
+ gui_cmenus_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GUICMenus", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ }
+ return gui_cmenus_type_id;
+}
+
+
+gpointer gui_cmenus_ref (gpointer instance) {
+ GUICMenus* self;
+ self = instance;
+ g_atomic_int_inc (&self->ref_count);
+ return instance;
+}
+
+
+void gui_cmenus_unref (gpointer instance) {
+ GUICMenus* self;
+ self = instance;
+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
+ GUI_CMENUS_GET_CLASS (self)->finalize (self);
+ g_type_free_instance ((GTypeInstance *) self);
+ }
+}
+
+
+static void gui_cmain_add_toolitem (GUICMain* self, GtkAction* action) {
+ GtkToolItem* _tmp1_;
+ GtkWidget* _tmp0_;
+ GtkToolItem* titem;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (action != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ titem = (_tmp1_ = (_tmp0_ = gtk_action_create_tool_item (action), GTK_IS_TOOL_ITEM (_tmp0_) ? ((GtkToolItem*) _tmp0_) : NULL), (_tmp1_ == NULL) ? NULL : g_object_ref (_tmp1_));
+ gtk_tool_item_set_homogeneous (titem, FALSE);
+ gtk_toolbar_insert (self->toolbar, titem, -1);
+ (titem == NULL) ? NULL : (titem = (g_object_unref (titem), NULL));
+}
+
+
+static void gui_cmain_dwords_cellrenderer (GUICMain* self, GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* model, GtkTreeIter* iter) {
+ EmulationCS* cs;
+ char* _tmp0_;
+ GtkCellRenderer* _tmp1_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (tree_column != NULL);
+ g_return_if_fail (cell != NULL);
+ g_return_if_fail (model != NULL);
+ cs = NULL;
+ gtk_tree_model_get (model, &(*iter), 1, &cs, -1, -1);
+ g_assert (cs != NULL);
+ _tmp0_ = NULL;
+ _tmp1_ = NULL;
+ g_object_set ((_tmp1_ = cell, GTK_IS_CELL_RENDERER_TEXT (_tmp1_) ? ((GtkCellRendererText*) _tmp1_) : NULL), "text", _tmp0_ = g_strdup_printf ("%i", cs->dwords_length1), NULL);
+ _tmp0_ = (g_free (_tmp0_), NULL);
+ (cs == NULL) ? NULL : (cs = (g_object_unref (cs), NULL));
+}
+
+
+static void gui_cmain_open_csview (GUICMain* self, const GtkTreePath* path, GtkTreeViewColumn* column) {
+ GtkTreeIter iter = {0};
+ EmulationCS* cs;
+ GUICSView* csv;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (column != NULL);
+ cs = NULL;
+ gtk_tree_model_get_iter ((GtkTreeModel*) self->cs_store, &iter, path);
+ gtk_tree_model_get ((GtkTreeModel*) self->cs_store, &iter, 1, &cs, -1, -1);
+ csv = g_object_ref_sink (gui_cs_view_new (cs, r500_registers));
+ gtk_widget_show_all ((GtkWidget*) csv);
+ (cs == NULL) ? NULL : (cs = (g_object_unref (cs), NULL));
+ (csv == NULL) ? NULL : (csv = (g_object_unref (csv), NULL));
+}
+
+
+GUICMain* gui_cmain_construct (GType object_type) {
+ GUICMain * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+GUICMain* gui_cmain_new (void) {
+ return gui_cmain_construct (GUI_TYPE_CMAIN);
+}
+
+
+static void _gui_cmain_dwords_cellrenderer_gtk_tree_cell_data_func (GtkTreeViewColumn* tree_column, GtkCellRenderer* cell, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer self) {
+ gui_cmain_dwords_cellrenderer (self, tree_column, cell, tree_model, iter);
+}
+
+
+static void _gui_cmain_open_csview_gtk_tree_view_row_activated (GtkTreeView* _sender, const GtkTreePath* path, GtkTreeViewColumn* column, gpointer self) {
+ gui_cmain_open_csview (self, path, column);
+}
+
+
+static void _gtk_main_quit_gtk_object_destroy (GUICMain* _sender, gpointer self) {
+ gtk_main_quit ();
+}
+
+
+static GObject * gui_cmain_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ GUICMainClass * klass;
+ GObjectClass * parent_class;
+ GUICMain * self;
+ klass = GUI_CMAIN_CLASS (g_type_class_peek (GUI_TYPE_CMAIN));
+ parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = GUI_CMAIN (obj);
+ {
+ GUICMenus* _tmp0_;
+ GtkToolbar* _tmp1_;
+ GtkToolItem* _tmp3_;
+ GtkSeparatorToolItem* _tmp2_;
+ GtkMenu* _tmp4_;
+ GtkWidget* _tmp5_;
+ GtkWidget* _tmp6_;
+ GtkWidget* _tmp7_;
+ GtkWidget* _tmp8_;
+ GtkMenuItem* _tmp10_;
+ GtkSeparatorMenuItem* _tmp9_;
+ GtkWidget* _tmp11_;
+ GtkMenuItem* menu_file_item;
+ GtkMenu* _tmp12_;
+ GtkWidget* _tmp13_;
+ GtkWidget* _tmp14_;
+ GtkWidget* _tmp15_;
+ GtkMenuItem* menu_edit_item;
+ GtkMenu* _tmp16_;
+ GtkWidget* _tmp17_;
+ GtkWidget* _tmp18_;
+ GtkMenuItem* menu_emulation_item;
+ GtkMenuBar* _tmp19_;
+ GtkListStore* _tmp20_;
+ GtkTreeView* cslist;
+ GtkCellRendererText* _tmp21_;
+ GtkCellRendererText* _tmp22_;
+ GtkScrolledWindow* sw;
+ GtkVBox* mainbox;
+ _tmp0_ = NULL;
+ self->menu = (_tmp0_ = gui_cmenus_new (), (self->menu == NULL) ? NULL : (self->menu = (gui_cmenus_unref (self->menu), NULL)), _tmp0_);
+ _tmp1_ = NULL;
+ self->toolbar = (_tmp1_ = g_object_ref_sink ((GtkToolbar*) gtk_toolbar_new ()), (self->toolbar == NULL) ? NULL : (self->toolbar = (g_object_unref (self->toolbar), NULL)), _tmp1_);
+ gui_cmain_add_toolitem (self, gui_actions->New);
+ gui_cmain_add_toolitem (self, gui_actions->Open);
+ gui_cmain_add_toolitem (self, gui_actions->Save);
+ _tmp3_ = NULL;
+ _tmp2_ = NULL;
+ gtk_toolbar_insert (self->toolbar, _tmp3_ = (_tmp2_ = g_object_ref_sink ((GtkSeparatorToolItem*) gtk_separator_tool_item_new ()), GTK_IS_TOOL_ITEM (_tmp2_) ? ((GtkToolItem*) _tmp2_) : NULL), -1);
+ (_tmp3_ == NULL) ? NULL : (_tmp3_ = (g_object_unref (_tmp3_), NULL));
+ gui_cmain_add_toolitem (self, gui_actions->RemoveCS);
+ gui_cmain_add_toolitem (self, gui_actions->ImportCS);
+ gui_cmain_add_toolitem (self, gui_actions->ExportCS);
+ _tmp4_ = NULL;
+ self->menu->file = (_tmp4_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->file == NULL) ? NULL : (self->menu->file = (g_object_unref (self->menu->file), NULL)), _tmp4_);
+ _tmp5_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp5_ = gtk_action_create_menu_item (gui_actions->New), GTK_IS_MENU_ITEM (_tmp5_) ? ((GtkMenuItem*) _tmp5_) : NULL));
+ _tmp6_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp6_ = gtk_action_create_menu_item (gui_actions->Open), GTK_IS_MENU_ITEM (_tmp6_) ? ((GtkMenuItem*) _tmp6_) : NULL));
+ _tmp7_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp7_ = gtk_action_create_menu_item (gui_actions->Save), GTK_IS_MENU_ITEM (_tmp7_) ? ((GtkMenuItem*) _tmp7_) : NULL));
+ _tmp8_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp8_ = gtk_action_create_menu_item (gui_actions->SaveAs), GTK_IS_MENU_ITEM (_tmp8_) ? ((GtkMenuItem*) _tmp8_) : NULL));
+ _tmp10_ = NULL;
+ _tmp9_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp10_ = (_tmp9_ = g_object_ref_sink ((GtkSeparatorMenuItem*) gtk_separator_menu_item_new ()), GTK_IS_MENU_ITEM (_tmp9_) ? ((GtkMenuItem*) _tmp9_) : NULL)));
+ (_tmp10_ == NULL) ? NULL : (_tmp10_ = (g_object_unref (_tmp10_), NULL));
+ _tmp11_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->file, (GtkWidget*) (_tmp11_ = gtk_action_create_menu_item (gui_actions->Quit), GTK_IS_MENU_ITEM (_tmp11_) ? ((GtkMenuItem*) _tmp11_) : NULL));
+ menu_file_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("File"));
+ gtk_menu_item_set_submenu (menu_file_item, self->menu->file);
+ _tmp12_ = NULL;
+ self->menu->edit = (_tmp12_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->edit == NULL) ? NULL : (self->menu->edit = (g_object_unref (self->menu->edit), NULL)), _tmp12_);
+ _tmp13_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp13_ = gtk_action_create_menu_item (gui_actions->RemoveCS), GTK_IS_MENU_ITEM (_tmp13_) ? ((GtkMenuItem*) _tmp13_) : NULL));
+ _tmp14_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp14_ = gtk_action_create_menu_item (gui_actions->ImportCS), GTK_IS_MENU_ITEM (_tmp14_) ? ((GtkMenuItem*) _tmp14_) : NULL));
+ _tmp15_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->edit, (GtkWidget*) (_tmp15_ = gtk_action_create_menu_item (gui_actions->ExportCS), GTK_IS_MENU_ITEM (_tmp15_) ? ((GtkMenuItem*) _tmp15_) : NULL));
+ menu_edit_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("Edit"));
+ gtk_menu_item_set_submenu (menu_edit_item, self->menu->edit);
+ _tmp16_ = NULL;
+ self->menu->emulation = (_tmp16_ = g_object_ref_sink ((GtkMenu*) gtk_menu_new ()), (self->menu->emulation == NULL) ? NULL : (self->menu->emulation = (g_object_unref (self->menu->emulation), NULL)), _tmp16_);
+ _tmp17_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->emulation, (GtkWidget*) (_tmp17_ = gtk_action_create_menu_item ((GtkAction*) gui_actions->EmulateR300), GTK_IS_MENU_ITEM (_tmp17_) ? ((GtkMenuItem*) _tmp17_) : NULL));
+ _tmp18_ = NULL;
+ gtk_menu_shell_append ((GtkMenuShell*) self->menu->emulation, (GtkWidget*) (_tmp18_ = gtk_action_create_menu_item ((GtkAction*) gui_actions->EmulateR500), GTK_IS_MENU_ITEM (_tmp18_) ? ((GtkMenuItem*) _tmp18_) : NULL));
+ menu_emulation_item = g_object_ref_sink ((GtkMenuItem*) gtk_menu_item_new_with_label ("Emulation"));
+ gtk_menu_item_set_submenu (menu_emulation_item, self->menu->emulation);
+ _tmp19_ = NULL;
+ self->menubar = (_tmp19_ = g_object_ref_sink ((GtkMenuBar*) gtk_menu_bar_new ()), (self->menubar == NULL) ? NULL : (self->menubar = (g_object_unref (self->menubar), NULL)), _tmp19_);
+ gtk_menu_shell_append ((GtkMenuShell*) self->menubar, (GtkWidget*) menu_file_item);
+ gtk_menu_shell_append ((GtkMenuShell*) self->menubar, (GtkWidget*) menu_edit_item);
+ gtk_menu_shell_append ((GtkMenuShell*) self->menubar, (GtkWidget*) menu_emulation_item);
+ _tmp20_ = NULL;
+ self->cs_store = (_tmp20_ = gtk_list_store_new (2, G_TYPE_STRING, EMULATION_TYPE_CS, NULL), (self->cs_store == NULL) ? NULL : (self->cs_store = (g_object_unref (self->cs_store), NULL)), _tmp20_);
+ cslist = g_object_ref_sink ((GtkTreeView*) gtk_tree_view_new ());
+ _tmp21_ = NULL;
+ gtk_tree_view_insert_column_with_data_func (cslist, -1, "DWORDs", (GtkCellRenderer*) (_tmp21_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), _gui_cmain_dwords_cellrenderer_gtk_tree_cell_data_func, g_object_ref (self), g_object_unref);
+ (_tmp21_ == NULL) ? NULL : (_tmp21_ = (g_object_unref (_tmp21_), NULL));
+ _tmp22_ = NULL;
+ gtk_tree_view_insert_column_with_attributes (cslist, -1, "Name", (GtkCellRenderer*) (_tmp22_ = g_object_ref_sink ((GtkCellRendererText*) gtk_cell_renderer_text_new ())), "text", 0, NULL, NULL);
+ (_tmp22_ == NULL) ? NULL : (_tmp22_ = (g_object_unref (_tmp22_), NULL));
+ gtk_tree_view_set_model (cslist, (GtkTreeModel*) self->cs_store);
+ g_signal_connect_object (cslist, "row-activated", (GCallback) _gui_cmain_open_csview_gtk_tree_view_row_activated, self, 0);
+ sw = g_object_ref_sink ((GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL));
+ g_object_set (sw, "hscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ g_object_set (sw, "vscrollbar-policy", GTK_POLICY_AUTOMATIC, NULL);
+ gtk_container_add ((GtkContainer*) sw, (GtkWidget*) cslist);
+ mainbox = g_object_ref_sink ((GtkVBox*) gtk_vbox_new (FALSE, 0));
+ gtk_box_pack_start ((GtkBox*) mainbox, (GtkWidget*) self->menubar, FALSE, TRUE, (guint) 0);
+ gtk_box_pack_start ((GtkBox*) mainbox, (GtkWidget*) self->toolbar, FALSE, TRUE, (guint) 0);
+ gtk_box_pack_start ((GtkBox*) mainbox, (GtkWidget*) sw, TRUE, TRUE, (guint) 0);
+ gtk_widget_set_size_request ((GtkWidget*) self, 400, 200);
+ gtk_window_set_title ((GtkWindow*) self, "Radeon Simulator");
+ gtk_container_add ((GtkContainer*) self, (GtkWidget*) mainbox);
+ g_signal_connect ((GtkObject*) self, "destroy", (GCallback) _gtk_main_quit_gtk_object_destroy, NULL);
+ gtk_widget_show_all ((GtkWidget*) self);
+ (menu_file_item == NULL) ? NULL : (menu_file_item = (g_object_unref (menu_file_item), NULL));
+ (menu_edit_item == NULL) ? NULL : (menu_edit_item = (g_object_unref (menu_edit_item), NULL));
+ (menu_emulation_item == NULL) ? NULL : (menu_emulation_item = (g_object_unref (menu_emulation_item), NULL));
+ (cslist == NULL) ? NULL : (cslist = (g_object_unref (cslist), NULL));
+ (sw == NULL) ? NULL : (sw = (g_object_unref (sw), NULL));
+ (mainbox == NULL) ? NULL : (mainbox = (g_object_unref (mainbox), NULL));
+ }
+ return obj;
+}
+
+
+static void gui_cmain_class_init (GUICMainClass * klass) {
+ gui_cmain_parent_class = g_type_class_peek_parent (klass);
+ G_OBJECT_CLASS (klass)->constructor = gui_cmain_constructor;
+ G_OBJECT_CLASS (klass)->finalize = gui_cmain_finalize;
+}
+
+
+static void gui_cmain_instance_init (GUICMain * self) {
+}
+
+
+static void gui_cmain_finalize (GObject* obj) {
+ GUICMain * self;
+ self = GUI_CMAIN (obj);
+ (self->menu == NULL) ? NULL : (self->menu = (gui_cmenus_unref (self->menu), NULL));
+ (self->menubar == NULL) ? NULL : (self->menubar = (g_object_unref (self->menubar), NULL));
+ (self->toolbar == NULL) ? NULL : (self->toolbar = (g_object_unref (self->toolbar), NULL));
+ (self->cs_store == NULL) ? NULL : (self->cs_store = (g_object_unref (self->cs_store), NULL));
+ G_OBJECT_CLASS (gui_cmain_parent_class)->finalize (obj);
+}
+
+
+GType gui_cmain_get_type (void) {
+ static GType gui_cmain_type_id = 0;
+ if (gui_cmain_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (GUICMainClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gui_cmain_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GUICMain), 0, (GInstanceInitFunc) gui_cmain_instance_init, NULL };
+ gui_cmain_type_id = g_type_register_static (GTK_TYPE_WINDOW, "GUICMain", &g_define_type_info, 0);
+ }
+ return gui_cmain_type_id;
+}
+
+
+void gui_init (char*** args, int* args_length1) {
+ GUICActions* _tmp0_;
+ GUICMain* _tmp1_;
+ gtk_init (&(*args_length1), &(*args));
+ _tmp0_ = NULL;
+ gui_actions = (_tmp0_ = gui_cactions_new (), (gui_actions == NULL) ? NULL : (gui_actions = (gui_cactions_unref (gui_actions), NULL)), _tmp0_);
+ _tmp1_ = NULL;
+ gui_main = (_tmp1_ = g_object_ref_sink (gui_cmain_new ()), (gui_main == NULL) ? NULL : (gui_main = (g_object_unref (gui_main), NULL)), _tmp1_);
+ gtk_main ();
+}
+
+
+gint _main (char** args, int args_length1) {
+ gint result;
+ EmulationSpec* _tmp0_;
+ EmulationSpec* _tmp1_;
+ _tmp0_ = NULL;
+ r300_registers = (_tmp0_ = emulation_spec_new (), (r300_registers == NULL) ? NULL : (r300_registers = (g_object_unref (r300_registers), NULL)), _tmp0_);
+ _tmp1_ = NULL;
+ r500_registers = (_tmp1_ = emulation_spec_new (), (r500_registers == NULL) ? NULL : (r500_registers = (g_object_unref (r500_registers), NULL)), _tmp1_);
+ emulation_spec_load_xml (r300_registers, "r300reg.xml", "r300");
+ emulation_spec_load_xml (r500_registers, "r300reg.xml", "r500");
+ gui_init (&args, &args_length1);
+ g_object_unref ((GObject*) r300_registers);
+ g_object_unref ((GObject*) r500_registers);
+ result = 0;
+ return result;
+}
+
+
+int main (int argc, char ** argv) {
+ g_type_init ();
+ return _main (argv, argc);
+}
+
+
+
+
diff --git a/src/main.vala b/src/main.vala
new file mode 100644
index 0000000..4a55e92
--- /dev/null
+++ b/src/main.vala
@@ -0,0 +1,171 @@
+using Emulation;
+using Gtk;
+
+namespace GUI
+{
+ public class CActions
+ {
+ public Action New;
+ public Action Open;
+ public Action Save;
+ public Action SaveAs;
+ public Action RemoveCS;
+ public Action ImportCS;
+ public Action ExportCS;
+ public Action Quit;
+
+ public RadioAction EmulateR300;
+ public RadioAction EmulateR500;
+
+ public CActions()
+ {
+ New = new Action("New", null, null, "gtk-new");
+ Open = new Action("Open", null, null, "gtk-open");
+ Save = new Action("Save", null, null, "gtk-save");
+ SaveAs = new Action("SaveAs", null, null, "gtk-save-as");
+ RemoveCS = new Action("RemoveCS", "Remove", "Remove selected CS' from the list", "gtk-remove");
+ ImportCS = new Action("ImportCS", "Import", "Import a command stream to the list", "gtk-add");
+ ExportCS = new Action("ExportCS", "Export", "Export a CS to a file", "gtk-convert");
+ Quit = new Action("Quit", null, null, "gtk-quit");
+
+ EmulateR300 = new RadioAction("EmulateR300", "R300", "Emulate the R300 register space", null, Chip.R300);
+ EmulateR500 = new RadioAction("EmulateR500", "R500", "Emulate the R500 register space", null, Chip.R500);
+ EmulateR500.set_group(EmulateR300.get_group());
+ EmulateR300.set_current_value(Chip.R300);
+
+ ImportCS.activate += ((source) => { var d = new CSImport(); d.run(); });
+ }
+ }
+
+ public class CMenus
+ {
+ public Menu file;
+ public Menu edit;
+ public Menu emulation;
+ }
+
+ public class CMain : Window
+ {
+ public CMenus menu;
+ public MenuBar menubar;
+ public Toolbar toolbar;
+ public ListStore cs_store;
+
+ construct {
+ menu = new CMenus();
+
+ toolbar = new Toolbar();
+ add_toolitem(actions.New);
+ add_toolitem(actions.Open);
+ add_toolitem(actions.Save);
+ toolbar.insert(new SeparatorToolItem() as ToolItem, -1);
+ add_toolitem(actions.RemoveCS);
+ add_toolitem(actions.ImportCS);
+ add_toolitem(actions.ExportCS);
+
+ menu.file = new Menu();
+ menu.file.append(actions.New.create_menu_item() as MenuItem);
+ menu.file.append(actions.Open.create_menu_item() as MenuItem);
+ menu.file.append(actions.Save.create_menu_item() as MenuItem);
+ menu.file.append(actions.SaveAs.create_menu_item() as MenuItem);
+ menu.file.append(new SeparatorMenuItem() as MenuItem);
+ menu.file.append(actions.Quit.create_menu_item() as MenuItem);
+ var menu_file_item = new MenuItem.with_label("File");
+ menu_file_item.submenu = menu.file;
+
+ menu.edit = new Menu();
+ menu.edit.append(actions.RemoveCS.create_menu_item() as MenuItem);
+ menu.edit.append(actions.ImportCS.create_menu_item() as MenuItem);
+ menu.edit.append(actions.ExportCS.create_menu_item() as MenuItem);
+ var menu_edit_item = new MenuItem.with_label("Edit");
+ menu_edit_item.submenu = menu.edit;
+
+ menu.emulation = new Menu();
+ menu.emulation.append(actions.EmulateR300.create_menu_item() as MenuItem);
+ menu.emulation.append(actions.EmulateR500.create_menu_item() as MenuItem);
+ var menu_emulation_item = new MenuItem.with_label("Emulation");
+ menu_emulation_item.submenu = menu.emulation;
+
+ menubar = new MenuBar();
+ menubar.append(menu_file_item);
+ menubar.append(menu_edit_item);
+ menubar.append(menu_emulation_item);
+
+ cs_store = new ListStore(2, typeof(string), typeof(CS));
+ var cslist = new TreeView();
+ cslist.insert_column_with_data_func(-1, "DWORDs", new CellRendererText(), dwords_cellrenderer);
+ cslist.insert_column_with_attributes(-1, "Name", new CellRendererText(), "text", 0, null);
+ cslist.set_model(cs_store);
+ cslist.row_activated += open_csview;
+
+ var sw = new ScrolledWindow(null, null);
+ sw.hscrollbar_policy = PolicyType.AUTOMATIC;
+ sw.vscrollbar_policy = PolicyType.AUTOMATIC;
+ sw.add(cslist);
+
+ var mainbox = new VBox(false, 0);
+ mainbox.pack_start(menubar, false, true, 0);
+ mainbox.pack_start(toolbar, false, true, 0);
+ mainbox.pack_start(sw, true, true, 0);
+
+ set_size_request(400, 200);
+ title = "Radeon Simulator";
+ add(mainbox);
+ destroy += main_quit;
+
+ show_all();
+ }
+
+ private void add_toolitem(Action action)
+ {
+ ToolItem titem = action.create_tool_item() as ToolItem;
+ titem.set_homogeneous(false);
+ toolbar.insert(titem, -1);
+ }
+
+ private void dwords_cellrenderer(TreeViewColumn tree_column, CellRenderer cell, TreeModel model, TreeIter iter)
+ {
+ CS cs;
+ model.get(iter, 1, out cs, -1);
+ assert(cs != null);
+ (cell as CellRendererText).text = cs.dwords.length.to_string();
+ }
+
+ private void open_csview(TreePath path, TreeViewColumn column)
+ {
+ TreeIter iter;
+ CS cs;
+ cs_store.get_iter(out iter, path);
+ cs_store.get(iter, 1, out cs, -1);
+
+ var csv = new CSView(cs, r500_registers);
+ csv.show_all();
+ }
+ }
+
+ public static CActions actions;
+ public static CMain main;
+
+ static void init(ref unowned string[] args)
+ {
+ Gtk.init(ref args);
+ actions = new CActions();
+ main = new CMain();
+ Gtk.main();
+ }
+}
+
+public Spec r300_registers;
+public Spec r500_registers;
+
+public static int main(string[] args)
+{
+ r300_registers = new Spec();
+ r500_registers = new Spec();
+ r300_registers.load_xml("r300reg.xml", "r300");
+ r500_registers.load_xml("r300reg.xml", "r500");
+ GUI.init(ref args);
+ r300_registers.unref();
+ r500_registers.unref();
+ return 0;
+}
diff --git a/src/registers.c b/src/registers.c
new file mode 100644
index 0000000..93db199
--- /dev/null
+++ b/src/registers.c
@@ -0,0 +1,2951 @@
+
+#include <glib.h>
+#include <glib-object.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+#include <stdio.h>
+#include <gobject/gvaluecollector.h>
+
+
+#define EMULATION_TYPE_ACCESS_TYPE (emulation_access_type_get_type ())
+
+#define EMULATION_TYPE_BITFIELD_VALUE (emulation_bitfield_value_get_type ())
+#define EMULATION_BITFIELD_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_BITFIELD_VALUE, EmulationBitfieldValue))
+#define EMULATION_BITFIELD_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_BITFIELD_VALUE, EmulationBitfieldValueClass))
+#define EMULATION_IS_BITFIELD_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_BITFIELD_VALUE))
+#define EMULATION_IS_BITFIELD_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_BITFIELD_VALUE))
+#define EMULATION_BITFIELD_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_BITFIELD_VALUE, EmulationBitfieldValueClass))
+
+typedef struct _EmulationBitfieldValue EmulationBitfieldValue;
+typedef struct _EmulationBitfieldValueClass EmulationBitfieldValueClass;
+typedef struct _EmulationBitfieldValuePrivate EmulationBitfieldValuePrivate;
+
+#define EMULATION_TYPE_BITFIELD_ENUM (emulation_bitfield_enum_get_type ())
+#define EMULATION_BITFIELD_ENUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_BITFIELD_ENUM, EmulationBitfieldEnum))
+#define EMULATION_BITFIELD_ENUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_BITFIELD_ENUM, EmulationBitfieldEnumClass))
+#define EMULATION_IS_BITFIELD_ENUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_BITFIELD_ENUM))
+#define EMULATION_IS_BITFIELD_ENUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_BITFIELD_ENUM))
+#define EMULATION_BITFIELD_ENUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_BITFIELD_ENUM, EmulationBitfieldEnumClass))
+
+typedef struct _EmulationBitfieldEnum EmulationBitfieldEnum;
+typedef struct _EmulationBitfieldEnumClass EmulationBitfieldEnumClass;
+typedef struct _EmulationBitfieldEnumPrivate EmulationBitfieldEnumPrivate;
+
+#define EMULATION_TYPE_BITFIELD (emulation_bitfield_get_type ())
+#define EMULATION_BITFIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_BITFIELD, EmulationBitfield))
+#define EMULATION_BITFIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_BITFIELD, EmulationBitfieldClass))
+#define EMULATION_IS_BITFIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_BITFIELD))
+#define EMULATION_IS_BITFIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_BITFIELD))
+#define EMULATION_BITFIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_BITFIELD, EmulationBitfieldClass))
+
+typedef struct _EmulationBitfield EmulationBitfield;
+typedef struct _EmulationBitfieldClass EmulationBitfieldClass;
+typedef struct _EmulationBitfieldPrivate EmulationBitfieldPrivate;
+
+#define EMULATION_TYPE_BITFIELD_ITERATOR (emulation_bitfield_iterator_get_type ())
+#define EMULATION_BITFIELD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_BITFIELD_ITERATOR, EmulationBitfieldIterator))
+#define EMULATION_BITFIELD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_BITFIELD_ITERATOR, EmulationBitfieldIteratorClass))
+#define EMULATION_IS_BITFIELD_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_BITFIELD_ITERATOR))
+#define EMULATION_IS_BITFIELD_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_BITFIELD_ITERATOR))
+#define EMULATION_BITFIELD_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_BITFIELD_ITERATOR, EmulationBitfieldIteratorClass))
+
+typedef struct _EmulationBitfieldIterator EmulationBitfieldIterator;
+typedef struct _EmulationBitfieldIteratorClass EmulationBitfieldIteratorClass;
+typedef struct _EmulationBitfieldIteratorPrivate EmulationBitfieldIteratorPrivate;
+typedef struct _EmulationParamSpecBitfieldIterator EmulationParamSpecBitfieldIterator;
+
+#define EMULATION_TYPE_REGISTER_INFO (emulation_register_info_get_type ())
+#define EMULATION_REGISTER_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfo))
+#define EMULATION_REGISTER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoClass))
+#define EMULATION_IS_REGISTER_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_INFO))
+#define EMULATION_IS_REGISTER_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_INFO))
+#define EMULATION_REGISTER_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoClass))
+
+typedef struct _EmulationRegisterInfo EmulationRegisterInfo;
+typedef struct _EmulationRegisterInfoClass EmulationRegisterInfoClass;
+typedef struct _EmulationRegisterInfoPrivate EmulationRegisterInfoPrivate;
+
+#define EMULATION_TYPE_REGISTER (emulation_register_get_type ())
+#define EMULATION_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER, EmulationRegister))
+#define EMULATION_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER, EmulationRegisterClass))
+#define EMULATION_IS_REGISTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER))
+#define EMULATION_IS_REGISTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER))
+#define EMULATION_REGISTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER, EmulationRegisterClass))
+
+typedef struct _EmulationRegister EmulationRegister;
+typedef struct _EmulationRegisterClass EmulationRegisterClass;
+typedef struct _EmulationRegisterPrivate EmulationRegisterPrivate;
+
+#define EMULATION_TYPE_REGISTER_ITERATOR (emulation_register_iterator_get_type ())
+#define EMULATION_REGISTER_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_ITERATOR, EmulationRegisterIterator))
+#define EMULATION_REGISTER_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_ITERATOR, EmulationRegisterIteratorClass))
+#define EMULATION_IS_REGISTER_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_ITERATOR))
+#define EMULATION_IS_REGISTER_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_ITERATOR))
+#define EMULATION_REGISTER_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_ITERATOR, EmulationRegisterIteratorClass))
+
+typedef struct _EmulationRegisterIterator EmulationRegisterIterator;
+typedef struct _EmulationRegisterIteratorClass EmulationRegisterIteratorClass;
+typedef struct _EmulationRegisterIteratorPrivate EmulationRegisterIteratorPrivate;
+typedef struct _EmulationParamSpecRegisterIterator EmulationParamSpecRegisterIterator;
+
+#define EMULATION_TYPE_REGISTER_LIST (emulation_register_list_get_type ())
+#define EMULATION_REGISTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterList))
+#define EMULATION_REGISTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListClass))
+#define EMULATION_IS_REGISTER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_REGISTER_LIST))
+#define EMULATION_IS_REGISTER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_REGISTER_LIST))
+#define EMULATION_REGISTER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListClass))
+
+typedef struct _EmulationRegisterList EmulationRegisterList;
+typedef struct _EmulationRegisterListClass EmulationRegisterListClass;
+typedef struct _EmulationRegisterListPrivate EmulationRegisterListPrivate;
+
+#define EMULATION_TYPE_SPEC_PARSER (emulation_spec_parser_get_type ())
+#define EMULATION_SPEC_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_SPEC_PARSER, EmulationSpecParser))
+#define EMULATION_SPEC_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_SPEC_PARSER, EmulationSpecParserClass))
+#define EMULATION_IS_SPEC_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_SPEC_PARSER))
+#define EMULATION_IS_SPEC_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_SPEC_PARSER))
+#define EMULATION_SPEC_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_SPEC_PARSER, EmulationSpecParserClass))
+
+typedef struct _EmulationSpecParser EmulationSpecParser;
+typedef struct _EmulationSpecParserClass EmulationSpecParserClass;
+typedef struct _EmulationSpecParserPrivate EmulationSpecParserPrivate;
+typedef struct _EmulationParamSpecSpecParser EmulationParamSpecSpecParser;
+
+#define EMULATION_TYPE_SPEC (emulation_spec_get_type ())
+#define EMULATION_SPEC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMULATION_TYPE_SPEC, EmulationSpec))
+#define EMULATION_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EMULATION_TYPE_SPEC, EmulationSpecClass))
+#define EMULATION_IS_SPEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMULATION_TYPE_SPEC))
+#define EMULATION_IS_SPEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EMULATION_TYPE_SPEC))
+#define EMULATION_SPEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EMULATION_TYPE_SPEC, EmulationSpecClass))
+
+typedef struct _EmulationSpec EmulationSpec;
+typedef struct _EmulationSpecClass EmulationSpecClass;
+typedef struct _EmulationSpecPrivate EmulationSpecPrivate;
+
+typedef enum {
+ EMULATION_ACCESS_TYPE_READ = 1 << 0,
+ EMULATION_ACCESS_TYPE_WRITE = 1 << 1
+} EmulationAccessType;
+
+struct _EmulationBitfieldValue {
+ GObject parent_instance;
+ EmulationBitfieldValuePrivate * priv;
+};
+
+struct _EmulationBitfieldValueClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationBitfieldValuePrivate {
+ char* _name;
+ char* _doc;
+ guint32 _val;
+};
+
+struct _EmulationBitfieldEnum {
+ GObject parent_instance;
+ EmulationBitfieldEnumPrivate * priv;
+};
+
+struct _EmulationBitfieldEnumClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationBitfieldEnumPrivate {
+ GHashTable* vals;
+};
+
+struct _EmulationBitfield {
+ GObject parent_instance;
+ EmulationBitfieldPrivate * priv;
+};
+
+struct _EmulationBitfieldClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationBitfieldPrivate {
+ char* _name;
+ char* _doc;
+ guint8 _high;
+ guint8 _low;
+ EmulationBitfieldEnum* _enu;
+};
+
+struct _EmulationBitfieldIterator {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ EmulationBitfieldIteratorPrivate * priv;
+};
+
+struct _EmulationBitfieldIteratorClass {
+ GTypeClass parent_class;
+ void (*finalize) (EmulationBitfieldIterator *self);
+};
+
+struct _EmulationBitfieldIteratorPrivate {
+ GList* m_list;
+};
+
+struct _EmulationParamSpecBitfieldIterator {
+ GParamSpec parent_instance;
+};
+
+struct _EmulationRegisterInfo {
+ GObject parent_instance;
+ EmulationRegisterInfoPrivate * priv;
+};
+
+struct _EmulationRegisterInfoClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationRegisterInfoPrivate {
+ char* _name;
+ char* _doc;
+ guint _addr;
+ guint _count;
+ guint8 _access;
+ GList* bitfields;
+};
+
+struct _EmulationRegister {
+ GObject parent_instance;
+ EmulationRegisterPrivate * priv;
+};
+
+struct _EmulationRegisterClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationRegisterPrivate {
+ guint _addr;
+ guint _num;
+ EmulationRegisterInfo* _info;
+ EmulationRegister* _prev;
+ EmulationRegister* _next;
+};
+
+struct _EmulationRegisterIterator {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ EmulationRegisterIteratorPrivate * priv;
+};
+
+struct _EmulationRegisterIteratorClass {
+ GTypeClass parent_class;
+ void (*finalize) (EmulationRegisterIterator *self);
+};
+
+struct _EmulationRegisterIteratorPrivate {
+ GList* m_list;
+};
+
+struct _EmulationParamSpecRegisterIterator {
+ GParamSpec parent_instance;
+};
+
+struct _EmulationRegisterList {
+ GObject parent_instance;
+ EmulationRegisterListPrivate * priv;
+};
+
+struct _EmulationRegisterListClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationRegisterListPrivate {
+ GList* regs;
+};
+
+struct _EmulationSpecParser {
+ GTypeInstance parent_instance;
+ volatile int ref_count;
+ EmulationSpecParserPrivate * priv;
+};
+
+struct _EmulationSpecParserClass {
+ GTypeClass parent_class;
+ void (*finalize) (EmulationSpecParser *self);
+};
+
+struct _EmulationSpecParserPrivate {
+ GHashTable* info;
+ GHashTable* regs;
+ GHashTable* groups_map;
+ GHashTable* enums_map;
+ GHashTable* regs_last_map;
+ xmlDoc* doc;
+ xmlNode* root;
+};
+
+struct _EmulationParamSpecSpecParser {
+ GParamSpec parent_instance;
+};
+
+struct _EmulationSpec {
+ GObject parent_instance;
+ EmulationSpecPrivate * priv;
+};
+
+struct _EmulationSpecClass {
+ GObjectClass parent_class;
+};
+
+struct _EmulationSpecPrivate {
+ GHashTable* info;
+ GHashTable* regs;
+};
+
+
+static gpointer emulation_bitfield_value_parent_class = NULL;
+static gpointer emulation_bitfield_enum_parent_class = NULL;
+static gpointer emulation_bitfield_parent_class = NULL;
+static gpointer emulation_bitfield_iterator_parent_class = NULL;
+static gpointer emulation_register_info_parent_class = NULL;
+static gpointer emulation_register_parent_class = NULL;
+static gpointer emulation_register_iterator_parent_class = NULL;
+static gpointer emulation_register_list_parent_class = NULL;
+static gpointer emulation_spec_parser_parent_class = NULL;
+static gpointer emulation_spec_parent_class = NULL;
+
+GType emulation_access_type_get_type (void);
+GType emulation_bitfield_value_get_type (void);
+#define EMULATION_BITFIELD_VALUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_BITFIELD_VALUE, EmulationBitfieldValuePrivate))
+enum {
+ EMULATION_BITFIELD_VALUE_DUMMY_PROPERTY,
+ EMULATION_BITFIELD_VALUE_NAME,
+ EMULATION_BITFIELD_VALUE_DOC,
+ EMULATION_BITFIELD_VALUE_VAL
+};
+EmulationBitfieldValue* emulation_bitfield_value_new (void);
+EmulationBitfieldValue* emulation_bitfield_value_construct (GType object_type);
+const char* emulation_bitfield_value_get_name (EmulationBitfieldValue* self);
+void emulation_bitfield_value_set_name (EmulationBitfieldValue* self, const char* value);
+const char* emulation_bitfield_value_get_doc (EmulationBitfieldValue* self);
+void emulation_bitfield_value_set_doc (EmulationBitfieldValue* self, const char* value);
+guint32 emulation_bitfield_value_get_val (EmulationBitfieldValue* self);
+void emulation_bitfield_value_set_val (EmulationBitfieldValue* self, guint32 value);
+static void emulation_bitfield_value_finalize (GObject* obj);
+static void emulation_bitfield_value_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void emulation_bitfield_value_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+GType emulation_bitfield_enum_get_type (void);
+#define EMULATION_BITFIELD_ENUM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_BITFIELD_ENUM, EmulationBitfieldEnumPrivate))
+enum {
+ EMULATION_BITFIELD_ENUM_DUMMY_PROPERTY
+};
+EmulationBitfieldValue* emulation_bitfield_enum_lookup (EmulationBitfieldEnum* self, guint32 key);
+static guint32* _uint32_dup (guint32* self);
+void emulation_bitfield_enum_append (EmulationBitfieldEnum* self, EmulationBitfieldValue* v);
+EmulationBitfieldEnum* emulation_bitfield_enum_new (void);
+EmulationBitfieldEnum* emulation_bitfield_enum_construct (GType object_type);
+static void _lambda0_ (void* ptr);
+static void __lambda0__gdestroy_notify (void* data);
+static void _lambda1_ (void* ptr);
+static void __lambda1__gdestroy_notify (void* data);
+static GObject * emulation_bitfield_enum_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void emulation_bitfield_enum_finalize (GObject* obj);
+GType emulation_bitfield_get_type (void);
+#define EMULATION_BITFIELD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_BITFIELD, EmulationBitfieldPrivate))
+enum {
+ EMULATION_BITFIELD_DUMMY_PROPERTY,
+ EMULATION_BITFIELD_NAME,
+ EMULATION_BITFIELD_DOC,
+ EMULATION_BITFIELD_HIGH,
+ EMULATION_BITFIELD_LOW,
+ EMULATION_BITFIELD_ENU
+};
+EmulationBitfield* emulation_bitfield_new (void);
+EmulationBitfield* emulation_bitfield_construct (GType object_type);
+const char* emulation_bitfield_get_name (EmulationBitfield* self);
+void emulation_bitfield_set_name (EmulationBitfield* self, const char* value);
+const char* emulation_bitfield_get_doc (EmulationBitfield* self);
+void emulation_bitfield_set_doc (EmulationBitfield* self, const char* value);
+guint8 emulation_bitfield_get_high (EmulationBitfield* self);
+void emulation_bitfield_set_high (EmulationBitfield* self, guint8 value);
+guint8 emulation_bitfield_get_low (EmulationBitfield* self);
+void emulation_bitfield_set_low (EmulationBitfield* self, guint8 value);
+EmulationBitfieldEnum* emulation_bitfield_get_enu (EmulationBitfield* self);
+void emulation_bitfield_set_enu (EmulationBitfield* self, EmulationBitfieldEnum* value);
+static void emulation_bitfield_finalize (GObject* obj);
+static void emulation_bitfield_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void emulation_bitfield_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+gpointer emulation_bitfield_iterator_ref (gpointer instance);
+void emulation_bitfield_iterator_unref (gpointer instance);
+GParamSpec* emulation_param_spec_bitfield_iterator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
+void emulation_value_set_bitfield_iterator (GValue* value, gpointer v_object);
+gpointer emulation_value_get_bitfield_iterator (const GValue* value);
+GType emulation_bitfield_iterator_get_type (void);
+#define EMULATION_BITFIELD_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_BITFIELD_ITERATOR, EmulationBitfieldIteratorPrivate))
+enum {
+ EMULATION_BITFIELD_ITERATOR_DUMMY_PROPERTY
+};
+EmulationBitfieldIterator* emulation_bitfield_iterator_new (GList* l);
+EmulationBitfieldIterator* emulation_bitfield_iterator_construct (GType object_type, GList* l);
+gboolean emulation_bitfield_iterator_next (EmulationBitfieldIterator* self);
+EmulationBitfield* emulation_bitfield_iterator_get (EmulationBitfieldIterator* self);
+static void emulation_bitfield_iterator_finalize (EmulationBitfieldIterator* obj);
+GType emulation_register_info_get_type (void);
+#define EMULATION_REGISTER_INFO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_REGISTER_INFO, EmulationRegisterInfoPrivate))
+enum {
+ EMULATION_REGISTER_INFO_DUMMY_PROPERTY,
+ EMULATION_REGISTER_INFO_NAME,
+ EMULATION_REGISTER_INFO_DOC,
+ EMULATION_REGISTER_INFO_ADDR,
+ EMULATION_REGISTER_INFO_COUNT,
+ EMULATION_REGISTER_INFO_ACCESS,
+ EMULATION_REGISTER_INFO_LENGTH,
+ EMULATION_REGISTER_INFO_EXTRACT_TYPE
+};
+static void _g_list_free_g_object_unref (GList* self);
+EmulationBitfieldIterator* emulation_register_info_iterator (EmulationRegisterInfo* self);
+EmulationBitfield* emulation_register_info_get (EmulationRegisterInfo* self, guint index);
+void emulation_register_info_append (EmulationRegisterInfo* self, EmulationBitfield* b);
+EmulationRegisterInfo* emulation_register_info_new (void);
+EmulationRegisterInfo* emulation_register_info_construct (GType object_type);
+const char* emulation_register_info_get_name (EmulationRegisterInfo* self);
+void emulation_register_info_set_name (EmulationRegisterInfo* self, const char* value);
+const char* emulation_register_info_get_doc (EmulationRegisterInfo* self);
+void emulation_register_info_set_doc (EmulationRegisterInfo* self, const char* value);
+guint emulation_register_info_get_addr (EmulationRegisterInfo* self);
+void emulation_register_info_set_addr (EmulationRegisterInfo* self, guint value);
+guint emulation_register_info_get_count (EmulationRegisterInfo* self);
+void emulation_register_info_set_count (EmulationRegisterInfo* self, guint value);
+guint8 emulation_register_info_get_access (EmulationRegisterInfo* self);
+void emulation_register_info_set_access (EmulationRegisterInfo* self, guint8 value);
+guint emulation_register_info_get_length (EmulationRegisterInfo* self);
+GType emulation_register_info_get_extract_type (EmulationRegisterInfo* self);
+static GObject * emulation_register_info_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void emulation_register_info_finalize (GObject* obj);
+static void emulation_register_info_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void emulation_register_info_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+GType emulation_register_get_type (void);
+#define EMULATION_REGISTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_REGISTER, EmulationRegisterPrivate))
+enum {
+ EMULATION_REGISTER_DUMMY_PROPERTY,
+ EMULATION_REGISTER_ADDR,
+ EMULATION_REGISTER_NUM,
+ EMULATION_REGISTER_INFO,
+ EMULATION_REGISTER_PREV,
+ EMULATION_REGISTER_NEXT
+};
+EmulationRegister* emulation_register_new (void);
+EmulationRegister* emulation_register_construct (GType object_type);
+guint emulation_register_get_addr (EmulationRegister* self);
+void emulation_register_set_addr (EmulationRegister* self, guint value);
+guint emulation_register_get_num (EmulationRegister* self);
+void emulation_register_set_num (EmulationRegister* self, guint value);
+EmulationRegisterInfo* emulation_register_get_info (EmulationRegister* self);
+void emulation_register_set_info (EmulationRegister* self, EmulationRegisterInfo* value);
+EmulationRegister* emulation_register_get_prev (EmulationRegister* self);
+void emulation_register_set_prev (EmulationRegister* self, EmulationRegister* value);
+EmulationRegister* emulation_register_get_next (EmulationRegister* self);
+void emulation_register_set_next (EmulationRegister* self, EmulationRegister* value);
+static void emulation_register_finalize (GObject* obj);
+static void emulation_register_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void emulation_register_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+gpointer emulation_register_iterator_ref (gpointer instance);
+void emulation_register_iterator_unref (gpointer instance);
+GParamSpec* emulation_param_spec_register_iterator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
+void emulation_value_set_register_iterator (GValue* value, gpointer v_object);
+gpointer emulation_value_get_register_iterator (const GValue* value);
+GType emulation_register_iterator_get_type (void);
+#define EMULATION_REGISTER_ITERATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_REGISTER_ITERATOR, EmulationRegisterIteratorPrivate))
+enum {
+ EMULATION_REGISTER_ITERATOR_DUMMY_PROPERTY
+};
+EmulationRegisterIterator* emulation_register_iterator_new (GList* l);
+EmulationRegisterIterator* emulation_register_iterator_construct (GType object_type, GList* l);
+gboolean emulation_register_iterator_next (EmulationRegisterIterator* self);
+EmulationRegister* emulation_register_iterator_get (EmulationRegisterIterator* self);
+static void emulation_register_iterator_finalize (EmulationRegisterIterator* obj);
+GType emulation_register_list_get_type (void);
+#define EMULATION_REGISTER_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_REGISTER_LIST, EmulationRegisterListPrivate))
+enum {
+ EMULATION_REGISTER_LIST_DUMMY_PROPERTY,
+ EMULATION_REGISTER_LIST_LENGTH,
+ EMULATION_REGISTER_LIST_EXTRACT_TYPE
+};
+EmulationRegisterIterator* emulation_register_list_iterator (EmulationRegisterList* self);
+EmulationRegister* emulation_register_list_get (EmulationRegisterList* self, guint index);
+void emulation_register_list_append (EmulationRegisterList* self, EmulationRegister* reg);
+EmulationRegisterList* emulation_register_list_new (void);
+EmulationRegisterList* emulation_register_list_construct (GType object_type);
+guint emulation_register_list_get_length (EmulationRegisterList* self);
+GType emulation_register_list_get_extract_type (EmulationRegisterList* self);
+static GObject * emulation_register_list_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void emulation_register_list_finalize (GObject* obj);
+static void emulation_register_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+gpointer emulation_spec_parser_ref (gpointer instance);
+void emulation_spec_parser_unref (gpointer instance);
+GParamSpec* emulation_param_spec_spec_parser (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
+void emulation_value_set_spec_parser (GValue* value, gpointer v_object);
+gpointer emulation_value_get_spec_parser (const GValue* value);
+GType emulation_spec_parser_get_type (void);
+#define EMULATION_SPEC_PARSER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_SPEC_PARSER, EmulationSpecParserPrivate))
+enum {
+ EMULATION_SPEC_PARSER_DUMMY_PROPERTY
+};
+static void _lambda2_ (void* ptr);
+static void __lambda2__gdestroy_notify (void* data);
+static void _lambda3_ (void* ptr);
+static void __lambda3__gdestroy_notify (void* data);
+static void _lambda4_ (void* ptr);
+static void __lambda4__gdestroy_notify (void* data);
+static void _lambda5_ (void* ptr);
+static void __lambda5__gdestroy_notify (void* data);
+static void _lambda6_ (void* ptr);
+static void __lambda6__gdestroy_notify (void* data);
+static void _lambda7_ (void* ptr);
+static void __lambda7__gdestroy_notify (void* data);
+static void _lambda8_ (void* ptr);
+static void __lambda8__gdestroy_notify (void* data);
+static void _lambda9_ (void* ptr);
+static void __lambda9__gdestroy_notify (void* data);
+EmulationSpecParser* emulation_spec_parser_new (GHashTable** _info, GHashTable** _regs);
+EmulationSpecParser* emulation_spec_parser_construct (GType object_type, GHashTable** _info, GHashTable** _regs);
+static inline xmlNode* emulation_spec_parser_find_variant (EmulationSpecParser* self, const char* name);
+static inline void emulation_spec_parser_index_groups (EmulationSpecParser* self);
+static inline void emulation_spec_parser_index_enums (EmulationSpecParser* self);
+static void emulation_spec_parser_xmlparse_variant (EmulationSpecParser* self, xmlNode* node);
+gboolean emulation_spec_parser_parse (EmulationSpecParser* self, const char* filename, const char* variant);
+static inline const char* emulation_spec_parser_get_single_attrib (EmulationSpecParser* self, xmlNode* node, const char* attrib);
+static void emulation_spec_parser_xmlparse_enum (EmulationSpecParser* self, xmlNode* node);
+static inline xmlNode* emulation_spec_parser_find_group (EmulationSpecParser* self, const char* name);
+static inline EmulationBitfieldEnum* emulation_spec_parser_find_enum (EmulationSpecParser* self, const char* name);
+static void emulation_spec_parser_xmlparse_group (EmulationSpecParser* self, xmlNode* node, guint offset, const char* _name);
+static void emulation_spec_parser_xmlparse_reg32 (EmulationSpecParser* self, xmlNode* node, guint offset, const char* _name);
+static void emulation_spec_parser_xmlparse_stripe (EmulationSpecParser* self, xmlNode* node, guint offset, const char* _name);
+static guint* _uint_dup (guint* self);
+static void emulation_spec_parser_xmlparse_bitfield (EmulationSpecParser* self, xmlNode* node, EmulationRegisterInfo* reginfo);
+static void emulation_spec_parser_xmlparse_value (EmulationSpecParser* self, xmlNode* node, EmulationBitfieldEnum* enu);
+static void emulation_spec_parser_finalize (EmulationSpecParser* obj);
+GType emulation_spec_get_type (void);
+#define EMULATION_SPEC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMULATION_TYPE_SPEC, EmulationSpecPrivate))
+enum {
+ EMULATION_SPEC_DUMMY_PROPERTY
+};
+gboolean emulation_spec_load_xml (EmulationSpec* self, const char* filename, const char* variant);
+EmulationRegisterList* emulation_spec_translate_addr (EmulationSpec* self, guint addr);
+EmulationSpec* emulation_spec_new (void);
+EmulationSpec* emulation_spec_construct (GType object_type);
+static void emulation_spec_finalize (GObject* obj);
+static int _vala_strcmp0 (const char * str1, const char * str2);
+
+
+
+
+GType emulation_access_type_get_type (void) {
+ static GType emulation_access_type_type_id = 0;
+ if (G_UNLIKELY (emulation_access_type_type_id == 0)) {
+ static const GEnumValue values[] = {{EMULATION_ACCESS_TYPE_READ, "EMULATION_ACCESS_TYPE_READ", "read"}, {EMULATION_ACCESS_TYPE_WRITE, "EMULATION_ACCESS_TYPE_WRITE", "write"}, {0, NULL, NULL}};
+ emulation_access_type_type_id = g_enum_register_static ("EmulationAccessType", values);
+ }
+ return emulation_access_type_type_id;
+}
+
+
+EmulationBitfieldValue* emulation_bitfield_value_construct (GType object_type) {
+ EmulationBitfieldValue * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationBitfieldValue* emulation_bitfield_value_new (void) {
+ return emulation_bitfield_value_construct (EMULATION_TYPE_BITFIELD_VALUE);
+}
+
+
+const char* emulation_bitfield_value_get_name (EmulationBitfieldValue* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_name;
+ return result;
+}
+
+
+void emulation_bitfield_value_set_name (EmulationBitfieldValue* self, const char* value) {
+ char* _tmp1_;
+ const char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_name = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->priv->_name = (g_free (self->priv->_name), NULL), _tmp1_);
+ g_object_notify ((GObject *) self, "name");
+}
+
+
+const char* emulation_bitfield_value_get_doc (EmulationBitfieldValue* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_doc;
+ return result;
+}
+
+
+void emulation_bitfield_value_set_doc (EmulationBitfieldValue* self, const char* value) {
+ char* _tmp1_;
+ const char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_doc = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->priv->_doc = (g_free (self->priv->_doc), NULL), _tmp1_);
+ g_object_notify ((GObject *) self, "doc");
+}
+
+
+guint32 emulation_bitfield_value_get_val (EmulationBitfieldValue* self) {
+ guint32 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_val;
+ return result;
+}
+
+
+void emulation_bitfield_value_set_val (EmulationBitfieldValue* self, guint32 value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_val = value;
+ g_object_notify ((GObject *) self, "val");
+}
+
+
+static void emulation_bitfield_value_class_init (EmulationBitfieldValueClass * klass) {
+ emulation_bitfield_value_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationBitfieldValuePrivate));
+ G_OBJECT_CLASS (klass)->get_property = emulation_bitfield_value_get_property;
+ G_OBJECT_CLASS (klass)->set_property = emulation_bitfield_value_set_property;
+ G_OBJECT_CLASS (klass)->finalize = emulation_bitfield_value_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_VALUE_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_VALUE_DOC, g_param_spec_string ("doc", "doc", "doc", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_VALUE_VAL, g_param_spec_uint ("val", "val", "val", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+}
+
+
+static void emulation_bitfield_value_instance_init (EmulationBitfieldValue * self) {
+ self->priv = EMULATION_BITFIELD_VALUE_GET_PRIVATE (self);
+}
+
+
+static void emulation_bitfield_value_finalize (GObject* obj) {
+ EmulationBitfieldValue * self;
+ self = EMULATION_BITFIELD_VALUE (obj);
+ self->priv->_name = (g_free (self->priv->_name), NULL);
+ self->priv->_doc = (g_free (self->priv->_doc), NULL);
+ G_OBJECT_CLASS (emulation_bitfield_value_parent_class)->finalize (obj);
+}
+
+
+GType emulation_bitfield_value_get_type (void) {
+ static GType emulation_bitfield_value_type_id = 0;
+ if (emulation_bitfield_value_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationBitfieldValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_bitfield_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationBitfieldValue), 0, (GInstanceInitFunc) emulation_bitfield_value_instance_init, NULL };
+ emulation_bitfield_value_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationBitfieldValue", &g_define_type_info, 0);
+ }
+ return emulation_bitfield_value_type_id;
+}
+
+
+static void emulation_bitfield_value_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationBitfieldValue * self;
+ gpointer boxed;
+ self = EMULATION_BITFIELD_VALUE (object);
+ switch (property_id) {
+ case EMULATION_BITFIELD_VALUE_NAME:
+ g_value_set_string (value, emulation_bitfield_value_get_name (self));
+ break;
+ case EMULATION_BITFIELD_VALUE_DOC:
+ g_value_set_string (value, emulation_bitfield_value_get_doc (self));
+ break;
+ case EMULATION_BITFIELD_VALUE_VAL:
+ g_value_set_uint (value, emulation_bitfield_value_get_val (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void emulation_bitfield_value_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ EmulationBitfieldValue * self;
+ self = EMULATION_BITFIELD_VALUE (object);
+ switch (property_id) {
+ case EMULATION_BITFIELD_VALUE_NAME:
+ emulation_bitfield_value_set_name (self, g_value_get_string (value));
+ break;
+ case EMULATION_BITFIELD_VALUE_DOC:
+ emulation_bitfield_value_set_doc (self, g_value_get_string (value));
+ break;
+ case EMULATION_BITFIELD_VALUE_VAL:
+ emulation_bitfield_value_set_val (self, g_value_get_uint (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationBitfieldValue* emulation_bitfield_enum_lookup (EmulationBitfieldEnum* self, guint32 key) {
+ EmulationBitfieldValue* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = (EmulationBitfieldValue*) g_hash_table_lookup (self->priv->vals, &key);
+ return result;
+}
+
+
+static guint32* _uint32_dup (guint32* self) {
+ guint32* dup;
+ dup = g_new0 (guint32, 1);
+ memcpy (dup, self, sizeof (guint32));
+ return dup;
+}
+
+
+void emulation_bitfield_enum_append (EmulationBitfieldEnum* self, EmulationBitfieldValue* v) {
+ EmulationBitfieldValue* _tmp2_;
+ guint32* _tmp1_;
+ guint32 _tmp0_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (v != NULL);
+ _tmp2_ = NULL;
+ _tmp1_ = NULL;
+ g_hash_table_insert (self->priv->vals, (_tmp1_ = (_tmp0_ = emulation_bitfield_value_get_val (v), &_tmp0_), (_tmp1_ == NULL) ? NULL : _uint32_dup (_tmp1_)), (_tmp2_ = v, (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_)));
+}
+
+
+EmulationBitfieldEnum* emulation_bitfield_enum_construct (GType object_type) {
+ EmulationBitfieldEnum * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationBitfieldEnum* emulation_bitfield_enum_new (void) {
+ return emulation_bitfield_enum_construct (EMULATION_TYPE_BITFIELD_ENUM);
+}
+
+
+static void _lambda0_ (void* ptr) {
+ g_free (ptr);
+}
+
+
+static void __lambda0__gdestroy_notify (void* data) {
+ _lambda0_ (data);
+}
+
+
+static void _lambda1_ (void* ptr) {
+ void* _tmp0_;
+ _tmp0_ = NULL;
+ g_object_unref ((_tmp0_ = ptr, G_IS_OBJECT (_tmp0_) ? ((GObject*) _tmp0_) : NULL));
+}
+
+
+static void __lambda1__gdestroy_notify (void* data) {
+ _lambda1_ (data);
+}
+
+
+static GObject * emulation_bitfield_enum_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ EmulationBitfieldEnumClass * klass;
+ GObjectClass * parent_class;
+ EmulationBitfieldEnum * self;
+ klass = EMULATION_BITFIELD_ENUM_CLASS (g_type_class_peek (EMULATION_TYPE_BITFIELD_ENUM));
+ parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = EMULATION_BITFIELD_ENUM (obj);
+ {
+ GHashTable* _tmp0_;
+ _tmp0_ = NULL;
+ self->priv->vals = (_tmp0_ = g_hash_table_new_full (g_int_hash, g_int_equal, __lambda0__gdestroy_notify, __lambda1__gdestroy_notify), (self->priv->vals == NULL) ? NULL : (self->priv->vals = (g_hash_table_unref (self->priv->vals), NULL)), _tmp0_);
+ }
+ return obj;
+}
+
+
+static void emulation_bitfield_enum_class_init (EmulationBitfieldEnumClass * klass) {
+ emulation_bitfield_enum_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationBitfieldEnumPrivate));
+ G_OBJECT_CLASS (klass)->constructor = emulation_bitfield_enum_constructor;
+ G_OBJECT_CLASS (klass)->finalize = emulation_bitfield_enum_finalize;
+}
+
+
+static void emulation_bitfield_enum_instance_init (EmulationBitfieldEnum * self) {
+ self->priv = EMULATION_BITFIELD_ENUM_GET_PRIVATE (self);
+}
+
+
+static void emulation_bitfield_enum_finalize (GObject* obj) {
+ EmulationBitfieldEnum * self;
+ self = EMULATION_BITFIELD_ENUM (obj);
+ (self->priv->vals == NULL) ? NULL : (self->priv->vals = (g_hash_table_unref (self->priv->vals), NULL));
+ G_OBJECT_CLASS (emulation_bitfield_enum_parent_class)->finalize (obj);
+}
+
+
+GType emulation_bitfield_enum_get_type (void) {
+ static GType emulation_bitfield_enum_type_id = 0;
+ if (emulation_bitfield_enum_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationBitfieldEnumClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_bitfield_enum_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationBitfieldEnum), 0, (GInstanceInitFunc) emulation_bitfield_enum_instance_init, NULL };
+ emulation_bitfield_enum_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationBitfieldEnum", &g_define_type_info, 0);
+ }
+ return emulation_bitfield_enum_type_id;
+}
+
+
+EmulationBitfield* emulation_bitfield_construct (GType object_type) {
+ EmulationBitfield * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationBitfield* emulation_bitfield_new (void) {
+ return emulation_bitfield_construct (EMULATION_TYPE_BITFIELD);
+}
+
+
+const char* emulation_bitfield_get_name (EmulationBitfield* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_name;
+ return result;
+}
+
+
+void emulation_bitfield_set_name (EmulationBitfield* self, const char* value) {
+ char* _tmp1_;
+ const char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_name = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->priv->_name = (g_free (self->priv->_name), NULL), _tmp1_);
+ g_object_notify ((GObject *) self, "name");
+}
+
+
+const char* emulation_bitfield_get_doc (EmulationBitfield* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_doc;
+ return result;
+}
+
+
+void emulation_bitfield_set_doc (EmulationBitfield* self, const char* value) {
+ char* _tmp1_;
+ const char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_doc = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->priv->_doc = (g_free (self->priv->_doc), NULL), _tmp1_);
+ g_object_notify ((GObject *) self, "doc");
+}
+
+
+guint8 emulation_bitfield_get_high (EmulationBitfield* self) {
+ guint8 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_high;
+ return result;
+}
+
+
+void emulation_bitfield_set_high (EmulationBitfield* self, guint8 value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_high = value;
+ g_object_notify ((GObject *) self, "high");
+}
+
+
+guint8 emulation_bitfield_get_low (EmulationBitfield* self) {
+ guint8 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_low;
+ return result;
+}
+
+
+void emulation_bitfield_set_low (EmulationBitfield* self, guint8 value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_low = value;
+ g_object_notify ((GObject *) self, "low");
+}
+
+
+EmulationBitfieldEnum* emulation_bitfield_get_enu (EmulationBitfield* self) {
+ EmulationBitfieldEnum* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_enu;
+ return result;
+}
+
+
+void emulation_bitfield_set_enu (EmulationBitfield* self, EmulationBitfieldEnum* value) {
+ EmulationBitfieldEnum* _tmp1_;
+ EmulationBitfieldEnum* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_enu = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)), (self->priv->_enu == NULL) ? NULL : (self->priv->_enu = (g_object_unref (self->priv->_enu), NULL)), _tmp1_);
+ g_object_notify ((GObject *) self, "enu");
+}
+
+
+static void emulation_bitfield_class_init (EmulationBitfieldClass * klass) {
+ emulation_bitfield_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationBitfieldPrivate));
+ G_OBJECT_CLASS (klass)->get_property = emulation_bitfield_get_property;
+ G_OBJECT_CLASS (klass)->set_property = emulation_bitfield_set_property;
+ G_OBJECT_CLASS (klass)->finalize = emulation_bitfield_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_DOC, g_param_spec_string ("doc", "doc", "doc", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_HIGH, g_param_spec_uchar ("high", "high", "high", 0, G_MAXUINT8, (guint8) 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_LOW, g_param_spec_uchar ("low", "low", "low", 0, G_MAXUINT8, (guint8) 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_BITFIELD_ENU, g_param_spec_object ("enu", "enu", "enu", EMULATION_TYPE_BITFIELD_ENUM, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+}
+
+
+static void emulation_bitfield_instance_init (EmulationBitfield * self) {
+ self->priv = EMULATION_BITFIELD_GET_PRIVATE (self);
+ self->priv->_name = NULL;
+ self->priv->_doc = NULL;
+ self->priv->_high = (guint8) 0;
+ self->priv->_low = (guint8) 0;
+ self->priv->_enu = NULL;
+}
+
+
+static void emulation_bitfield_finalize (GObject* obj) {
+ EmulationBitfield * self;
+ self = EMULATION_BITFIELD (obj);
+ self->priv->_name = (g_free (self->priv->_name), NULL);
+ self->priv->_doc = (g_free (self->priv->_doc), NULL);
+ (self->priv->_enu == NULL) ? NULL : (self->priv->_enu = (g_object_unref (self->priv->_enu), NULL));
+ G_OBJECT_CLASS (emulation_bitfield_parent_class)->finalize (obj);
+}
+
+
+GType emulation_bitfield_get_type (void) {
+ static GType emulation_bitfield_type_id = 0;
+ if (emulation_bitfield_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationBitfieldClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_bitfield_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationBitfield), 0, (GInstanceInitFunc) emulation_bitfield_instance_init, NULL };
+ emulation_bitfield_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationBitfield", &g_define_type_info, 0);
+ }
+ return emulation_bitfield_type_id;
+}
+
+
+static void emulation_bitfield_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationBitfield * self;
+ gpointer boxed;
+ self = EMULATION_BITFIELD (object);
+ switch (property_id) {
+ case EMULATION_BITFIELD_NAME:
+ g_value_set_string (value, emulation_bitfield_get_name (self));
+ break;
+ case EMULATION_BITFIELD_DOC:
+ g_value_set_string (value, emulation_bitfield_get_doc (self));
+ break;
+ case EMULATION_BITFIELD_HIGH:
+ g_value_set_uchar (value, emulation_bitfield_get_high (self));
+ break;
+ case EMULATION_BITFIELD_LOW:
+ g_value_set_uchar (value, emulation_bitfield_get_low (self));
+ break;
+ case EMULATION_BITFIELD_ENU:
+ g_value_set_object (value, emulation_bitfield_get_enu (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void emulation_bitfield_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ EmulationBitfield * self;
+ self = EMULATION_BITFIELD (object);
+ switch (property_id) {
+ case EMULATION_BITFIELD_NAME:
+ emulation_bitfield_set_name (self, g_value_get_string (value));
+ break;
+ case EMULATION_BITFIELD_DOC:
+ emulation_bitfield_set_doc (self, g_value_get_string (value));
+ break;
+ case EMULATION_BITFIELD_HIGH:
+ emulation_bitfield_set_high (self, g_value_get_uchar (value));
+ break;
+ case EMULATION_BITFIELD_LOW:
+ emulation_bitfield_set_low (self, g_value_get_uchar (value));
+ break;
+ case EMULATION_BITFIELD_ENU:
+ emulation_bitfield_set_enu (self, g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationBitfieldIterator* emulation_bitfield_iterator_construct (GType object_type, GList* l) {
+ EmulationBitfieldIterator* self;
+ self = (EmulationBitfieldIterator*) g_type_create_instance (object_type);
+ self->priv->m_list = g_list_first (l);
+ return self;
+}
+
+
+EmulationBitfieldIterator* emulation_bitfield_iterator_new (GList* l) {
+ return emulation_bitfield_iterator_construct (EMULATION_TYPE_BITFIELD_ITERATOR, l);
+}
+
+
+gboolean emulation_bitfield_iterator_next (EmulationBitfieldIterator* self) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = self->priv->m_list->next != NULL;
+ return result;
+}
+
+
+EmulationBitfield* emulation_bitfield_iterator_get (EmulationBitfieldIterator* self) {
+ EmulationBitfield* result;
+ EmulationBitfield* r;
+ g_return_val_if_fail (self != NULL, NULL);
+ r = (EmulationBitfield*) self->priv->m_list->data;
+ self->priv->m_list = self->priv->m_list->next;
+ result = r;
+ return result;
+}
+
+
+static void emulation_value_bitfield_iterator_init (GValue* value) {
+ value->data[0].v_pointer = NULL;
+}
+
+
+static void emulation_value_bitfield_iterator_free_value (GValue* value) {
+ if (value->data[0].v_pointer) {
+ emulation_bitfield_iterator_unref (value->data[0].v_pointer);
+ }
+}
+
+
+static void emulation_value_bitfield_iterator_copy_value (const GValue* src_value, GValue* dest_value) {
+ if (src_value->data[0].v_pointer) {
+ dest_value->data[0].v_pointer = emulation_bitfield_iterator_ref (src_value->data[0].v_pointer);
+ } else {
+ dest_value->data[0].v_pointer = NULL;
+ }
+}
+
+
+static gpointer emulation_value_bitfield_iterator_peek_pointer (const GValue* value) {
+ return value->data[0].v_pointer;
+}
+
+
+static gchar* emulation_value_bitfield_iterator_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ if (collect_values[0].v_pointer) {
+ EmulationBitfieldIterator* object;
+ object = collect_values[0].v_pointer;
+ if (object->parent_instance.g_class == NULL) {
+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ }
+ value->data[0].v_pointer = emulation_bitfield_iterator_ref (object);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ return NULL;
+}
+
+
+static gchar* emulation_value_bitfield_iterator_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ EmulationBitfieldIterator** object_p;
+ object_p = collect_values[0].v_pointer;
+ if (!object_p) {
+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+ }
+ if (!value->data[0].v_pointer) {
+ *object_p = NULL;
+ } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
+ *object_p = value->data[0].v_pointer;
+ } else {
+ *object_p = emulation_bitfield_iterator_ref (value->data[0].v_pointer);
+ }
+ return NULL;
+}
+
+
+GParamSpec* emulation_param_spec_bitfield_iterator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
+ EmulationParamSpecBitfieldIterator* spec;
+ g_return_val_if_fail (g_type_is_a (object_type, EMULATION_TYPE_BITFIELD_ITERATOR), NULL);
+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+ G_PARAM_SPEC (spec)->value_type = object_type;
+ return G_PARAM_SPEC (spec);
+}
+
+
+gpointer emulation_value_get_bitfield_iterator (const GValue* value) {
+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EMULATION_TYPE_BITFIELD_ITERATOR), NULL);
+ return value->data[0].v_pointer;
+}
+
+
+void emulation_value_set_bitfield_iterator (GValue* value, gpointer v_object) {
+ EmulationBitfieldIterator* old;
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EMULATION_TYPE_BITFIELD_ITERATOR));
+ old = value->data[0].v_pointer;
+ if (v_object) {
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EMULATION_TYPE_BITFIELD_ITERATOR));
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+ value->data[0].v_pointer = v_object;
+ emulation_bitfield_iterator_ref (value->data[0].v_pointer);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ if (old) {
+ emulation_bitfield_iterator_unref (old);
+ }
+}
+
+
+static void emulation_bitfield_iterator_class_init (EmulationBitfieldIteratorClass * klass) {
+ emulation_bitfield_iterator_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_BITFIELD_ITERATOR_CLASS (klass)->finalize = emulation_bitfield_iterator_finalize;
+ g_type_class_add_private (klass, sizeof (EmulationBitfieldIteratorPrivate));
+}
+
+
+static void emulation_bitfield_iterator_instance_init (EmulationBitfieldIterator * self) {
+ self->priv = EMULATION_BITFIELD_ITERATOR_GET_PRIVATE (self);
+ self->ref_count = 1;
+}
+
+
+static void emulation_bitfield_iterator_finalize (EmulationBitfieldIterator* obj) {
+ EmulationBitfieldIterator * self;
+ self = EMULATION_BITFIELD_ITERATOR (obj);
+}
+
+
+GType emulation_bitfield_iterator_get_type (void) {
+ static GType emulation_bitfield_iterator_type_id = 0;
+ if (emulation_bitfield_iterator_type_id == 0) {
+ static const GTypeValueTable g_define_type_value_table = { emulation_value_bitfield_iterator_init, emulation_value_bitfield_iterator_free_value, emulation_value_bitfield_iterator_copy_value, emulation_value_bitfield_iterator_peek_pointer, "p", emulation_value_bitfield_iterator_collect_value, "p", emulation_value_bitfield_iterator_lcopy_value };
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationBitfieldIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_bitfield_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationBitfieldIterator), 0, (GInstanceInitFunc) emulation_bitfield_iterator_instance_init, &g_define_type_value_table };
+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
+ emulation_bitfield_iterator_type_id = g_type_register_fundamental (g_type_fundamental_next (), "EmulationBitfieldIterator", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ }
+ return emulation_bitfield_iterator_type_id;
+}
+
+
+gpointer emulation_bitfield_iterator_ref (gpointer instance) {
+ EmulationBitfieldIterator* self;
+ self = instance;
+ g_atomic_int_inc (&self->ref_count);
+ return instance;
+}
+
+
+void emulation_bitfield_iterator_unref (gpointer instance) {
+ EmulationBitfieldIterator* self;
+ self = instance;
+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
+ EMULATION_BITFIELD_ITERATOR_GET_CLASS (self)->finalize (self);
+ g_type_free_instance ((GTypeInstance *) self);
+ }
+}
+
+
+static void _g_list_free_g_object_unref (GList* self) {
+ g_list_foreach (self, (GFunc) g_object_unref, NULL);
+ g_list_free (self);
+}
+
+
+EmulationBitfieldIterator* emulation_register_info_iterator (EmulationRegisterInfo* self) {
+ EmulationBitfieldIterator* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = emulation_bitfield_iterator_new (self->priv->bitfields);
+ return result;
+}
+
+
+EmulationBitfield* emulation_register_info_get (EmulationRegisterInfo* self, guint index) {
+ EmulationBitfield* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = (EmulationBitfield*) g_list_nth_data (self->priv->bitfields, index);
+ return result;
+}
+
+
+void emulation_register_info_append (EmulationRegisterInfo* self, EmulationBitfield* b) {
+ EmulationBitfield* _tmp0_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (b != NULL);
+ _tmp0_ = NULL;
+ self->priv->bitfields = g_list_append (self->priv->bitfields, (_tmp0_ = b, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)));
+}
+
+
+EmulationRegisterInfo* emulation_register_info_construct (GType object_type) {
+ EmulationRegisterInfo * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationRegisterInfo* emulation_register_info_new (void) {
+ return emulation_register_info_construct (EMULATION_TYPE_REGISTER_INFO);
+}
+
+
+const char* emulation_register_info_get_name (EmulationRegisterInfo* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_name;
+ return result;
+}
+
+
+void emulation_register_info_set_name (EmulationRegisterInfo* self, const char* value) {
+ char* _tmp1_;
+ const char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_name = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->priv->_name = (g_free (self->priv->_name), NULL), _tmp1_);
+ g_object_notify ((GObject *) self, "name");
+}
+
+
+const char* emulation_register_info_get_doc (EmulationRegisterInfo* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_doc;
+ return result;
+}
+
+
+void emulation_register_info_set_doc (EmulationRegisterInfo* self, const char* value) {
+ char* _tmp1_;
+ const char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ _tmp1_ = NULL;
+ _tmp0_ = NULL;
+ self->priv->_doc = (_tmp1_ = (_tmp0_ = value, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), self->priv->_doc = (g_free (self->priv->_doc), NULL), _tmp1_);
+ g_object_notify ((GObject *) self, "doc");
+}
+
+
+guint emulation_register_info_get_addr (EmulationRegisterInfo* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_addr;
+ return result;
+}
+
+
+void emulation_register_info_set_addr (EmulationRegisterInfo* self, guint value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_addr = value;
+ g_object_notify ((GObject *) self, "addr");
+}
+
+
+guint emulation_register_info_get_count (EmulationRegisterInfo* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_count;
+ return result;
+}
+
+
+void emulation_register_info_set_count (EmulationRegisterInfo* self, guint value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_count = value;
+ g_object_notify ((GObject *) self, "count");
+}
+
+
+guint8 emulation_register_info_get_access (EmulationRegisterInfo* self) {
+ guint8 result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_access;
+ return result;
+}
+
+
+void emulation_register_info_set_access (EmulationRegisterInfo* self, guint8 value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_access = value;
+ g_object_notify ((GObject *) self, "access");
+}
+
+
+guint emulation_register_info_get_length (EmulationRegisterInfo* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = g_list_length (self->priv->bitfields);
+ return result;
+}
+
+
+GType emulation_register_info_get_extract_type (EmulationRegisterInfo* self) {
+ GType result;
+ g_return_val_if_fail (self != NULL, 0UL);
+ result = EMULATION_TYPE_BITFIELD;
+ return result;
+}
+
+
+static GObject * emulation_register_info_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ EmulationRegisterInfoClass * klass;
+ GObjectClass * parent_class;
+ EmulationRegisterInfo * self;
+ klass = EMULATION_REGISTER_INFO_CLASS (g_type_class_peek (EMULATION_TYPE_REGISTER_INFO));
+ parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = EMULATION_REGISTER_INFO (obj);
+ {
+ GList* _tmp1_;
+ _tmp1_ = NULL;
+ self->priv->bitfields = (_tmp1_ = NULL, (self->priv->bitfields == NULL) ? NULL : (self->priv->bitfields = (_g_list_free_g_object_unref (self->priv->bitfields), NULL)), _tmp1_);
+ }
+ return obj;
+}
+
+
+static void emulation_register_info_class_init (EmulationRegisterInfoClass * klass) {
+ emulation_register_info_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationRegisterInfoPrivate));
+ G_OBJECT_CLASS (klass)->get_property = emulation_register_info_get_property;
+ G_OBJECT_CLASS (klass)->set_property = emulation_register_info_set_property;
+ G_OBJECT_CLASS (klass)->constructor = emulation_register_info_constructor;
+ G_OBJECT_CLASS (klass)->finalize = emulation_register_info_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_DOC, g_param_spec_string ("doc", "doc", "doc", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_ADDR, g_param_spec_uint ("addr", "addr", "addr", 0, G_MAXUINT, (guint) 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_COUNT, g_param_spec_uint ("count", "count", "count", 0, G_MAXUINT, (guint) 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_ACCESS, g_param_spec_uchar ("access", "access", "access", 0, G_MAXUINT8, (guint8) 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_LENGTH, g_param_spec_uint ("length", "length", "length", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO_EXTRACT_TYPE, g_param_spec_gtype ("extract-type", "extract-type", "extract-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+}
+
+
+static void emulation_register_info_instance_init (EmulationRegisterInfo * self) {
+ self->priv = EMULATION_REGISTER_INFO_GET_PRIVATE (self);
+ self->priv->_name = NULL;
+ self->priv->_doc = NULL;
+ self->priv->_addr = (guint) 0;
+ self->priv->_count = (guint) 0;
+ self->priv->_access = (guint8) 0;
+}
+
+
+static void emulation_register_info_finalize (GObject* obj) {
+ EmulationRegisterInfo * self;
+ self = EMULATION_REGISTER_INFO (obj);
+ self->priv->_name = (g_free (self->priv->_name), NULL);
+ self->priv->_doc = (g_free (self->priv->_doc), NULL);
+ (self->priv->bitfields == NULL) ? NULL : (self->priv->bitfields = (_g_list_free_g_object_unref (self->priv->bitfields), NULL));
+ G_OBJECT_CLASS (emulation_register_info_parent_class)->finalize (obj);
+}
+
+
+GType emulation_register_info_get_type (void) {
+ static GType emulation_register_info_type_id = 0;
+ if (emulation_register_info_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationRegisterInfoClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_register_info_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationRegisterInfo), 0, (GInstanceInitFunc) emulation_register_info_instance_init, NULL };
+ emulation_register_info_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationRegisterInfo", &g_define_type_info, 0);
+ }
+ return emulation_register_info_type_id;
+}
+
+
+static void emulation_register_info_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationRegisterInfo * self;
+ gpointer boxed;
+ self = EMULATION_REGISTER_INFO (object);
+ switch (property_id) {
+ case EMULATION_REGISTER_INFO_NAME:
+ g_value_set_string (value, emulation_register_info_get_name (self));
+ break;
+ case EMULATION_REGISTER_INFO_DOC:
+ g_value_set_string (value, emulation_register_info_get_doc (self));
+ break;
+ case EMULATION_REGISTER_INFO_ADDR:
+ g_value_set_uint (value, emulation_register_info_get_addr (self));
+ break;
+ case EMULATION_REGISTER_INFO_COUNT:
+ g_value_set_uint (value, emulation_register_info_get_count (self));
+ break;
+ case EMULATION_REGISTER_INFO_ACCESS:
+ g_value_set_uchar (value, emulation_register_info_get_access (self));
+ break;
+ case EMULATION_REGISTER_INFO_LENGTH:
+ g_value_set_uint (value, emulation_register_info_get_length (self));
+ break;
+ case EMULATION_REGISTER_INFO_EXTRACT_TYPE:
+ g_value_set_gtype (value, emulation_register_info_get_extract_type (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void emulation_register_info_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ EmulationRegisterInfo * self;
+ self = EMULATION_REGISTER_INFO (object);
+ switch (property_id) {
+ case EMULATION_REGISTER_INFO_NAME:
+ emulation_register_info_set_name (self, g_value_get_string (value));
+ break;
+ case EMULATION_REGISTER_INFO_DOC:
+ emulation_register_info_set_doc (self, g_value_get_string (value));
+ break;
+ case EMULATION_REGISTER_INFO_ADDR:
+ emulation_register_info_set_addr (self, g_value_get_uint (value));
+ break;
+ case EMULATION_REGISTER_INFO_COUNT:
+ emulation_register_info_set_count (self, g_value_get_uint (value));
+ break;
+ case EMULATION_REGISTER_INFO_ACCESS:
+ emulation_register_info_set_access (self, g_value_get_uchar (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationRegister* emulation_register_construct (GType object_type) {
+ EmulationRegister * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationRegister* emulation_register_new (void) {
+ return emulation_register_construct (EMULATION_TYPE_REGISTER);
+}
+
+
+guint emulation_register_get_addr (EmulationRegister* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_addr;
+ return result;
+}
+
+
+void emulation_register_set_addr (EmulationRegister* self, guint value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_addr = value;
+ g_object_notify ((GObject *) self, "addr");
+}
+
+
+guint emulation_register_get_num (EmulationRegister* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = self->priv->_num;
+ return result;
+}
+
+
+void emulation_register_set_num (EmulationRegister* self, guint value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_num = value;
+ g_object_notify ((GObject *) self, "num");
+}
+
+
+EmulationRegisterInfo* emulation_register_get_info (EmulationRegister* self) {
+ EmulationRegisterInfo* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_info;
+ return result;
+}
+
+
+void emulation_register_set_info (EmulationRegister* self, EmulationRegisterInfo* value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_info = value;
+ g_object_notify ((GObject *) self, "info");
+}
+
+
+EmulationRegister* emulation_register_get_prev (EmulationRegister* self) {
+ EmulationRegister* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_prev;
+ return result;
+}
+
+
+void emulation_register_set_prev (EmulationRegister* self, EmulationRegister* value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_prev = value;
+ g_object_notify ((GObject *) self, "prev");
+}
+
+
+EmulationRegister* emulation_register_get_next (EmulationRegister* self) {
+ EmulationRegister* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_next;
+ return result;
+}
+
+
+void emulation_register_set_next (EmulationRegister* self, EmulationRegister* value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_next = value;
+ g_object_notify ((GObject *) self, "next");
+}
+
+
+static void emulation_register_class_init (EmulationRegisterClass * klass) {
+ emulation_register_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationRegisterPrivate));
+ G_OBJECT_CLASS (klass)->get_property = emulation_register_get_property;
+ G_OBJECT_CLASS (klass)->set_property = emulation_register_set_property;
+ G_OBJECT_CLASS (klass)->finalize = emulation_register_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_ADDR, g_param_spec_uint ("addr", "addr", "addr", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_NUM, g_param_spec_uint ("num", "num", "num", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_INFO, g_param_spec_object ("info", "info", "info", EMULATION_TYPE_REGISTER_INFO, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_PREV, g_param_spec_object ("prev", "prev", "prev", EMULATION_TYPE_REGISTER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_NEXT, g_param_spec_object ("next", "next", "next", EMULATION_TYPE_REGISTER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+}
+
+
+static void emulation_register_instance_init (EmulationRegister * self) {
+ self->priv = EMULATION_REGISTER_GET_PRIVATE (self);
+}
+
+
+static void emulation_register_finalize (GObject* obj) {
+ EmulationRegister * self;
+ self = EMULATION_REGISTER (obj);
+ G_OBJECT_CLASS (emulation_register_parent_class)->finalize (obj);
+}
+
+
+GType emulation_register_get_type (void) {
+ static GType emulation_register_type_id = 0;
+ if (emulation_register_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationRegisterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_register_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationRegister), 0, (GInstanceInitFunc) emulation_register_instance_init, NULL };
+ emulation_register_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationRegister", &g_define_type_info, 0);
+ }
+ return emulation_register_type_id;
+}
+
+
+static void emulation_register_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationRegister * self;
+ gpointer boxed;
+ self = EMULATION_REGISTER (object);
+ switch (property_id) {
+ case EMULATION_REGISTER_ADDR:
+ g_value_set_uint (value, emulation_register_get_addr (self));
+ break;
+ case EMULATION_REGISTER_NUM:
+ g_value_set_uint (value, emulation_register_get_num (self));
+ break;
+ case EMULATION_REGISTER_INFO:
+ g_value_set_object (value, emulation_register_get_info (self));
+ break;
+ case EMULATION_REGISTER_PREV:
+ g_value_set_object (value, emulation_register_get_prev (self));
+ break;
+ case EMULATION_REGISTER_NEXT:
+ g_value_set_object (value, emulation_register_get_next (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void emulation_register_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ EmulationRegister * self;
+ self = EMULATION_REGISTER (object);
+ switch (property_id) {
+ case EMULATION_REGISTER_ADDR:
+ emulation_register_set_addr (self, g_value_get_uint (value));
+ break;
+ case EMULATION_REGISTER_NUM:
+ emulation_register_set_num (self, g_value_get_uint (value));
+ break;
+ case EMULATION_REGISTER_INFO:
+ emulation_register_set_info (self, g_value_get_object (value));
+ break;
+ case EMULATION_REGISTER_PREV:
+ emulation_register_set_prev (self, g_value_get_object (value));
+ break;
+ case EMULATION_REGISTER_NEXT:
+ emulation_register_set_next (self, g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+EmulationRegisterIterator* emulation_register_iterator_construct (GType object_type, GList* l) {
+ EmulationRegisterIterator* self;
+ self = (EmulationRegisterIterator*) g_type_create_instance (object_type);
+ self->priv->m_list = g_list_first (l);
+ return self;
+}
+
+
+EmulationRegisterIterator* emulation_register_iterator_new (GList* l) {
+ return emulation_register_iterator_construct (EMULATION_TYPE_REGISTER_ITERATOR, l);
+}
+
+
+gboolean emulation_register_iterator_next (EmulationRegisterIterator* self) {
+ gboolean result;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = self->priv->m_list->next != NULL;
+ return result;
+}
+
+
+EmulationRegister* emulation_register_iterator_get (EmulationRegisterIterator* self) {
+ EmulationRegister* result;
+ EmulationRegister* r;
+ g_return_val_if_fail (self != NULL, NULL);
+ r = (EmulationRegister*) self->priv->m_list->data;
+ self->priv->m_list = self->priv->m_list->next;
+ result = r;
+ return result;
+}
+
+
+static void emulation_value_register_iterator_init (GValue* value) {
+ value->data[0].v_pointer = NULL;
+}
+
+
+static void emulation_value_register_iterator_free_value (GValue* value) {
+ if (value->data[0].v_pointer) {
+ emulation_register_iterator_unref (value->data[0].v_pointer);
+ }
+}
+
+
+static void emulation_value_register_iterator_copy_value (const GValue* src_value, GValue* dest_value) {
+ if (src_value->data[0].v_pointer) {
+ dest_value->data[0].v_pointer = emulation_register_iterator_ref (src_value->data[0].v_pointer);
+ } else {
+ dest_value->data[0].v_pointer = NULL;
+ }
+}
+
+
+static gpointer emulation_value_register_iterator_peek_pointer (const GValue* value) {
+ return value->data[0].v_pointer;
+}
+
+
+static gchar* emulation_value_register_iterator_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ if (collect_values[0].v_pointer) {
+ EmulationRegisterIterator* object;
+ object = collect_values[0].v_pointer;
+ if (object->parent_instance.g_class == NULL) {
+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ }
+ value->data[0].v_pointer = emulation_register_iterator_ref (object);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ return NULL;
+}
+
+
+static gchar* emulation_value_register_iterator_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ EmulationRegisterIterator** object_p;
+ object_p = collect_values[0].v_pointer;
+ if (!object_p) {
+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+ }
+ if (!value->data[0].v_pointer) {
+ *object_p = NULL;
+ } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
+ *object_p = value->data[0].v_pointer;
+ } else {
+ *object_p = emulation_register_iterator_ref (value->data[0].v_pointer);
+ }
+ return NULL;
+}
+
+
+GParamSpec* emulation_param_spec_register_iterator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
+ EmulationParamSpecRegisterIterator* spec;
+ g_return_val_if_fail (g_type_is_a (object_type, EMULATION_TYPE_REGISTER_ITERATOR), NULL);
+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+ G_PARAM_SPEC (spec)->value_type = object_type;
+ return G_PARAM_SPEC (spec);
+}
+
+
+gpointer emulation_value_get_register_iterator (const GValue* value) {
+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EMULATION_TYPE_REGISTER_ITERATOR), NULL);
+ return value->data[0].v_pointer;
+}
+
+
+void emulation_value_set_register_iterator (GValue* value, gpointer v_object) {
+ EmulationRegisterIterator* old;
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EMULATION_TYPE_REGISTER_ITERATOR));
+ old = value->data[0].v_pointer;
+ if (v_object) {
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EMULATION_TYPE_REGISTER_ITERATOR));
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+ value->data[0].v_pointer = v_object;
+ emulation_register_iterator_ref (value->data[0].v_pointer);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ if (old) {
+ emulation_register_iterator_unref (old);
+ }
+}
+
+
+static void emulation_register_iterator_class_init (EmulationRegisterIteratorClass * klass) {
+ emulation_register_iterator_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_REGISTER_ITERATOR_CLASS (klass)->finalize = emulation_register_iterator_finalize;
+ g_type_class_add_private (klass, sizeof (EmulationRegisterIteratorPrivate));
+}
+
+
+static void emulation_register_iterator_instance_init (EmulationRegisterIterator * self) {
+ self->priv = EMULATION_REGISTER_ITERATOR_GET_PRIVATE (self);
+ self->ref_count = 1;
+}
+
+
+static void emulation_register_iterator_finalize (EmulationRegisterIterator* obj) {
+ EmulationRegisterIterator * self;
+ self = EMULATION_REGISTER_ITERATOR (obj);
+}
+
+
+GType emulation_register_iterator_get_type (void) {
+ static GType emulation_register_iterator_type_id = 0;
+ if (emulation_register_iterator_type_id == 0) {
+ static const GTypeValueTable g_define_type_value_table = { emulation_value_register_iterator_init, emulation_value_register_iterator_free_value, emulation_value_register_iterator_copy_value, emulation_value_register_iterator_peek_pointer, "p", emulation_value_register_iterator_collect_value, "p", emulation_value_register_iterator_lcopy_value };
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationRegisterIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_register_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationRegisterIterator), 0, (GInstanceInitFunc) emulation_register_iterator_instance_init, &g_define_type_value_table };
+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
+ emulation_register_iterator_type_id = g_type_register_fundamental (g_type_fundamental_next (), "EmulationRegisterIterator", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ }
+ return emulation_register_iterator_type_id;
+}
+
+
+gpointer emulation_register_iterator_ref (gpointer instance) {
+ EmulationRegisterIterator* self;
+ self = instance;
+ g_atomic_int_inc (&self->ref_count);
+ return instance;
+}
+
+
+void emulation_register_iterator_unref (gpointer instance) {
+ EmulationRegisterIterator* self;
+ self = instance;
+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
+ EMULATION_REGISTER_ITERATOR_GET_CLASS (self)->finalize (self);
+ g_type_free_instance ((GTypeInstance *) self);
+ }
+}
+
+
+EmulationRegisterIterator* emulation_register_list_iterator (EmulationRegisterList* self) {
+ EmulationRegisterIterator* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = emulation_register_iterator_new (self->priv->regs);
+ return result;
+}
+
+
+EmulationRegister* emulation_register_list_get (EmulationRegisterList* self, guint index) {
+ EmulationRegister* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = (EmulationRegister*) g_list_nth_data (self->priv->regs, index);
+ return result;
+}
+
+
+void emulation_register_list_append (EmulationRegisterList* self, EmulationRegister* reg) {
+ EmulationRegister* _tmp0_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (reg != NULL);
+ _tmp0_ = NULL;
+ self->priv->regs = g_list_append (self->priv->regs, (_tmp0_ = reg, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_)));
+}
+
+
+EmulationRegisterList* emulation_register_list_construct (GType object_type) {
+ EmulationRegisterList * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationRegisterList* emulation_register_list_new (void) {
+ return emulation_register_list_construct (EMULATION_TYPE_REGISTER_LIST);
+}
+
+
+guint emulation_register_list_get_length (EmulationRegisterList* self) {
+ guint result;
+ g_return_val_if_fail (self != NULL, 0U);
+ result = g_list_length (self->priv->regs);
+ return result;
+}
+
+
+GType emulation_register_list_get_extract_type (EmulationRegisterList* self) {
+ GType result;
+ g_return_val_if_fail (self != NULL, 0UL);
+ result = EMULATION_TYPE_REGISTER;
+ return result;
+}
+
+
+static GObject * emulation_register_list_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ EmulationRegisterListClass * klass;
+ GObjectClass * parent_class;
+ EmulationRegisterList * self;
+ klass = EMULATION_REGISTER_LIST_CLASS (g_type_class_peek (EMULATION_TYPE_REGISTER_LIST));
+ parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = EMULATION_REGISTER_LIST (obj);
+ {
+ GList* _tmp2_;
+ _tmp2_ = NULL;
+ self->priv->regs = (_tmp2_ = NULL, (self->priv->regs == NULL) ? NULL : (self->priv->regs = (_g_list_free_g_object_unref (self->priv->regs), NULL)), _tmp2_);
+ }
+ return obj;
+}
+
+
+static void emulation_register_list_class_init (EmulationRegisterListClass * klass) {
+ emulation_register_list_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationRegisterListPrivate));
+ G_OBJECT_CLASS (klass)->get_property = emulation_register_list_get_property;
+ G_OBJECT_CLASS (klass)->constructor = emulation_register_list_constructor;
+ G_OBJECT_CLASS (klass)->finalize = emulation_register_list_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_LIST_LENGTH, g_param_spec_uint ("length", "length", "length", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), EMULATION_REGISTER_LIST_EXTRACT_TYPE, g_param_spec_gtype ("extract-type", "extract-type", "extract-type", G_TYPE_NONE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+}
+
+
+static void emulation_register_list_instance_init (EmulationRegisterList * self) {
+ self->priv = EMULATION_REGISTER_LIST_GET_PRIVATE (self);
+}
+
+
+static void emulation_register_list_finalize (GObject* obj) {
+ EmulationRegisterList * self;
+ self = EMULATION_REGISTER_LIST (obj);
+ (self->priv->regs == NULL) ? NULL : (self->priv->regs = (_g_list_free_g_object_unref (self->priv->regs), NULL));
+ G_OBJECT_CLASS (emulation_register_list_parent_class)->finalize (obj);
+}
+
+
+GType emulation_register_list_get_type (void) {
+ static GType emulation_register_list_type_id = 0;
+ if (emulation_register_list_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationRegisterListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_register_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationRegisterList), 0, (GInstanceInitFunc) emulation_register_list_instance_init, NULL };
+ emulation_register_list_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationRegisterList", &g_define_type_info, 0);
+ }
+ return emulation_register_list_type_id;
+}
+
+
+static void emulation_register_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ EmulationRegisterList * self;
+ gpointer boxed;
+ self = EMULATION_REGISTER_LIST (object);
+ switch (property_id) {
+ case EMULATION_REGISTER_LIST_LENGTH:
+ g_value_set_uint (value, emulation_register_list_get_length (self));
+ break;
+ case EMULATION_REGISTER_LIST_EXTRACT_TYPE:
+ g_value_set_gtype (value, emulation_register_list_get_extract_type (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void _lambda2_ (void* ptr) {
+ g_free (ptr);
+}
+
+
+static void __lambda2__gdestroy_notify (void* data) {
+ _lambda2_ (data);
+}
+
+
+static void _lambda3_ (void* ptr) {
+ void* _tmp0_;
+ _tmp0_ = NULL;
+ g_object_unref ((_tmp0_ = ptr, G_IS_OBJECT (_tmp0_) ? ((GObject*) _tmp0_) : NULL));
+}
+
+
+static void __lambda3__gdestroy_notify (void* data) {
+ _lambda3_ (data);
+}
+
+
+static void _lambda4_ (void* ptr) {
+ g_free (ptr);
+}
+
+
+static void __lambda4__gdestroy_notify (void* data) {
+ _lambda4_ (data);
+}
+
+
+static void _lambda5_ (void* ptr) {
+ void* _tmp0_;
+ _tmp0_ = NULL;
+ g_object_unref ((_tmp0_ = ptr, G_IS_OBJECT (_tmp0_) ? ((GObject*) _tmp0_) : NULL));
+}
+
+
+static void __lambda5__gdestroy_notify (void* data) {
+ _lambda5_ (data);
+}
+
+
+static void _lambda6_ (void* ptr) {
+ g_free (ptr);
+}
+
+
+static void __lambda6__gdestroy_notify (void* data) {
+ _lambda6_ (data);
+}
+
+
+static void _lambda7_ (void* ptr) {
+ void* _tmp0_;
+ _tmp0_ = NULL;
+ g_object_unref ((_tmp0_ = ptr, G_IS_OBJECT (_tmp0_) ? ((GObject*) _tmp0_) : NULL));
+}
+
+
+static void __lambda7__gdestroy_notify (void* data) {
+ _lambda7_ (data);
+}
+
+
+static void _lambda8_ (void* ptr) {
+ g_free (ptr);
+}
+
+
+static void __lambda8__gdestroy_notify (void* data) {
+ _lambda8_ (data);
+}
+
+
+static void _lambda9_ (void* ptr) {
+ void* _tmp0_;
+ _tmp0_ = NULL;
+ g_object_unref ((_tmp0_ = ptr, G_IS_OBJECT (_tmp0_) ? ((GObject*) _tmp0_) : NULL));
+}
+
+
+static void __lambda9__gdestroy_notify (void* data) {
+ _lambda9_ (data);
+}
+
+
+EmulationSpecParser* emulation_spec_parser_construct (GType object_type, GHashTable** _info, GHashTable** _regs) {
+ EmulationSpecParser* self;
+ GHashTable* _tmp0_;
+ GHashTable* _tmp1_;
+ GHashTable* _tmp2_;
+ GHashTable* _tmp3_;
+ GHashTable* _tmp4_;
+ if (_info != NULL) {
+ *_info = NULL;
+ }
+ if (_regs != NULL) {
+ *_regs = NULL;
+ }
+ self = (EmulationSpecParser*) g_type_create_instance (object_type);
+ _tmp0_ = NULL;
+ self->priv->info = (*_info) = (_tmp0_ = g_hash_table_new_full (g_str_hash, g_str_equal, __lambda2__gdestroy_notify, __lambda3__gdestroy_notify), ((*_info) == NULL) ? NULL : ((*_info) = (g_hash_table_unref ((*_info)), NULL)), _tmp0_);
+ _tmp1_ = NULL;
+ self->priv->regs = (*_regs) = (_tmp1_ = g_hash_table_new_full (g_int_hash, g_int_equal, __lambda4__gdestroy_notify, __lambda5__gdestroy_notify), ((*_regs) == NULL) ? NULL : ((*_regs) = (g_hash_table_unref ((*_regs)), NULL)), _tmp1_);
+ _tmp2_ = NULL;
+ self->priv->groups_map = (_tmp2_ = g_hash_table_new (g_str_hash, g_str_equal), (self->priv->groups_map == NULL) ? NULL : (self->priv->groups_map = (g_hash_table_unref (self->priv->groups_map), NULL)), _tmp2_);
+ _tmp3_ = NULL;
+ self->priv->enums_map = (_tmp3_ = g_hash_table_new_full (g_str_hash, g_str_equal, __lambda6__gdestroy_notify, __lambda7__gdestroy_notify), (self->priv->enums_map == NULL) ? NULL : (self->priv->enums_map = (g_hash_table_unref (self->priv->enums_map), NULL)), _tmp3_);
+ _tmp4_ = NULL;
+ self->priv->regs_last_map = (_tmp4_ = g_hash_table_new_full (g_str_hash, g_str_equal, __lambda8__gdestroy_notify, __lambda9__gdestroy_notify), (self->priv->regs_last_map == NULL) ? NULL : (self->priv->regs_last_map = (g_hash_table_unref (self->priv->regs_last_map), NULL)), _tmp4_);
+ return self;
+}
+
+
+EmulationSpecParser* emulation_spec_parser_new (GHashTable** _info, GHashTable** _regs) {
+ return emulation_spec_parser_construct (EMULATION_TYPE_SPEC_PARSER, _info, _regs);
+}
+
+
+gboolean emulation_spec_parser_parse (EmulationSpecParser* self, const char* filename, const char* variant) {
+ gboolean result;
+ xmlNode* vnode;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (variant != NULL, FALSE);
+ xmlInitParser ();
+ self->priv->doc = xmlParseFile (filename);
+ if (self->priv->doc == NULL) {
+ fprintf (stdout, "Error: '%s' does not exist.\n", filename);
+ result = FALSE;
+ return result;
+ }
+ self->priv->root = xmlDocGetRootElement (self->priv->doc);
+ if (self->priv->root == NULL) {
+ xmlFreeDoc (self->priv->doc);
+ fprintf (stdout, "Error: '%s' does not contain a root node.\n", filename);
+ result = FALSE;
+ return result;
+ }
+ vnode = emulation_spec_parser_find_variant (self, variant);
+ if (vnode == NULL) {
+ xmlFreeDoc (self->priv->doc);
+ fprintf (stdout, "Error: Unable to find the '%s' variant.\n", variant);
+ result = FALSE;
+ return result;
+ }
+ emulation_spec_parser_index_groups (self);
+ emulation_spec_parser_index_enums (self);
+ emulation_spec_parser_xmlparse_variant (self, vnode);
+ xmlFreeDoc (self->priv->doc);
+ xmlCleanupParser ();
+ result = TRUE;
+ return result;
+}
+
+
+static inline void emulation_spec_parser_index_groups (EmulationSpecParser* self) {
+ g_return_if_fail (self != NULL);
+ {
+ xmlNode* iter;
+ iter = self->priv->root->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "group") == 0) {
+ const char* name;
+ name = emulation_spec_parser_get_single_attrib (self, iter, "name");
+ if (_vala_strcmp0 (name, "") == 0) {
+ fprintf (stdout, "Warning: Found a group with no name.\n");
+ } else {
+ if (g_hash_table_lookup (self->priv->groups_map, name) != NULL) {
+ fprintf (stdout, "Warning: Found more than one group by the name of '%s'.\n", name);
+ } else {
+ const char* _tmp1_;
+ _tmp1_ = NULL;
+ g_hash_table_insert (self->priv->groups_map, (_tmp1_ = name, (_tmp1_ == NULL) ? NULL : g_strdup (_tmp1_)), iter);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+static inline void emulation_spec_parser_index_enums (EmulationSpecParser* self) {
+ g_return_if_fail (self != NULL);
+ {
+ xmlNode* iter;
+ iter = self->priv->root->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "enum") == 0) {
+ emulation_spec_parser_xmlparse_enum (self, iter);
+ }
+ }
+ }
+ }
+}
+
+
+static inline xmlNode* emulation_spec_parser_find_variant (EmulationSpecParser* self, const char* name) {
+ xmlNode* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+ {
+ xmlNode* iter;
+ iter = self->priv->root->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "variant") == 0) {
+ if (_vala_strcmp0 (emulation_spec_parser_get_single_attrib (self, iter, "id"), name) == 0) {
+ result = iter;
+ return result;
+ }
+ }
+ }
+ }
+ }
+ result = NULL;
+ return result;
+}
+
+
+static inline xmlNode* emulation_spec_parser_find_group (EmulationSpecParser* self, const char* name) {
+ xmlNode* result;
+ xmlNode* node;
+ g_return_val_if_fail (self != NULL, NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+ node = g_hash_table_lookup (self->priv->groups_map, name);
+ if (node == NULL) {
+ fprintf (stdout, "Warning: Trying to use non-existant group '%s'\n", name);
+ }
+ result = node;
+ return result;
+}
+
+
+static inline EmulationBitfieldEnum* emulation_spec_parser_find_enum (EmulationSpecParser* self, const char* name) {
+ EmulationBitfieldEnum* result;
+ EmulationBitfieldEnum* e;
+ EmulationBitfieldEnum* _tmp0_;
+ g_return_val_if_fail (self != NULL, NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+ e = (EmulationBitfieldEnum*) g_hash_table_lookup (self->priv->enums_map, name);
+ if (e == NULL) {
+ fprintf (stdout, "Warning: Trying to use non-existant enum '%s'\n", name);
+ }
+ _tmp0_ = NULL;
+ result = (_tmp0_ = e, (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
+ return result;
+}
+
+
+static inline const char* emulation_spec_parser_get_single_attrib (EmulationSpecParser* self, xmlNode* node, const char* attrib) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ g_return_val_if_fail (attrib != NULL, NULL);
+ {
+ xmlAttr* prop;
+ prop = node->properties;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ prop = prop->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(prop != NULL)) {
+ break;
+ }
+ if (_vala_strcmp0 (prop->name, attrib) == 0) {
+ result = prop->children->content;
+ return result;
+ }
+ }
+ }
+ }
+ result = "";
+ return result;
+}
+
+
+static void emulation_spec_parser_xmlparse_variant (EmulationSpecParser* self, xmlNode* node) {
+ g_return_if_fail (self != NULL);
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "group") == 0) {
+ emulation_spec_parser_xmlparse_group (self, iter, (guint) 0, "");
+ } else {
+ if (_vala_strcmp0 (iter->name, "reg32") == 0) {
+ emulation_spec_parser_xmlparse_reg32 (self, iter, (guint) 0, "");
+ } else {
+ if (_vala_strcmp0 (iter->name, "stripe") == 0) {
+ emulation_spec_parser_xmlparse_stripe (self, iter, (guint) 0, "");
+ } else {
+ if (_vala_strcmp0 (iter->name, "use-group") == 0) {
+ xmlNode* g;
+ g = emulation_spec_parser_find_group (self, emulation_spec_parser_get_single_attrib (self, iter, "ref"));
+ if (g != NULL) {
+ emulation_spec_parser_xmlparse_group (self, g, (guint) 0, "");
+ }
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in variant.\n", iter->name);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+
+static void emulation_spec_parser_xmlparse_group (EmulationSpecParser* self, xmlNode* node, guint offset, const char* _name) {
+ char* name;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (_name != NULL);
+ name = g_strconcat (_name, emulation_spec_parser_get_single_attrib (self, node, "prepend"), NULL);
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "reg32") == 0) {
+ emulation_spec_parser_xmlparse_reg32 (self, iter, offset, name);
+ } else {
+ if (_vala_strcmp0 (iter->name, "stripe") == 0) {
+ emulation_spec_parser_xmlparse_stripe (self, iter, offset, name);
+ } else {
+ if (_vala_strcmp0 (iter->name, "use-group") == 0) {
+ xmlNode* g;
+ g = emulation_spec_parser_find_group (self, emulation_spec_parser_get_single_attrib (self, iter, "ref"));
+ if (g != NULL) {
+ emulation_spec_parser_xmlparse_group (self, g, offset, name);
+ }
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in group.\n", iter->name);
+ }
+ }
+ }
+ }
+ }
+ }
+ name = (g_free (name), NULL);
+}
+
+
+static void emulation_spec_parser_xmlparse_stripe (EmulationSpecParser* self, xmlNode* node, guint offset, const char* _name) {
+ char* name;
+ guint stride;
+ guint length;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (_name != NULL);
+ name = g_strconcat (_name, emulation_spec_parser_get_single_attrib (self, node, "name"), NULL);
+ stride = (guint) strtoul (emulation_spec_parser_get_single_attrib (self, node, "stride"), NULL, 0);
+ length = (guint) strtoul (emulation_spec_parser_get_single_attrib (self, node, "length"), NULL, 0);
+ offset = offset + ((guint) strtoul (emulation_spec_parser_get_single_attrib (self, node, "offset"), NULL, 0));
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "reg32") == 0) {
+ {
+ guint i;
+ i = (guint) 0;
+ {
+ gboolean _tmp1_;
+ _tmp1_ = TRUE;
+ while (TRUE) {
+ if (!_tmp1_) {
+ i++;
+ }
+ _tmp1_ = FALSE;
+ if (!(i < length)) {
+ break;
+ }
+ emulation_spec_parser_xmlparse_reg32 (self, iter, offset + (i * stride), name);
+ }
+ }
+ }
+ } else {
+ if (_vala_strcmp0 (iter->name, "stripe") == 0) {
+ {
+ guint i;
+ i = (guint) 0;
+ {
+ gboolean _tmp2_;
+ _tmp2_ = TRUE;
+ while (TRUE) {
+ if (!_tmp2_) {
+ i++;
+ }
+ _tmp2_ = FALSE;
+ if (!(i < length)) {
+ break;
+ }
+ emulation_spec_parser_xmlparse_stripe (self, iter, offset + (i * stride), name);
+ }
+ }
+ }
+ } else {
+ if (_vala_strcmp0 (iter->name, "use-group") == 0) {
+ xmlNode* g;
+ g = emulation_spec_parser_find_group (self, emulation_spec_parser_get_single_attrib (self, iter, "ref"));
+ if (g != NULL) {
+ {
+ guint i;
+ i = (guint) 0;
+ {
+ gboolean _tmp3_;
+ _tmp3_ = TRUE;
+ while (TRUE) {
+ if (!_tmp3_) {
+ i++;
+ }
+ _tmp3_ = FALSE;
+ if (!(i < length)) {
+ break;
+ }
+ emulation_spec_parser_xmlparse_group (self, g, offset + (i * stride), name);
+ }
+ }
+ }
+ }
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in stripe.\n", iter->name);
+ }
+ }
+ }
+ }
+ }
+ }
+ name = (g_free (name), NULL);
+}
+
+
+static guint* _uint_dup (guint* self) {
+ guint* dup;
+ dup = g_new0 (guint, 1);
+ memcpy (dup, self, sizeof (guint));
+ return dup;
+}
+
+
+static glong string_get_length (const char* self) {
+ glong result;
+ g_return_val_if_fail (self != NULL, 0L);
+ result = g_utf8_strlen (self, -1);
+ return result;
+}
+
+
+static void emulation_spec_parser_xmlparse_reg32 (EmulationSpecParser* self, xmlNode* node, guint offset, const char* _name) {
+ char* name;
+ EmulationRegisterList* _tmp0_;
+ EmulationRegisterList* regarr;
+ EmulationRegisterInfo* _tmp4_;
+ EmulationRegisterInfo* reginfo;
+ EmulationRegister* reg;
+ guint _tmp11_;
+ EmulationRegister* _tmp12_;
+ EmulationRegister* last_reg;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (_name != NULL);
+ name = g_strconcat (_name, emulation_spec_parser_get_single_attrib (self, node, "name"), NULL);
+ offset = offset + ((guint) strtoul (emulation_spec_parser_get_single_attrib (self, node, "offset"), NULL, 0));
+ _tmp0_ = NULL;
+ regarr = (_tmp0_ = (EmulationRegisterList*) g_hash_table_lookup (self->priv->regs, &offset), (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
+ if (regarr == NULL) {
+ guint* _tmp1_;
+ EmulationRegisterList* _tmp3_;
+ EmulationRegisterList* _tmp2_;
+ _tmp1_ = NULL;
+ g_hash_table_insert (self->priv->regs, (_tmp1_ = &offset, (_tmp1_ == NULL) ? NULL : _uint_dup (_tmp1_)), emulation_register_list_new ());
+ _tmp3_ = NULL;
+ _tmp2_ = NULL;
+ regarr = (_tmp3_ = (_tmp2_ = (EmulationRegisterList*) g_hash_table_lookup (self->priv->regs, &offset), (_tmp2_ == NULL) ? NULL : g_object_ref (_tmp2_)), (regarr == NULL) ? NULL : (regarr = (g_object_unref (regarr), NULL)), _tmp3_);
+ }
+ _tmp4_ = NULL;
+ reginfo = (_tmp4_ = (EmulationRegisterInfo*) g_hash_table_lookup (self->priv->info, name), (_tmp4_ == NULL) ? NULL : g_object_ref (_tmp4_));
+ if (reginfo == NULL) {
+ EmulationRegisterInfo* ri;
+ const char* _tmp5_;
+ char* access;
+ EmulationRegisterInfo* _tmp8_;
+ const char* _tmp7_;
+ EmulationRegisterInfo* _tmp10_;
+ EmulationRegisterInfo* _tmp9_;
+ ri = emulation_register_info_new ();
+ emulation_register_info_set_name (ri, name);
+ emulation_register_info_set_addr (ri, offset);
+ _tmp5_ = NULL;
+ access = (_tmp5_ = emulation_spec_parser_get_single_attrib (self, node, "access"), (_tmp5_ == NULL) ? NULL : g_strdup (_tmp5_));
+ {
+ gint i;
+ i = 0;
+ {
+ gboolean _tmp6_;
+ _tmp6_ = TRUE;
+ while (TRUE) {
+ if (!_tmp6_) {
+ i++;
+ }
+ _tmp6_ = FALSE;
+ if (!(i < string_get_length (access))) {
+ break;
+ }
+ switch (g_utf8_get_char (g_utf8_offset_to_pointer (access, i))) {
+ case 'r':
+ case 'R':
+ {
+ emulation_register_info_set_access (ri, emulation_register_info_get_access (ri) | ((guint8) EMULATION_ACCESS_TYPE_READ));
+ break;
+ }
+ case 'w':
+ case 'W':
+ {
+ emulation_register_info_set_access (ri, emulation_register_info_get_access (ri) | ((guint8) EMULATION_ACCESS_TYPE_WRITE));
+ break;
+ }
+ }
+ }
+ }
+ }
+ _tmp8_ = NULL;
+ _tmp7_ = NULL;
+ g_hash_table_insert (self->priv->info, (_tmp7_ = name, (_tmp7_ == NULL) ? NULL : g_strdup (_tmp7_)), (_tmp8_ = ri, (_tmp8_ == NULL) ? NULL : g_object_ref (_tmp8_)));
+ _tmp10_ = NULL;
+ _tmp9_ = NULL;
+ reginfo = (_tmp10_ = (_tmp9_ = (EmulationRegisterInfo*) g_hash_table_lookup (self->priv->info, name), (_tmp9_ == NULL) ? NULL : g_object_ref (_tmp9_)), (reginfo == NULL) ? NULL : (reginfo = (g_object_unref (reginfo), NULL)), _tmp10_);
+ (ri == NULL) ? NULL : (ri = (g_object_unref (ri), NULL));
+ access = (g_free (access), NULL);
+ }
+ reg = emulation_register_new ();
+ emulation_register_set_addr (reg, offset);
+ emulation_register_set_num (reg, (_tmp11_ = emulation_register_info_get_count (reginfo), emulation_register_info_set_count (reginfo, _tmp11_ + 1), _tmp11_));
+ emulation_register_set_info (reg, reginfo);
+ emulation_register_set_prev (reg, NULL);
+ emulation_register_set_next (reg, NULL);
+ emulation_register_list_append (regarr, reg);
+ _tmp12_ = NULL;
+ last_reg = (_tmp12_ = (EmulationRegister*) g_hash_table_lookup (self->priv->regs_last_map, name), (_tmp12_ == NULL) ? NULL : g_object_ref (_tmp12_));
+ if (last_reg == NULL) {
+ EmulationRegister* _tmp14_;
+ const char* _tmp13_;
+ _tmp14_ = NULL;
+ _tmp13_ = NULL;
+ g_hash_table_insert (self->priv->regs_last_map, (_tmp13_ = name, (_tmp13_ == NULL) ? NULL : g_strdup (_tmp13_)), (_tmp14_ = reg, (_tmp14_ == NULL) ? NULL : g_object_ref (_tmp14_)));
+ } else {
+ EmulationRegister* _tmp16_;
+ const char* _tmp15_;
+ emulation_register_set_next (last_reg, reg);
+ emulation_register_set_prev (reg, last_reg);
+ _tmp16_ = NULL;
+ _tmp15_ = NULL;
+ g_hash_table_replace (self->priv->regs_last_map, (_tmp15_ = name, (_tmp15_ == NULL) ? NULL : g_strdup (_tmp15_)), (_tmp16_ = reg, (_tmp16_ == NULL) ? NULL : g_object_ref (_tmp16_)));
+ }
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp17_;
+ _tmp17_ = TRUE;
+ while (TRUE) {
+ if (!_tmp17_) {
+ iter = iter->next;
+ }
+ _tmp17_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "bitfield") == 0) {
+ emulation_spec_parser_xmlparse_bitfield (self, iter, reginfo);
+ } else {
+ if (_vala_strcmp0 (iter->name, "doc") == 0) {
+ if (emulation_register_info_get_doc (reginfo) == NULL) {
+ char* _tmp18_;
+ _tmp18_ = NULL;
+ emulation_register_info_set_doc (reginfo, _tmp18_ = xmlNodeGetContent (iter));
+ _tmp18_ = (g_free (_tmp18_), NULL);
+ }
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in reg32.\n", iter->name);
+ }
+ }
+ }
+ }
+ }
+ name = (g_free (name), NULL);
+ (regarr == NULL) ? NULL : (regarr = (g_object_unref (regarr), NULL));
+ (reginfo == NULL) ? NULL : (reginfo = (g_object_unref (reginfo), NULL));
+ (reg == NULL) ? NULL : (reg = (g_object_unref (reg), NULL));
+ (last_reg == NULL) ? NULL : (last_reg = (g_object_unref (last_reg), NULL));
+}
+
+
+static void emulation_spec_parser_xmlparse_enum (EmulationSpecParser* self, xmlNode* node) {
+ const char* name;
+ const char* _tmp0_;
+ EmulationBitfieldEnum* _tmp1_;
+ EmulationBitfieldEnum* enu;
+ g_return_if_fail (self != NULL);
+ name = emulation_spec_parser_get_single_attrib (self, node, "name");
+ _tmp0_ = NULL;
+ g_hash_table_insert (self->priv->enums_map, (_tmp0_ = name, (_tmp0_ == NULL) ? NULL : g_strdup (_tmp0_)), emulation_bitfield_enum_new ());
+ _tmp1_ = NULL;
+ enu = (_tmp1_ = (EmulationBitfieldEnum*) g_hash_table_lookup (self->priv->enums_map, name), EMULATION_IS_BITFIELD_ENUM (_tmp1_) ? ((EmulationBitfieldEnum*) _tmp1_) : NULL);
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp2_;
+ _tmp2_ = TRUE;
+ while (TRUE) {
+ if (!_tmp2_) {
+ iter = iter->next;
+ }
+ _tmp2_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "value") == 0) {
+ emulation_spec_parser_xmlparse_value (self, iter, enu);
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in enum.\n", iter->name);
+ }
+ }
+ }
+ }
+}
+
+
+static void emulation_spec_parser_xmlparse_bitfield (EmulationSpecParser* self, xmlNode* node, EmulationRegisterInfo* reginfo) {
+ EmulationBitfield* b;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (reginfo != NULL);
+ b = emulation_bitfield_new ();
+ emulation_bitfield_set_name (b, emulation_spec_parser_get_single_attrib (self, node, "name"));
+ emulation_bitfield_set_high (b, (guint8) strtoul (emulation_spec_parser_get_single_attrib (self, node, "high"), NULL, 0));
+ emulation_bitfield_set_low (b, (guint8) strtoul (emulation_spec_parser_get_single_attrib (self, node, "low"), NULL, 0));
+ emulation_bitfield_set_doc (b, "");
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (iter->type != XML_ELEMENT_NODE) {
+ continue;
+ }
+ if (_vala_strcmp0 (iter->name, "value") == 0) {
+ if (emulation_bitfield_get_enu (b) == NULL) {
+ EmulationBitfieldEnum* _tmp1_;
+ _tmp1_ = NULL;
+ emulation_bitfield_set_enu (b, _tmp1_ = emulation_bitfield_enum_new ());
+ (_tmp1_ == NULL) ? NULL : (_tmp1_ = (g_object_unref (_tmp1_), NULL));
+ }
+ emulation_spec_parser_xmlparse_value (self, iter, emulation_bitfield_get_enu (b));
+ } else {
+ if (_vala_strcmp0 (iter->name, "use-enum") == 0) {
+ EmulationBitfieldEnum* _tmp2_;
+ _tmp2_ = NULL;
+ emulation_bitfield_set_enu (b, _tmp2_ = emulation_spec_parser_find_enum (self, emulation_spec_parser_get_single_attrib (self, iter, "ref")));
+ (_tmp2_ == NULL) ? NULL : (_tmp2_ = (g_object_unref (_tmp2_), NULL));
+ } else {
+ if (_vala_strcmp0 (iter->name, "doc") == 0) {
+ if (emulation_bitfield_get_doc (b) == NULL) {
+ char* _tmp3_;
+ _tmp3_ = NULL;
+ emulation_bitfield_set_doc (b, _tmp3_ = xmlNodeGetContent (iter));
+ _tmp3_ = (g_free (_tmp3_), NULL);
+ }
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in bitfield.\n", iter->name);
+ }
+ }
+ }
+ }
+ }
+ }
+ emulation_register_info_append (reginfo, b);
+ (b == NULL) ? NULL : (b = (g_object_unref (b), NULL));
+}
+
+
+static void emulation_spec_parser_xmlparse_value (EmulationSpecParser* self, xmlNode* node, EmulationBitfieldEnum* enu) {
+ EmulationBitfieldValue* v;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (enu != NULL);
+ v = emulation_bitfield_value_new ();
+ emulation_bitfield_value_set_val (v, (guint32) strtoul (emulation_spec_parser_get_single_attrib (self, node, "value"), NULL, 0));
+ emulation_bitfield_value_set_name (v, emulation_spec_parser_get_single_attrib (self, node, "name"));
+ emulation_bitfield_value_set_doc (v, "");
+ {
+ xmlNode* iter;
+ iter = node->children;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = TRUE;
+ while (TRUE) {
+ if (!_tmp0_) {
+ iter = iter->next;
+ }
+ _tmp0_ = FALSE;
+ if (!(iter != NULL)) {
+ break;
+ }
+ if (_vala_strcmp0 (iter->name, "doc") == 0) {
+ char* _tmp1_;
+ _tmp1_ = NULL;
+ emulation_bitfield_value_set_doc (v, _tmp1_ = xmlNodeGetContent (iter));
+ _tmp1_ = (g_free (_tmp1_), NULL);
+ } else {
+ fprintf (stdout, "Warning: Unknown rules-ng tag '%s' in value.\n", iter->name);
+ }
+ }
+ }
+ }
+ emulation_bitfield_enum_append (enu, v);
+ (v == NULL) ? NULL : (v = (g_object_unref (v), NULL));
+}
+
+
+static void emulation_value_spec_parser_init (GValue* value) {
+ value->data[0].v_pointer = NULL;
+}
+
+
+static void emulation_value_spec_parser_free_value (GValue* value) {
+ if (value->data[0].v_pointer) {
+ emulation_spec_parser_unref (value->data[0].v_pointer);
+ }
+}
+
+
+static void emulation_value_spec_parser_copy_value (const GValue* src_value, GValue* dest_value) {
+ if (src_value->data[0].v_pointer) {
+ dest_value->data[0].v_pointer = emulation_spec_parser_ref (src_value->data[0].v_pointer);
+ } else {
+ dest_value->data[0].v_pointer = NULL;
+ }
+}
+
+
+static gpointer emulation_value_spec_parser_peek_pointer (const GValue* value) {
+ return value->data[0].v_pointer;
+}
+
+
+static gchar* emulation_value_spec_parser_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ if (collect_values[0].v_pointer) {
+ EmulationSpecParser* object;
+ object = collect_values[0].v_pointer;
+ if (object->parent_instance.g_class == NULL) {
+ return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
+ return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
+ }
+ value->data[0].v_pointer = emulation_spec_parser_ref (object);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ return NULL;
+}
+
+
+static gchar* emulation_value_spec_parser_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+ EmulationSpecParser** object_p;
+ object_p = collect_values[0].v_pointer;
+ if (!object_p) {
+ return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+ }
+ if (!value->data[0].v_pointer) {
+ *object_p = NULL;
+ } else if (collect_flags && G_VALUE_NOCOPY_CONTENTS) {
+ *object_p = value->data[0].v_pointer;
+ } else {
+ *object_p = emulation_spec_parser_ref (value->data[0].v_pointer);
+ }
+ return NULL;
+}
+
+
+GParamSpec* emulation_param_spec_spec_parser (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
+ EmulationParamSpecSpecParser* spec;
+ g_return_val_if_fail (g_type_is_a (object_type, EMULATION_TYPE_SPEC_PARSER), NULL);
+ spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
+ G_PARAM_SPEC (spec)->value_type = object_type;
+ return G_PARAM_SPEC (spec);
+}
+
+
+gpointer emulation_value_get_spec_parser (const GValue* value) {
+ g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EMULATION_TYPE_SPEC_PARSER), NULL);
+ return value->data[0].v_pointer;
+}
+
+
+void emulation_value_set_spec_parser (GValue* value, gpointer v_object) {
+ EmulationSpecParser* old;
+ g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EMULATION_TYPE_SPEC_PARSER));
+ old = value->data[0].v_pointer;
+ if (v_object) {
+ g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EMULATION_TYPE_SPEC_PARSER));
+ g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
+ value->data[0].v_pointer = v_object;
+ emulation_spec_parser_ref (value->data[0].v_pointer);
+ } else {
+ value->data[0].v_pointer = NULL;
+ }
+ if (old) {
+ emulation_spec_parser_unref (old);
+ }
+}
+
+
+static void emulation_spec_parser_class_init (EmulationSpecParserClass * klass) {
+ emulation_spec_parser_parent_class = g_type_class_peek_parent (klass);
+ EMULATION_SPEC_PARSER_CLASS (klass)->finalize = emulation_spec_parser_finalize;
+ g_type_class_add_private (klass, sizeof (EmulationSpecParserPrivate));
+}
+
+
+static void emulation_spec_parser_instance_init (EmulationSpecParser * self) {
+ self->priv = EMULATION_SPEC_PARSER_GET_PRIVATE (self);
+ self->ref_count = 1;
+}
+
+
+static void emulation_spec_parser_finalize (EmulationSpecParser* obj) {
+ EmulationSpecParser * self;
+ self = EMULATION_SPEC_PARSER (obj);
+ (self->priv->groups_map == NULL) ? NULL : (self->priv->groups_map = (g_hash_table_unref (self->priv->groups_map), NULL));
+ (self->priv->enums_map == NULL) ? NULL : (self->priv->enums_map = (g_hash_table_unref (self->priv->enums_map), NULL));
+ (self->priv->regs_last_map == NULL) ? NULL : (self->priv->regs_last_map = (g_hash_table_unref (self->priv->regs_last_map), NULL));
+}
+
+
+GType emulation_spec_parser_get_type (void) {
+ static GType emulation_spec_parser_type_id = 0;
+ if (emulation_spec_parser_type_id == 0) {
+ static const GTypeValueTable g_define_type_value_table = { emulation_value_spec_parser_init, emulation_value_spec_parser_free_value, emulation_value_spec_parser_copy_value, emulation_value_spec_parser_peek_pointer, "p", emulation_value_spec_parser_collect_value, "p", emulation_value_spec_parser_lcopy_value };
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationSpecParserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_spec_parser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationSpecParser), 0, (GInstanceInitFunc) emulation_spec_parser_instance_init, &g_define_type_value_table };
+ static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
+ emulation_spec_parser_type_id = g_type_register_fundamental (g_type_fundamental_next (), "EmulationSpecParser", &g_define_type_info, &g_define_type_fundamental_info, 0);
+ }
+ return emulation_spec_parser_type_id;
+}
+
+
+gpointer emulation_spec_parser_ref (gpointer instance) {
+ EmulationSpecParser* self;
+ self = instance;
+ g_atomic_int_inc (&self->ref_count);
+ return instance;
+}
+
+
+void emulation_spec_parser_unref (gpointer instance) {
+ EmulationSpecParser* self;
+ self = instance;
+ if (g_atomic_int_dec_and_test (&self->ref_count)) {
+ EMULATION_SPEC_PARSER_GET_CLASS (self)->finalize (self);
+ g_type_free_instance ((GTypeInstance *) self);
+ }
+}
+
+
+gboolean emulation_spec_load_xml (EmulationSpec* self, const char* filename, const char* variant) {
+ gboolean result;
+ EmulationSpecParser* xml;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (filename != NULL, FALSE);
+ g_return_val_if_fail (variant != NULL, FALSE);
+ xml = emulation_spec_parser_new (&self->priv->info, &self->priv->regs);
+ result = emulation_spec_parser_parse (xml, filename, variant);
+ (xml == NULL) ? NULL : (xml = (emulation_spec_parser_unref (xml), NULL));
+ return result;
+}
+
+
+EmulationRegisterList* emulation_spec_translate_addr (EmulationSpec* self, guint addr) {
+ EmulationRegisterList* result;
+ EmulationRegisterList* _tmp0_;
+ g_return_val_if_fail (self != NULL, NULL);
+ _tmp0_ = NULL;
+ result = (_tmp0_ = (EmulationRegisterList*) g_hash_table_lookup (self->priv->regs, &addr), (_tmp0_ == NULL) ? NULL : g_object_ref (_tmp0_));
+ return result;
+}
+
+
+EmulationSpec* emulation_spec_construct (GType object_type) {
+ EmulationSpec * self;
+ self = g_object_newv (object_type, 0, NULL);
+ return self;
+}
+
+
+EmulationSpec* emulation_spec_new (void) {
+ return emulation_spec_construct (EMULATION_TYPE_SPEC);
+}
+
+
+static void emulation_spec_class_init (EmulationSpecClass * klass) {
+ emulation_spec_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (EmulationSpecPrivate));
+ G_OBJECT_CLASS (klass)->finalize = emulation_spec_finalize;
+}
+
+
+static void emulation_spec_instance_init (EmulationSpec * self) {
+ self->priv = EMULATION_SPEC_GET_PRIVATE (self);
+}
+
+
+static void emulation_spec_finalize (GObject* obj) {
+ EmulationSpec * self;
+ self = EMULATION_SPEC (obj);
+ (self->priv->info == NULL) ? NULL : (self->priv->info = (g_hash_table_unref (self->priv->info), NULL));
+ (self->priv->regs == NULL) ? NULL : (self->priv->regs = (g_hash_table_unref (self->priv->regs), NULL));
+ G_OBJECT_CLASS (emulation_spec_parent_class)->finalize (obj);
+}
+
+
+GType emulation_spec_get_type (void) {
+ static GType emulation_spec_type_id = 0;
+ if (emulation_spec_type_id == 0) {
+ static const GTypeInfo g_define_type_info = { sizeof (EmulationSpecClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) emulation_spec_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EmulationSpec), 0, (GInstanceInitFunc) emulation_spec_instance_init, NULL };
+ emulation_spec_type_id = g_type_register_static (G_TYPE_OBJECT, "EmulationSpec", &g_define_type_info, 0);
+ }
+ return emulation_spec_type_id;
+}
+
+
+static int _vala_strcmp0 (const char * str1, const char * str2) {
+ if (str1 == NULL) {
+ return -(str1 != str2);
+ }
+ if (str2 == NULL) {
+ return str1 != str2;
+ }
+ return strcmp (str1, str2);
+}
+
+
+
+
diff --git a/src/registers.vala b/src/registers.vala
new file mode 100644
index 0000000..e54e3f3
--- /dev/null
+++ b/src/registers.vala
@@ -0,0 +1,449 @@
+namespace Emulation
+{
+ public enum AccessType {
+ READ = 1<<0,
+ WRITE = 1<<1
+ }
+
+ public class BitfieldValue : Object
+ {
+ public string name { get; internal set; }
+ public string doc { get; internal set; }
+ public uint32 val { get; internal set; }
+ }
+
+ public class BitfieldEnum : Object
+ {
+ private HashTable<uint32?, BitfieldValue> vals;
+
+ construct {
+ vals = new HashTable<uint32?, BitfieldValue>.full(int_hash, int_equal, (ptr) => { delete ptr; }, (ptr) => { (ptr as Object).unref(); });
+ }
+
+ public weak BitfieldValue? lookup(uint32 key) { return vals.lookup(key); }
+ internal void append(BitfieldValue v) { vals.insert(v.val, v); }
+ }
+
+ public class Bitfield : Object
+ {
+ public string name { get; internal set; default = null; }
+ public string doc { get; internal set; default = null; }
+ public uint8 high { get; internal set; default = 0; }
+ public uint8 low { get; internal set; default = 0; }
+ public BitfieldEnum? enu { get; internal set; default = null; }
+ }
+
+ public class BitfieldIterator
+ {
+ private weak List<Bitfield> m_list;
+
+ public BitfieldIterator(List<Bitfield> l)
+ {
+ m_list = l.first();
+ }
+
+ public bool next() { return (m_list.next != null); }
+ public new weak Bitfield get()
+ {
+ weak Bitfield r = m_list.data;
+ m_list = m_list.next;
+ return r;
+ }
+ }
+
+ public class RegisterInfo : Object
+ {
+ public string name { get; internal set; default = null; }
+ public string doc { get; internal set; default = null; }
+ public uint addr { get; internal set; default = 0; }
+ public uint count { get; internal set; default = 0; }
+ public uint8 access { get; internal set; default = 0; }
+
+ private List<Bitfield> bitfields;
+ public uint length { get { return bitfields.length(); } }
+ public Type extract_type { get { return typeof(Bitfield); } }
+ public BitfieldIterator iterator() { return new BitfieldIterator(bitfields); }
+ public new weak Bitfield get(uint index) { return bitfields.nth_data(index); }
+
+ construct {
+ bitfields = new List<Bitfield>();
+ }
+
+ internal void append(Bitfield b) { bitfields.append(b); }
+ }
+
+ public class Register : Object
+ {
+ public uint addr { get; internal set; }
+ public uint num { get; internal set; }
+ public weak RegisterInfo info { get; internal set; }
+ public weak Register? prev { get; internal set; }
+ public weak Register? next { get; internal set; }
+ }
+
+ public class RegisterIterator
+ {
+ private weak List<Register> m_list;
+
+ public RegisterIterator(List<Register> l)
+ {
+ m_list = l.first();
+ }
+
+ public bool next() { return (m_list.next != null); }
+ public new weak Register get()
+ {
+ weak Register r = m_list.data;
+ m_list = m_list.next;
+ return r;
+ }
+ }
+
+ public class RegisterList : Object
+ {
+ private List<Register> regs;
+
+ construct {
+ regs = new List<Register>();
+ }
+
+ public uint length { get { return regs.length(); } }
+ public Type extract_type { get { return typeof(Register); } }
+ public RegisterIterator iterator() { return new RegisterIterator(regs); }
+ public new weak Register get(uint index) { return regs.nth_data(index); }
+
+ internal void append(Register reg) { regs.append(reg); }
+ }
+
+ private class SpecParser
+ {
+ private weak HashTable<string, RegisterInfo> info;
+ private weak HashTable<uint?, RegisterList> regs;
+
+ private HashTable<string, Xml.Node *> groups_map;
+ private HashTable<string, BitfieldEnum> enums_map;
+ private HashTable<string, Register> regs_last_map;
+ private Xml.Doc *doc;
+ private Xml.Node *root;
+
+ public SpecParser(out HashTable<string, RegisterInfo> _info, out HashTable<uint?, RegisterList> _regs)
+ {
+ info = (_info = new HashTable<string, RegisterInfo>.full(str_hash, str_equal, (ptr) => { delete ptr; }, (ptr) => { (ptr as Object).unref(); }));
+ regs = (_regs = new HashTable<uint?, RegisterList>.full(int_hash, int_equal, (ptr) => { delete ptr; }, (ptr) => { (ptr as Object).unref(); }));
+ groups_map = new HashTable<string, Xml.Node *>(str_hash, str_equal);
+ enums_map = new HashTable<string, BitfieldEnum>.full(str_hash, str_equal, (ptr) => { delete ptr; }, (ptr) => { (ptr as Object).unref(); });
+ regs_last_map = new HashTable<string, Register>.full(str_hash, str_equal, (ptr) => { delete ptr; }, (ptr) => { (ptr as Object).unref(); });
+ }
+
+ public bool parse(string filename, string variant)
+ {
+ Xml.Parser.init();
+ doc = Xml.Parser.parse_file(filename);
+ if (doc == null) {
+ stdout.printf("Error: '%s' does not exist.\n", filename);
+ return false;
+ }
+
+ root = doc->get_root_element();
+ if (root == null) {
+ delete doc;
+ stdout.printf("Error: '%s' does not contain a root node.\n", filename);
+ return false;
+ }
+
+ var vnode = find_variant(variant);
+ if (vnode == null) {
+ delete doc;
+ stdout.printf("Error: Unable to find the '%s' variant.\n", variant);
+ return false;
+ }
+
+ index_groups();
+ index_enums();
+ xmlparse_variant(vnode);
+
+ delete doc;
+ Xml.Parser.cleanup();
+
+ return true;
+ }
+
+ private inline void index_groups()
+ {
+ for (Xml.Node *iter = root->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "group") {
+ unowned string name = get_single_attrib(iter, "name");
+ if (name == "") {
+ stdout.printf("Warning: Found a group with no name.\n");
+ } else if (groups_map.lookup(name) != null) {
+ stdout.printf("Warning: Found more than one group by the name of '%s'.\n", name);
+ } else {
+ groups_map.insert(name, iter);
+ }
+ }
+ }
+ }
+
+ private inline void index_enums()
+ {
+ for (Xml.Node *iter = root->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "enum") {
+ xmlparse_enum(iter);
+ }
+ }
+ }
+
+ private inline Xml.Node *find_variant(string name)
+ {
+ for (Xml.Node *iter = root->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "variant") {
+ if (get_single_attrib(iter, "id") == name) { return iter; }
+ }
+ }
+ return null;
+ }
+
+ private inline Xml.Node *find_group(string name)
+ {
+ Xml.Node *node = groups_map.lookup(name);
+ if (node == null) {
+ stdout.printf("Warning: Trying to use non-existant group '%s'\n", name);
+ }
+ return node;
+ }
+
+ private inline BitfieldEnum find_enum(string name)
+ {
+ weak BitfieldEnum e = enums_map.lookup(name);
+ if (e == null) {
+ stdout.printf("Warning: Trying to use non-existant enum '%s'\n", name);
+ }
+ return e;
+ }
+
+ private inline unowned string get_single_attrib(Xml.Node *node, string attrib)
+ {
+ for (Xml.Attr *prop = node->properties; prop != null; prop = prop->next) {
+ if (prop->name == attrib) {
+ return prop->children->content;
+ }
+ }
+ return "";
+ }
+
+ private void xmlparse_variant(Xml.Node *node)
+ {
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "group") {
+ xmlparse_group(iter, 0, "");
+ } else if (iter->name == "reg32") {
+ xmlparse_reg32(iter, 0, "");
+ } else if (iter->name == "stripe") {
+ xmlparse_stripe(iter, 0, "");
+ } else if (iter->name == "use-group") {
+ var g = find_group(get_single_attrib(iter, "ref"));
+ if (g != null) { xmlparse_group(g, 0, ""); }
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in variant.\n", iter->name);
+ }
+ }
+ }
+
+ private void xmlparse_group(Xml.Node *node, uint offset, string _name)
+ {
+ string name = _name + get_single_attrib(node, "prepend");
+
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "reg32") {
+ xmlparse_reg32(iter, offset, name);
+ } else if (iter->name == "stripe") {
+ xmlparse_stripe(iter, offset, name);
+ } else if (iter->name == "use-group") {
+ var g = find_group(get_single_attrib(iter, "ref"));
+ if (g != null) { xmlparse_group(g, offset, name); }
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in group.\n", iter->name);
+ }
+ }
+ }
+
+ private void xmlparse_stripe(Xml.Node *node, uint offset, string _name)
+ {
+ string name = _name + get_single_attrib(node, "name");
+ uint stride = (uint)get_single_attrib(node, "stride").to_ulong();
+ uint length = (uint)get_single_attrib(node, "length").to_ulong();
+ offset += (uint)get_single_attrib(node, "offset").to_ulong();
+
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "reg32") {
+ for (uint i = 0; i < length; i++) {
+ xmlparse_reg32(iter, offset + (i * stride), name);
+ }
+ } else if (iter->name == "stripe") {
+ for (uint i = 0; i < length; i++) {
+ xmlparse_stripe(iter, offset + (i * stride), name);
+ }
+ } else if (iter->name == "use-group") {
+ var g = find_group(get_single_attrib(iter, "ref"));
+ if (g != null) {
+ for (uint i = 0; i < length; i++) {
+ xmlparse_group(g, offset + (i * stride), name);
+ }
+ }
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in stripe.\n", iter->name);
+ }
+ }
+ }
+
+ private void xmlparse_reg32(Xml.Node *node, uint offset, string _name)
+ {
+ string name = _name + get_single_attrib(node, "name");
+ offset += (uint)get_single_attrib(node, "offset").to_ulong();
+
+ var regarr = regs.lookup(offset);
+ if (regarr == null) {
+ regs.insert(offset, new RegisterList());
+ regarr = regs.lookup(offset);
+ }
+
+ RegisterInfo reginfo = info.lookup(name);
+ if (reginfo == null) {
+ var ri = new RegisterInfo();
+ ri.name = name;
+ ri.addr = offset;
+ string access = get_single_attrib(node, "access");
+ for (int i = 0; i < access.length; i++) {
+ switch (access[i]) {
+ case 'r':
+ case 'R': ri.access |= AccessType.READ; break;
+ case 'w':
+ case 'W': ri.access |= AccessType.WRITE; break;
+ }
+ }
+
+ info.insert(name, ri);
+ reginfo = info.lookup(name);
+ }
+
+ var reg = new Register();
+ reg.addr = offset;
+ reg.num = reginfo.count++;
+ reg.info = reginfo;
+ reg.prev = null;
+ reg.next = null;
+ regarr.append(reg);
+
+ Register last_reg = regs_last_map.lookup(name);
+ if (last_reg == null) {
+ regs_last_map.insert(name, reg);
+ } else {
+ last_reg.next = reg;
+ reg.prev = last_reg;
+ regs_last_map.replace(name, reg);
+ }
+
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "bitfield") {
+ xmlparse_bitfield(iter, reginfo);
+ } else if (iter->name == "doc") {
+ if (reginfo.doc == null) { reginfo.doc = iter->get_content(); }
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in reg32.\n", iter->name);
+ }
+ }
+ }
+
+ private void xmlparse_enum(Xml.Node *node)
+ {
+ weak string name = get_single_attrib(node, "name");
+ enums_map.insert(name, new BitfieldEnum());
+ weak BitfieldEnum enu = enums_map.lookup(name) as BitfieldEnum;
+
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "value") {
+ xmlparse_value(iter, enu);
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in enum.\n", iter->name);
+ }
+ }
+ }
+
+ private void xmlparse_bitfield(Xml.Node *node, RegisterInfo reginfo)
+ {
+ Bitfield b = new Bitfield();
+ b.name = get_single_attrib(node, "name");
+ b.high = (uint8)get_single_attrib(node, "high").to_ulong();
+ b.low = (uint8)get_single_attrib(node, "low").to_ulong();
+ b.doc = "";
+
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->type != Xml.ElementType.ELEMENT_NODE) { continue; }
+
+ if (iter->name == "value") {
+ if (b.enu == null) {
+ b.enu = new BitfieldEnum();
+ }
+ xmlparse_value(iter, b.enu);
+ } else if (iter->name == "use-enum") {
+ b.enu = find_enum(get_single_attrib(iter, "ref"));
+ } else if (iter->name == "doc") {
+ if (b.doc == null) { b.doc = iter->get_content(); }
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in bitfield.\n", iter->name);
+ }
+ }
+
+ reginfo.append(b);
+ }
+
+ private void xmlparse_value(Xml.Node *node, BitfieldEnum enu)
+ {
+ BitfieldValue v = new BitfieldValue();
+ v.val = (uint32)get_single_attrib(node, "value").to_ulong();
+ v.name = get_single_attrib(node, "name");
+ v.doc = "";
+ for (Xml.Node *iter = node->children; iter != null; iter = iter->next) {
+ if (iter->name == "doc") {
+ v.doc = iter->get_content();
+ } else {
+ stdout.printf("Warning: Unknown rules-ng tag '%s' in value.\n", iter->name);
+ }
+ }
+ enu.append(v);
+ }
+ }
+
+ public class Spec : Object
+ {
+ private HashTable<string, RegisterInfo> info;
+ private HashTable<uint?, RegisterList> regs;
+
+ public bool load_xml(string filename, string variant)
+ {
+ var xml = new SpecParser(out info, out regs);
+ return xml.parse(filename, variant);
+ }
+
+ public RegisterList translate_addr(uint addr)
+ {
+ return regs.lookup(addr);
+ }
+ }
+}