commit 9f7d6f4786dc145eb47cf85cf5fcf71315498681 Author: Brian Holman Date: Mon Nov 9 18:44:56 2026 -0700 Build Capital Quest for CoCo 3 with maps and emulator tests diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..28415a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +build/ +obj/ +*.o +*.d +*.s +*.lst +*.map +*.link +*.bin +*.dsk +*.DSK +.DS_Store +*.vccgrant +*connection*.json +assets/debug.png +__pycache__/ +*.pyc diff --git a/CHATGPT_PROMPT.md b/CHATGPT_PROMPT.md new file mode 100644 index 0000000..dcea909 --- /dev/null +++ b/CHATGPT_PROMPT.md @@ -0,0 +1,96 @@ +Build a complete, polished **50 States and Capitals Quiz** in C for the Color Computer 3, using the installed **VCC Plus** and its public MCP interface. + +Implement and test the program. Work through sensible stages without stopping for routine implementation decisions. + +### Project repository + +Use the existing Git checkout on this machine at: + +`~/Development/CoCo/CoCoCapitalQuiz` + +The checkout is currently empty. Verify its Git root, branch, status and remote before editing, and preserve any work that may have appeared since these instructions were written. Create the quiz project within this checkout. Keep source, assets, attribution, reproducible build instructions and project documentation here; keep generated build outputs appropriately ignored. + +### Development environment + +- Target a **512 KB CoCo 3 with the 6809 processor**. +- Use VCC Plus’s bundled C toolchain and documented graphics/input facilities. Discover the live MCP capabilities and consult its installed manuals before choosing APIs. +- Use the installed application for builds, execution, captures and debugging. Do not require the VCC Plus source checkout, rebuild the emulator or patch its compilers. +- If the MCP connection is missing, guide me through connecting this C project. Continue independent design and data preparation while waiting. +- Preserve existing files and personal emulator media. +- If a genuine app limitation blocks progress, explain it and propose a reusable enhancement instead of using a private bridge or debugger memory writes. + +### Quiz behavior + +Include an accurate, verified dataset of **all 50 states and their capitals**. Alaska and Hawaii must be included. Washington, D.C. and territories are not additional questions. + +At the beginning, offer: + +1. **Multiple choice** +2. **Type the capital** + +Shuffle all 50 states for each new quiz. Ask every state exactly once, with no repeats or omissions. Show **Question 1 of 50** through **Question 50 of 50**, along with the current score. Seed the shuffle using available timing and start-input information so ordinary new games do not always repeat the same order. + +For each question, display the full state name and ask for its capital. + +**Multiple choice:** + +- Show four distinct choices: the correct capital and three capitals from other states. +- Randomize the correct answer’s position. +- Accept clearly labeled keyboard selections. +- After answering, explain whether it was correct and show the correct capital before continuing. + +**Typed answers:** + +- Accept capitals regardless of letter casing. +- Trim surrounding whitespace and tolerate repeated spaces. +- Support spaces, Backspace and Enter with bounded input handling. +- Support legitimate spelling variants such as “Saint Paul,” “St. Paul” and “St Paul.” +- Use a conservative spelling-distance check for answers close to the expected capital, including transposed letters. Say something like: **“That looks close. Check your spelling and try again.”** +- A near match must not automatically earn a point or reveal the correct spelling immediately. Let the player correct it or choose to reveal the answer and move on. +- An exact answer naming another state’s capital should be treated as incorrect, not automatically described as a spelling mistake. +- Count a successfully corrected spelling as correct, but track spelling corrections separately. Award at most one point per state. + +### United States map + +Use this as the visual reference: + +https://www.fla-shop.com/svg/usa/ + +Display a recognizable U.S. map with state boundaries, including Alaska and Hawaii insets. **Clearly highlight the state currently being asked.** Keep the state name visible in text as well. + +Small states must remain identifiable. Automatically show a regional enlargement or detail inset when useful, especially in the Northeast, while retaining enough national context to show where the region belongs. + +Adapt the map for the CoCo’s graphics resolution and memory budget. Convert or simplify the source into compact drawing data or indexed graphics during project preparation; do not attempt to render SVG at runtime. Keep geometry, state identities and quiz answers consistently associated so the wrong state cannot be highlighted. + +Preserve the map’s required attribution, source URL, license link and notice of adaptations in the project and an accessible credits screen. Keep text readable and use a highlight that stands out against neighboring states. + +### Results and navigation + +After question 50, show: + +- Correct answers out of 50. +- Percentage correct. +- How many correct answers required spelling correction. +- A readable, paginated review of missed states, the player’s answers and the correct capitals. + +Offer **Play Again** with a fresh shuffle and **Quit** back to BASIC. Explain controls on the title screen. Prevent a held answer key from accidentally answering the next question or skipping feedback. + +### Testing and delivery + +Test through the installed VCC Plus MCP tools using ordinary guest input and actual framebuffer captures. + +Verify: + +- All 50 state/capital pairs and their geometry associations. +- Every state appears once per quiz. +- Question numbering begins at 1 and ends at 50. +- Four unique multiple-choice options and varied answer positions. +- Correct uppercase, lowercase and mixed-case typed answers. +- Multiword capitals, supported aliases, misspellings, transpositions, wrong capitals and long input. +- Accurate scoring, spelling-correction accounting and final review. +- Alaska, Hawaii and small-state highlighting/zoom. +- Replay, key-release handling and clean exit. + +Where useful, use verified C-line or function-entry stops and read-only snapshots to inspect quiz state. Use deterministic test seeds for reproducible checks without making ordinary play deterministic. Do not change guest memory or registers to manufacture successful gameplay. + +Deliver the editable C project in the existing CoCoCapitalQuiz checkout, map assets and credits, runnable binary/disk image, concise build/play instructions, and a clear account of what actually passed or remains untested. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..94c8b85 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +# Built by VCC Plus using its bundled CMOC/6809 tools. No emulator source needed. +CMOC ?= cmoc +PERL ?= perl +WRITECOCOFILE ?= writecocofile +INSTALL_LOADER ?= install-coco-boot-loader +VCC_CONFIGURATION ?= Release +ifeq ($(VCC_CONFIGURATION),Debug) +OPTIM = -O2 -fno-omit-frame-pointer +else +OPTIM = -O2 +endif +ifeq ($(VCC_CONFIGURATION),Test) +CPPFLAGS += -DTEST_SEED=2709 +endif +CPPFLAGS += -Iinclude +CFLAGS = --coco --intermediate --deps --stack-space=2048 $(OPTIM) +SOURCES = main.c src/quiz.c src/ui.c src/states.c src/map_data.c +OBJECTS = $(SOURCES:%.c=obj/%.o) +.PHONY: all build disk clean assets test +all: disk +build: build/CAPITAL.bin +disk: build/CAPITAL.dsk +build/CAPITAL.bin: $(OBJECTS) + @mkdir -p build + "$(CMOC)" --coco --intermediate --org=2000 --limit=7800 -o $@ $(OBJECTS) -lgime -linput -lbcontrol -lhirestxt +obj/%.o: %.c include/quiz.h include/ui.h include/map_data.h Makefile + @mkdir -p $(dir $@) + "$(CMOC)" $(CPPFLAGS) $(CFLAGS) --intdir=$(dir $@) -c -o $@ $< +obj/boot.bin: tools/boot.c Makefile + @mkdir -p obj + "$(CMOC)" --dos -O0 --limit=2800 -o $@ $< +build/CAPITAL.dsk: build/CAPITAL.bin obj/boot.bin + $(PERL) -e 'print chr(255) x (35*18*256)' > $@ + "$(INSTALL_LOADER)" $@ obj/boot.bin + "$(WRITECOCOFILE)" $@ build/CAPITAL.bin +assets: + python3 tools/prepare_assets.py +test: + @mkdir -p build + cc -std=c99 -Wall -Wextra -Werror -DHOST_TEST -Iinclude tests/test_quiz.c src/quiz.c src/states.c -o build/test_quiz + ./build/test_quiz + python3 tests/check_assets.py +clean: + rm -rf obj build +-include $(OBJECTS:.o=.d) diff --git a/README.md b/README.md new file mode 100644 index 0000000..4e61fed --- /dev/null +++ b/README.md @@ -0,0 +1,82 @@ +# Capital Quest — 50 States and Capitals + +A C geography quiz for a **512 KB Color Computer 3 / Motorola 6809**, built with +**VCC Plus 3.5.0** and its bundled CMOC toolchain. A 320×192, 16-color national +map highlights the current state. Northeast and Hawaii detail views retain +the national overview. + +The application was generated with **ChatGPT Codex** using **GPT-6.1 Sol High**, +following the project brief in [CHATGPT_PROMPT.md](CHATGPT_PROMPT.md). Development +included builds and gameplay tests through VCC Plus’s public MCP interface. + +## Build and play + +1. In VCC Plus, choose **Develop → C Development → Open**, and select this folder. +2. Select **Release**, then **Build** (the declared target builds the disk). +3. Use **Show Build Products** to find `build/CAPITAL.dsk` and `CAPITAL.bin` in + the workbench's build snapshot. A delivered copy is also in this checkout's + ignored `build/` folder after the implementation session. +4. Mount your own copy of `CAPITAL.dsk` in a 512 KB 6809 Disk BASIC machine. + Type **DOS**, or `LOADM"CAPITAL.BIN":EXEC`. Keep personal media separate. + +Title: **1** multiple choice, **2** type the capital, **C** credits, **Q** quit. +Multiple choice: **1–4**. Typed answers: letters/spaces/periods, **Backspace** +(CoCo Left) and **Enter**. The Mac's Escape maps to CoCo Break and reveals an +answer. A near spelling offers **R** to edit the existing answer or **V** to +reveal. Only an exact/accepted alias earns a point. A successfully corrected +answer earns one point and increments the separate correction count. +Release keys between presses; **Space** advances after feedback. + +After all 50 questions: **R** paginated missed-answer review, **N** next review +page, **B** results, **P** play again, **Q** return to BASIC. Replay returns to +the mode menu. Normal games mix BASIC timer values, waiting-loop timing and +start input into the random seed. The program uses the CoCo 3's documented +high-speed clock during play and restores normal speed on exit. + +## Reproduce from the command line + +The workbench is the supported build/test path. An equivalent offline build +uses the *installed* app's bundled tools, without an emulator source checkout: + +```sh +export PATH="/Applications/VCC Plus.app/Contents/Resources/Toolchain/bin:$PATH" +make clean +make VCC_CONFIGURATION=Release disk +``` + +`Release` uses `-O2`. `Debug` retains frame pointers while using `-O2` to +fit the complete game in the same strict memory budget. `Test` uses `-O2` +and seed **2709** for reproducible +ordinary gameplay. Clean before switching configurations because the Makefile +uses a common object directory. VCC Plus builds fresh snapshots automatically. + +Code and static data are linked at `$2000`, limited to below `$7800`, with a +2 KiB stack allowance below `$8000`. The public GIME library reserves physical +`$40000–$4FFFF` for its two graphics pages. No raw graphics/MMU register writes, +SVG parsing, dynamic allocation or disk writes occur during quiz play. + +```sh +python3 tools/prepare_assets.py # offline map/data generation +make test # host logic and geometry checks +``` + +The editable inputs are `data/states.tsv`, `data/map-seeds.json`, +`assets/usa-source.svg`, `main.c`, `src/quiz.c` and `src/ui.c`. Generated drawing +and state C files are retained for toolchain-only builds. Build outputs are +ignored. The public MCP JSON-RPC client in `tools/vcc_mcp.py` takes an exported +private grant path; keep that grant outside Git. See [test evidence](docs/TESTING.md) +for actual emulator coverage and limitations, and [credits](assets/CREDITS.md) +for map attribution and licenses. + +For the complete public-MCP regression suite, export a private connection with +both Make and disposable playtests enabled, then run: + +```sh +PYTHONDONTWRITEBYTECODE=1 python3 tests/playtest.py /private/path/connection.json \ + --evidence /tmp/capital-quiz-evidence +``` + +This builds the advertised Test configuration, plays two complete quizzes with +ordinary physical keys, checks actual framebuffer text and state fill pixels, +and retains the test disks. Evidence stays outside the checkout until tests +finish so VCC Plus's watched source revision remains stable. diff --git a/assets/BCONTROL-NOTICE.txt b/assets/BCONTROL-NOTICE.txt new file mode 100644 index 0000000..a6531d4 --- /dev/null +++ b/assets/BCONTROL-NOTICE.txt @@ -0,0 +1,156 @@ +bcontrol 0.1.6 + +Public domain (upstream dedication) + + +--- Joystick.h --- +/* Joystick.h - Autonomous joystick functions for the CoCo. + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- Joystick_private.h --- +/* Joystick_private.h + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- Keyboard.c --- +/* keyin.c - Autonomous keyboard functions for the CoCo. + By Pierre Sarrazin + This file is in the public domain, except the parts that come from Color Basic. +*/ + +--- Keyboard.h --- +/* Keyboard.h - Autonomous keyboard functions for the CoCo. + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- README.md --- +BControl +======== + +By Pierre Sarrazin . + +This library is in the public domain, except the parts of Keyboard.c +that come from Color Basic. + +This library offers functions similar to Color Basic's INKEY$, +JOYSTK and BUTTON. It does not assume the presence of the Color +Basic interpreter. + + +# Usage + +To use the Keyboard object, instante an instance, then call +`Keyboard_init()` on it. Then call `Keyboard_poll()` the same way +one would call INKEY$ in a Basic program. Call `Keyboard_shutdown()` +when finished with the Keyboard object. + +To read the joystick axis values and button states on a CoCo or +Dragon, call `Joystick_getAxisValues()` and `Joystick_getButtonStates()`. +No initialization step is needed. + +However, to help the portability to OS-9 of a program that uses +the joystick, `Joystick_getAxisValuesAndButtonState()` should be used +instead of the other functions of Joystick.h. + +See Keyboard.h and Joystick.h for details. + + +# Dragon support + +To compile for the Dragon, pass TARGET=dragon to make. + + +# OS-9 support + +To compile for OS-9, pass TARGET=OS9 to make. + + +# Version history + + 0.1.0 2018-11-25 First public release. + 0.1.1 2019-06-03 Partial support for OS-9 added: + setScreenBuffer() not supported. + Removed the (non portable) startInCapsLock parameter + from `Keyboard_init()`. + 0.1.2 2019-09-21 Added missing OS9RawTerminal.h. + 0.1.3 2020-06-27 Added `Joystick_selectAnalogMuxInputs()` and + `Joystick_compareAxis()`, which allow custom, faster + axis polling (but is not usable under OS-9). + 0.1.4 2022-11-12 Fixed the Dragon executable extension in the makefile. + Added `Joystick_getAxisValuesAndButtonState()`, which + targets a single joystick and also works under OS-9. + Include "Joystick.h" to use it. + 0.1.5 2024-08-29 Joystick comparator read routine slightly optimized + with inline asm. (Not applicable to OS-9 version.) + Centralized some function prototypes. + Removed UTF-8 characters from Keyboard.c. + 0.1.6 2026-09-06 Added Joystick_getButtonStates2(). + Optimized Joystick_selectAnalogMuxInputs(). + Optimized Joystick_compareAxis(). + +--- bcontrol.c --- +/* bcontrol.c - Test and demo program. + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- compareAxis.c --- +/* compareAxis.c - Autonomous joystick functions for the CoCo. + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- disableSound.c --- +/* disableSound.c + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- enableSound.c --- +/* enableSound.c + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- getAxisValues.c --- +/* getAxisValues.c + By Pierre Sarrazin + This file is in the public domain. + + The current implementation is based on Color Basic's. + Improvements are welcome. +*/ + +--- getAxisValuesAndButtonState.c --- +/* getAxisValuesAndButtonState.c - Autonomous joystick functions for the CoCo. + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- getButtonStates.c --- +/* getButtonStates.c + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- getButtonStates2.c --- +/* getButtonStates2.c + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- readComparatorMultipleTries.c --- +/* readComparatorMultipleTries.c - Autonomous joystick functions for the CoCo. + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- selectAnalogMuxInputs.c --- +/* selectAnalogMuxInputs.c + By Pierre Sarrazin + This file is in the public domain. +*/ diff --git a/assets/CREDITS.md b/assets/CREDITS.md new file mode 100644 index 0000000..59d9e5b --- /dev/null +++ b/assets/CREDITS.md @@ -0,0 +1,31 @@ +# Map and font credits + +Map: **© Fla-shop.com**. Reference and license statement: + + +Original SVG retrieved 2026-11-09: + + +Licensed under **Creative Commons Attribution 4.0 International**: + + +The original copyright/license comment is preserved in `usa-source.svg`. +Adaptations: straight-path scan conversion, state-region identity assignment, +resolution reduction, one-pixel boundary simplification, recoloring, run-length +encoding, and Northeast/Hawaii detail crops. The national artwork already +contains Alaska and Hawaii insets. Insets are not to a common scale. Islands +smaller than a guest pixel may disappear. No endorsement is implied. +`C` on the title screen opens the in-game credits, including these source and +license URLs and the adaptation notice. + +Font: Pierre Sarrazin's **font5x8**, public domain, linked from VCC Plus's bundled +HiresTxt library. Header identifies the author and public-domain dedication. + +Disk boot helper: Pierre Sarrazin, **autostart.c 0.1.2**, public domain; adapted +from the installed Hello Disk template to load `CAPITAL.BIN`. + +CMOC and LWTOOLS are supplied by VCC Plus; the GIME helper is supplied by VCC +Plus (its public header is marked GPL-3.0-or-later). This project is distributed +under GPL-3.0-or-later to accommodate linked library code. See VCC Plus → +Licenses & Notices for the bundled toolchain's notices and source information. +The map remains CC BY 4.0 and the font/boot helper remain public domain. diff --git a/assets/HIRESTXT-NOTICE.txt b/assets/HIRESTXT-NOTICE.txt new file mode 100644 index 0000000..3b8af61 --- /dev/null +++ b/assets/HIRESTXT-NOTICE.txt @@ -0,0 +1,562 @@ +hirestxt 0.5.1 + +Public domain (upstream dedication) + + +--- README.md --- +hirestxt +======== + +By Pierre Sarrazin + +This library is in the public domain. + +It implements a software 51x24 or 42x24 black-on-green PMODE 4 text +screen (256x192x2), or a 64x24 16-color text screen in the CoCo 3's +320x200x16 graphics mode. It redirects printf() to that screen. + +Useful to get true lowercase, including Latin-1 accented characters, +on all CoCos, on the Dragon, and on NitrOS-9. + +Optionally supports several VT52 terminal sequences. + +A sample program is included. See the *Demo* section in this file. + +This library is intended to be compiled by CMOC. + +See the [CMOC home page](http://sarrazip.com/dev/cmoc.html). + + +## Setup + +The instructions apply when targetting the Color Basic environment. + +Do the following to initialize the 51x24 text screen at $0E00 on a CoCo +or Dragon. + +Put this directive somewhere at the beginning of the C file in question: + + #include "hirestxt.h" + +Then set up PMODE 4 green/black graphics, like this: + + width(32); /* PMODE graphics will only appear from 32x16 (does nothing on CoCo 1&2) */ + pmode(4, (byte *) 0x0E00); + pcls(255); + screen(1, 0); /* green/black */ + +Then define a `HiResTextScreenInit` object: + + struct HiResTextScreenInit init = + { + 51, /* characters per row */ + writeCharAt_51cols, /* must be consistent with previous field */ + 0x0E00, + TRUE /* redirects printf() to the 51x24 text screen */ + (word *) 0x112, /* pointer to a 60 Hz async counter (Color Basic's TIMER) */ + 0, /* default cursor blinking rate */ + NULL, /* use inkey(), i.e., Color Basic's INKEY$ */ + NULL, /* no sound on '\a' */ + }; + +Then call `initHiResTextScreen()` with the address of this object: + + initHiResTextScreen(&init); + +To use the 42x24 mode, replace 51 and `writeCharAt_51cols` with 42 and +`writeCharAt_42cols`. + +Optionally, to get the screen address from Basic instead of assuming +$0E00, use this expression in the `HiResTextScreenInit` struct initializer: + + (byte *) * (byte *) 0x00BC << 8 + +Then, see hirestxt.h for the available functions. + +To compile with this library, pass `-I ` to cmoc, where `` is +the directory where hirestxt.h is. + +To link with this library, specify `-L -lhirestxt` to the cmoc +invocation that does the linking. This specifies where the libhirestxt.a +file can be found. + + +## Demo + +The demo is compiled as `hirestxt.bin` for the CoCo and Dragon Basic +environments, and `hirestxt` for OS-9. + +Under OS-9, the demo must be executed from a 32x16 terminal. + + +## Dragon support + +To compile for the Dragon, pass `TARGET=dragon` to make. + + +## OS-9 support + +To compile for OS-9, pass `TARGET=os9` to make. + +This generates a demo in an OS-9 executable named `hirestxt`. Use the +[ToolShed](https://sourceforge.net/projects/toolshed/) `os9` command +to transfer this executable to an OS-9 virtual hard-disk (for example) +and to give it the execution attributes: + + os9 copy -r hirestxt the-disk.vhd,/CMDS/ + os9 attr -epe the-disk.vhd,/CMDS/hirestxt + +Under OS-9, the demo must be executed from a 32x16 terminal. + +This has been tested with [NitrOS-9](http://www.nitros9.org/battle.html) +EOU 1.0.1 and [CMOC](http://sarrazip.com/dev/cmoc.html) 0.1.89. +The /nil driver must be present. + + +## VT52 Support + +A subset of [VT52](https://en.wikipedia.org/wiki/VT52) terminal sequences +are supported by the code in function processConsoleOutChar() of +processConsoleOutChar.c. + +If this support is not needed, the code for it can be omitted by compiling +the library with HIRESTEXT_NO_VT52. + + +## License + +This library is in the public domain. + + +## Version history + + 0.1.0 - 2016-05-01 - First public release. + 0.1.1 - 2016-09-12 - Adapted to CMOC 0.1.31 re: inline asm. + 0.1.2 - 2016-12-26 - HIRESTEXT_NO_VT52 to avoid VT52 code. + 0.2.0 - 2017-12-01 - Adapted to modular compilation under CMOC 0.1.43. + 0.2.1 - 2018-04-03 - Adapted to modular compilation under CMOC 0.1.51. + 0.3.0 - 2018-09-20 - Added 42x24 text screen and 5x8 font. + Adapted to CMOC 0.1.53. + 0.3.1 - 2018-11-25 - Fixed linking error re: putBitmaskInScreenWord() in 42x24 mode. + Now compilable for the Dragon (make TARGET=dragon). + 0.4.0 - 2023-08-19 - initHiResTextScreen() and closeHiResTextScreen() do not change the + screen mode themselves anymore -- see the next section. + The HiResTextScreenInit struct must now receive a pointer + to a timer word. + It may also receive a pointer to an inkey-like function. + Replaced textScreenPageNum in struct HiResTextScreenInit with + the textScreenBuffer field, which removes a dependency on the SAM chip -- + see the next section. + Stopped exporting the global textScreenBuffer variable. + Removed the setTextScreenAddress() function. + Fixed typo in the name of the internal oldCHROUT global variable. + Merged all library code into a single .a file. + Most functions are now in their own file, to optimize the final executable size. + Most global variables are now fields of a single global struct instance. + Now usable under OS-9 (assumes that the /nil driver is installed). + Slightly optimized character writing routine. + 0.4.1 - 2023-09-02 - Added setInverseVideoMode() and setBoldMode() which allow writing + characters in inverted colors and/or in bold. + Added support for VT52 sequences p and q to turn inverse + video on of off, and E to home the cursor and clear the screen. + 0.4.2 - 2024-11-28 - Added showOS9PMode4Screen(), quitOS9Graphics(), OS9Timer_init(), + OS9Timer_shutdown() and OS9Timer_getTimerAddress() under OS-9. + Fixed a bug in the demo where the column of letters was displayed + too slowly. + 0.5.0 - 2025-03-14 - Added support for writing to a 64x24 text screen on a CoCo 3 320x192x16 + graphics screen. See initHiResTextScreen2(), setForegroundColor() et al. + hirestxt-demo.c gives an example. + The screen is now cleared from top to bottom instead of bottom up. + The demo now plays an audible bell character. + 0.5.1 - 2025-09-27 - Removed UTF-8 non-breaking space character from hirestxt-demo.c and + hirestxt.h, to resolve a compilation issue with GCC 14.2.0. + + +## Using version 0.5.x + +Version 0.5.0 introduced support for a 64x24 text mode in the CoCo 3 320x192x16 graphics mode. +This text mode is slower than using the CoCo 3's hardware 40- or 80-column text screens, but it +allows: + +* using the same hirestxt-based code to display text on a CoCo 1, 2 or 3, on a Dragon, or +on NitrOS-9; +* mixing text and graphics on the same screen, using a narrower font than the byte-aligned + font used by Basic's HPRINT command. + +The hirestxt-demo.c program shows examples of how to use both the CoCo 3 64x24 mode and the +original 51x24 and 42x24 modes on a 256x192x2 (PMODE 4) screen. + + +## Adapting to version 0.4.x + +The instructions apply when targetting the Color Basic environment. + +- Where the `HiResTextScreenInit` is initialized, add these values: + + - A value for the `timer` field, which must be the address of a 16-bit word that + gets incremented 60 times per second. + + - A zero for the `cursorAnimationLowTimerByteMask` field. + + - A NULL value for the `inkeyFuncPtr` field, to have the library use `inkey()`, + as before, to poll the keyboard. + + - A NULL value for the `bellFuncPtr` field, to have a call to Color Basic's + SOUND 1,1, as before, when character 7 is sent to the screen. + +- Execute this code before calling `initHiResTextScreen()`: + + initCoCoSupport(); + width(32); + pmode(4, A); + pcls(255); + screen(1, 0); + + Replace `A` with the address put in the `textScreenBuffer` field of struct + `HiResTextScreenInit`. + + To use the current address where ECB would draw PMODE 4 graphics, use this + expression: `(byte *) * (byte *) 0x00BC << 8` + + (This takes $BC, sees it as a byte pointer, gets that byte, sees it as a + 16-bit address, then shifts this address 8 bits left, to form the actual + address of the screen buffer.) + + Under other platforms, execute platform-specific code to set up a 256x192 + green/black 2-color graphics mode, then put its buffer address in + `textScreenBuffer`. + +- Execute this code after calling `closeHiResTextScreen()`: + + pmode(0, 0); + cls(255); + screen(0, 0); + +- If the program was using the `textScreenBuffer` global variable, it + should now stop using it and use the address that it puts in the + `textScreenBuffer` field of `HiResTextScreenInit` instead. + +- Similarly, the `hiResWidth` global variable has been replaced with + the `numColumns` field of `HiResTextScreenInit`. + +- The `textPosX` and `textPosY` global variables have been removed from + the public interface. Functions `getCursorColumn()` and `getCursorRow()` + have been added. The cursor can be moved with `moveCursor()`. + + +--- animateCursor.c --- +/* animateCursor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- clear.c --- +/* clear.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- clearRowsToEOS.c --- +/* clearRowsToEOS.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- closeHiResTextScreen.c --- +/* closeHiResTextScreen.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- clrscr.c --- +/* clrscr.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- clrtobot.c --- +/* clrtobot.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- clrtoeol.c --- +/* clrtoeol.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- fillNybbles.c --- +/* initHiResTextScreen2.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- font4x8.c --- +/* font4x8.c - ISO-8859-1 font for a 51x24 software text screen. + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- font4x8.h --- +/* font4x8.h - ISO-8859-1 font for a 51x24 software text screen. + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- font5x8.c --- +/* font5x8.c - ISO-8859-1 font for a 42x24 software text screen. + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- font5x8.h --- +/* font5x8.h - ISO-8859-1 font for a 42x24 software text screen. + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- getCursorColumn.c --- +/* getCursorColumn.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- getCursorRow.c --- +/* getCursorRow.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- hirestxt-demo.c --- +/* hirestxt-demo.c - Example program that uses hirestxt.h. + + By Pierre Sarrazin + This file is in the public domain. + + This demo uses VT52 sequences. + The library must NOT have been compiled with HIRESTEXT_NO_VT52. +*/ + +--- hirestxt.h --- +/* hirestxt.h - 51x24 black-on-green PMODE 4 text screen. + + By Pierre Sarrazin + This file is in the public domain. + + Quick Guide: + - Call initHiResTextScreen() first. + - End with a call to closeHiResTextScreen(). + - #define HIRESTEXT_NO_VT52 to avoid compiling the VT52 code. +*/ + +--- hirestxt_private.h --- +/* hirestxt_private.h - 51x24 black-on-green PMODE 4 text screen. + + By Pierre Sarrazin + This file is in the public domain. + +*/ + +--- init.c --- +/* init.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- initHiResTextScreen.c --- +/* initHiResTextScreen.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- initHiResTextScreen2.c --- +/* initHiResTextScreen2.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- initVT52.c --- +/* initVT52.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- invertPixelsAtCursor.c --- +/* invertPixelsAtCursor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- moveCursor.c --- +/* moveCursor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- os9timer.c --- +/* os9timer.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- processConsoleOutChar.c --- +/* processConsoleOutChar.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- putBitmaskInScreenWord.c --- +/* putBitmaskInScreenWord.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- quitOS9Graphics.c --- +/* quitOS9Graphics.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- removeCursor.c --- +/* removeCursor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- scrollTextScreenUp.c --- +/* scrollTextScreenUp.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- setBackgroundColor.c --- +/* setBackgroundColor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- setBoldMode.c --- +/* setBoldMode.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- setForegroundBoldColor.c --- +/* setForegroundBoldColor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- setForegroundColor.c --- +/* setForegroundColor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- setInverseVideoMode.c --- +/* setInverseVideoMode.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- showOS9PMode4Screen.c --- +/* showOS9PMode4Screen.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- waitKeyBlinkingCursor.c --- +/* waitKeyBlinkingCursor.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeCenteredLine.c --- +/* writeCenteredLine.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeChar.c --- +/* writeChar.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeCharAt.c --- +/* writeCharAt.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeCharAt_320x16.c --- +/* writeCharAt_320x16.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeCharAt_42cols.c --- +/* writeCharAt_42cols.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeCharAt_51cols.c --- +/* writeCharAt_51cols.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeDecWord.c --- +/* writeDecWord.c + + By Pierre Sarrazin + This file is in the public domain. +*/ + +--- writeString.c --- +/* writeString.c + + By Pierre Sarrazin + This file is in the public domain. +*/ diff --git a/assets/VCC-Guest-SDK-NOTICE.txt b/assets/VCC-Guest-SDK-NOTICE.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/assets/VCC-Guest-SDK-NOTICE.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. diff --git a/assets/preview-hawaii.png b/assets/preview-hawaii.png new file mode 100644 index 0000000..247b21c Binary files /dev/null and b/assets/preview-hawaii.png differ diff --git a/assets/preview-national.png b/assets/preview-national.png new file mode 100644 index 0000000..7b79e50 Binary files /dev/null and b/assets/preview-national.png differ diff --git a/assets/preview-northeast.png b/assets/preview-northeast.png new file mode 100644 index 0000000..65fec46 Binary files /dev/null and b/assets/preview-northeast.png differ diff --git a/assets/usa-source.svg b/assets/usa-source.svg new file mode 100644 index 0000000..9ddb2ff --- /dev/null +++ b/assets/usa-source.svg @@ -0,0 +1,521 @@ + + + + + + + TX + NY + AZ + CA + NV + UT + CO + NM + AK + HI + OK + KS + NE + SD + WY + ID + OR + WA + MT + ND + MN + WI + IA + IL + MO + AR + LA + MS + AL + GA + FL + SC + NC + TN + KY + IN + MI + OH + WV + VA + PA + ME + VT + NH + MA + RI + CT + NJ + DE + MD + + + diff --git a/data/SOURCES.md b/data/SOURCES.md new file mode 100644 index 0000000..54b8c6b --- /dev/null +++ b/data/SOURCES.md @@ -0,0 +1,27 @@ +# State/capital verification + +`states.tsv` is the canonical 50-row alphabetical dataset. Postal code, full +state name, and capital travel together into `src/states.c`. Geography span +index N is always TSV row N; no second alphabetical ordering is introduced. +Alaska = Juneau; Hawaii = Honolulu. DC and territories are excluded. + +Checked 2026-11-09 against both full lists: + +- +- + +Minnesota is displayed as **Saint Paul**. Normalization also accepts **St. Paul** +and **St Paul**, in any case and with repeated or surrounding whitespace. + +`map-seeds.json` documents source SVG interior coordinates, replacing outside +callout-label positions for small Northeast states. The conversion asserts +that each seed is land and is in a distinct connected state region. Detached +land is assigned to its nearest identified region, with explicit geographic rules for the +Alaska/Hawaii inset islands and Michigan's Upper Peninsula. Geometry is a simplified educational +map, not a survey or political boundary authority. + +`map-manifest.json` records source region sizes, per-view dimensions, source +crop bounds and per-state pixel coverage. `tests/check_assets.py` checks all +50 identity slots, disjoint span coverage, bounds, and small-state/inset +presence. `tools/prepare_assets.py` reproduces all generated C and previews +using only Python's standard library; no SVG is parsed by the CoCo program. diff --git a/data/map-manifest.json b/data/map-manifest.json new file mode 100644 index 0000000..91e7d70 --- /dev/null +++ b/data/map-manifest.json @@ -0,0 +1,249 @@ +{ + "national": { + "size": [ + 200, + 110 + ], + "source_box": [ + 0, + 0, + 2000, + 1200 + ], + "pixels": { + "AL": 155, + "AK": 266, + "AZ": 374, + "AR": 160, + "CA": 516, + "CO": 327, + "CT": 18, + "DE": 7, + "FL": 204, + "GA": 180, + "HI": 20, + "ID": 251, + "IL": 173, + "IN": 105, + "IA": 172, + "KS": 256, + "KY": 109, + "LA": 150, + "ME": 111, + "MD": 22, + "MA": 21, + "MI": 177, + "MN": 265, + "MS": 143, + "MO": 205, + "MT": 473, + "NE": 236, + "NV": 350, + "NH": 19, + "NJ": 23, + "NM": 395, + "NY": 134, + "NC": 156, + "ND": 219, + "OH": 124, + "OK": 204, + "OR": 303, + "PA": 138, + "RI": 3, + "SC": 94, + "SD": 243, + "TN": 121, + "TX": 913, + "UT": 263, + "VT": 22, + "VA": 113, + "WA": 210, + "WV": 67, + "WI": 183, + "WY": 308 + }, + "bytes": 2676 + }, + "northeast": { + "size": [ + 100, + 100 + ], + "source_box": [ + 1540, + 120, + 1980, + 600 + ], + "pixels": { + "AL": 0, + "AK": 0, + "AZ": 0, + "AR": 0, + "CA": 0, + "CO": 0, + "CT": 92, + "DE": 28, + "FL": 0, + "GA": 0, + "HI": 0, + "ID": 0, + "IL": 0, + "IN": 0, + "IA": 0, + "KS": 0, + "KY": 3, + "LA": 0, + "ME": 551, + "MD": 148, + "MA": 128, + "MI": 0, + "MN": 0, + "MS": 0, + "MO": 0, + "MT": 0, + "NE": 0, + "NV": 0, + "NH": 137, + "NJ": 134, + "NM": 0, + "NY": 813, + "NC": 0, + "ND": 0, + "OH": 221, + "OK": 0, + "OR": 0, + "PA": 774, + "RI": 14, + "SC": 0, + "SD": 0, + "TN": 0, + "TX": 0, + "UT": 0, + "VT": 149, + "VA": 395, + "WA": 0, + "WV": 383, + "WI": 0, + "WY": 0 + }, + "bytes": 1128 + }, + "hawaii": { + "size": [ + 100, + 82 + ], + "source_box": [ + 565, + 995, + 785, + 1185 + ], + "pixels": { + "AL": 0, + "AK": 0, + "AZ": 0, + "AR": 0, + "CA": 0, + "CO": 0, + "CT": 0, + "DE": 0, + "FL": 0, + "GA": 0, + "HI": 474, + "ID": 0, + "IL": 0, + "IN": 0, + "IA": 0, + "KS": 0, + "KY": 0, + "LA": 0, + "ME": 0, + "MD": 0, + "MA": 0, + "MI": 0, + "MN": 0, + "MS": 0, + "MO": 0, + "MT": 0, + "NE": 0, + "NV": 0, + "NH": 0, + "NJ": 0, + "NM": 0, + "NY": 0, + "NC": 0, + "ND": 0, + "OH": 0, + "OK": 0, + "OR": 0, + "PA": 0, + "RI": 0, + "SC": 0, + "SD": 0, + "TN": 0, + "TX": 0, + "UT": 0, + "VT": 0, + "VA": 0, + "WA": 0, + "WV": 0, + "WI": 0, + "WY": 0 + }, + "bytes": 276 + }, + "source_component_pixels": { + "TX": 99510, + "NY": 17088, + "AZ": 42572, + "CA": 58649, + "NV": 41220, + "UT": 31555, + "CO": 38944, + "NM": 45545, + "AK": 23435, + "HI": 1239, + "OK": 25671, + "KS": 30684, + "NE": 28657, + "SD": 28575, + "WY": 36519, + "ID": 30691, + "OR": 36095, + "WA": 24459, + "MT": 55176, + "ND": 26235, + "MN": 31079, + "WI": 20411, + "IA": 20753, + "IL": 20647, + "MO": 25757, + "AR": 19475, + "LA": 16798, + "MS": 17411, + "AL": 18924, + "GA": 21645, + "FL": 20584, + "SC": 11222, + "NC": 17586, + "TN": 15180, + "KY": 14470, + "IN": 13097, + "MI": 14854, + "OH": 14990, + "WV": 8390, + "VA": 13925, + "PA": 16573, + "ME": 11502, + "VT": 3240, + "NH": 3064, + "MA": 2498, + "RI": 227, + "CT": 1599, + "NJ": 2543, + "DE": 517, + "MD": 2607 + } +} diff --git a/data/map-seeds.json b/data/map-seeds.json new file mode 100644 index 0000000..51b0341 --- /dev/null +++ b/data/map-seeds.json @@ -0,0 +1,202 @@ +{ + "TX": [ + 983, + 910 + ], + "NY": [ + 1732, + 330 + ], + "AZ": [ + 532, + 728 + ], + "CA": [ + 280, + 568 + ], + "NV": [ + 402, + 480 + ], + "UT": [ + 572, + 524 + ], + "CO": [ + 760, + 558 + ], + "NM": [ + 726, + 744 + ], + "AK": [ + 338, + 988 + ], + "HI": [ + 739, + 1130 + ], + "OK": [ + 1042, + 728 + ], + "KS": [ + 1004, + 594 + ], + "NE": [ + 970, + 462 + ], + "SD": [ + 950, + 334 + ], + "WY": [ + 714, + 374 + ], + "ID": [ + 524, + 314 + ], + "OR": [ + 330, + 264 + ], + "WA": [ + 370, + 126 + ], + "MT": [ + 684, + 198 + ], + "ND": [ + 952, + 206 + ], + "MN": [ + 1126, + 260 + ], + "WI": [ + 1278, + 326 + ], + "IA": [ + 1170, + 440 + ], + "IL": [ + 1312, + 516 + ], + "MO": [ + 1196, + 598 + ], + "AR": [ + 1206, + 754 + ], + "LA": [ + 1214, + 912 + ], + "MS": [ + 1310, + 834 + ], + "AL": [ + 1418, + 824 + ], + "GA": [ + 1534, + 816 + ], + "FL": [ + 1636, + 1008 + ], + "SC": [ + 1626, + 756 + ], + "NC": [ + 1678, + 672 + ], + "TN": [ + 1420, + 696 + ], + "KY": [ + 1462, + 612 + ], + "IN": [ + 1410, + 512 + ], + "MI": [ + 1432, + 364 + ], + "OH": [ + 1512, + 488 + ], + "WV": [ + 1584, + 556 + ], + "VA": [ + 1670, + 582 + ], + "PA": [ + 1676, + 434 + ], + "ME": [ + 1886, + 186 + ], + "VT": [ + 1800, + 280 + ], + "NH": [ + 1840, + 280 + ], + "MA": [ + 1830, + 340 + ], + "RI": [ + 1860, + 360 + ], + "CT": [ + 1830, + 375 + ], + "NJ": [ + 1780, + 440 + ], + "DE": [ + 1764, + 509 + ], + "MD": [ + 1720, + 536 + ] +} diff --git a/data/states.tsv b/data/states.tsv new file mode 100644 index 0000000..8cbb710 --- /dev/null +++ b/data/states.tsv @@ -0,0 +1,50 @@ +AL Alabama Montgomery +AK Alaska Juneau +AZ Arizona Phoenix +AR Arkansas Little Rock +CA California Sacramento +CO Colorado Denver +CT Connecticut Hartford +DE Delaware Dover +FL Florida Tallahassee +GA Georgia Atlanta +HI Hawaii Honolulu +ID Idaho Boise +IL Illinois Springfield +IN Indiana Indianapolis +IA Iowa Des Moines +KS Kansas Topeka +KY Kentucky Frankfort +LA Louisiana Baton Rouge +ME Maine Augusta +MD Maryland Annapolis +MA Massachusetts Boston +MI Michigan Lansing +MN Minnesota Saint Paul +MS Mississippi Jackson +MO Missouri Jefferson City +MT Montana Helena +NE Nebraska Lincoln +NV Nevada Carson City +NH New Hampshire Concord +NJ New Jersey Trenton +NM New Mexico Santa Fe +NY New York Albany +NC North Carolina Raleigh +ND North Dakota Bismarck +OH Ohio Columbus +OK Oklahoma Oklahoma City +OR Oregon Salem +PA Pennsylvania Harrisburg +RI Rhode Island Providence +SC South Carolina Columbia +SD South Dakota Pierre +TN Tennessee Nashville +TX Texas Austin +UT Utah Salt Lake City +VT Vermont Montpelier +VA Virginia Richmond +WA Washington Olympia +WV West Virginia Charleston +WI Wisconsin Madison +WY Wyoming Cheyenne diff --git a/docs/MCP-NOTES.md b/docs/MCP-NOTES.md new file mode 100644 index 0000000..af150e3 --- /dev/null +++ b/docs/MCP-NOTES.md @@ -0,0 +1,43 @@ +# Public VCC Plus MCP workflow + +The project was connected using C Development → Assistant → Use Project +Makefile + Allow Disposable Playtests → Save Private Connection. Grants stayed +outside the checkout. `tools/vcc_mcp.py` is a normal STDIO JSON-RPC client for +`/Applications/VCC Plus.app/Contents/Helpers/vcc-mcp --grant FILE`; it does not +use a private bridge or debugger memory/register writes. + +Live tools were discovered with `tools/list`, followed by `get_capabilities`. +Builds used advertised `disk` actions and `Test`/`Release` configurations. +`start_playtest` booted exact artifact disks on isolated 512 KB MC6809 workers. +Every simulated press used `playtest_input` physical-key plans with separate +release fields. `capture_playtest` supplied the actual 640×480 framebuffer. +PNG pixels were decoded at the game's 320×192 coordinates. Text was matched +against the font bytes in the corresponding linked build, so checks observed +what the guest drew, rather than trusting host quiz variables. Selected-state +pixels were also checked against each state's drawing mask. + +VCC Plus protects the approved recipe and source revision. After changing +recipe/support inputs, export a fresh connection. Put captures and test logs +outside the watched project until a run finishes: adding files can advance +the project revision and end its test run. Every intended input needs a fresh +request ID; only identical retries reuse one. + +## Limitations and reusable improvements + +The public playtest key enum omits **period** and other punctuation. `St Paul` +and mixed-case answers were played in the guest; `St. Paul` was verified by +the shared C logic tests. A reusable improvement is to expose the remaining +physical CoCo punctuation keys (or a documented ASCII-to-key-chord input tool) +with the same field bounds and idempotency receipts. + +The approved custom-Make build receipt did not advertise verified C/function +stop lists. A general pause followed by `get_debug_snapshot` returned +`verified_pause_required`. No memory was guessed or modified to work around +that refusal. Gameplay checks used framebuffer captures and ordinary inputs. +A reusable improvement is to expose the native workbench's verified C mapping +and shared globals in custom-Make artifact receipts, or document a public +manifest schema for ordinary, non-banked binaries. + +These limits do not prevent building or playing the complete quiz. They limit +the automated punctuation and source-debug inspection coverage described in +TESTING.md. The user's original machine, disks and tape were preserved. diff --git a/docs/TESTING.md b/docs/TESTING.md new file mode 100644 index 0000000..ea984e5 --- /dev/null +++ b/docs/TESTING.md @@ -0,0 +1,80 @@ +# Test results — 2026-11-09 + +Built and played with installed **VCC Plus 3.5.0, build 41**, bundled **CMOC 0.1.100**, +and the exported **public STDIO MCP interface**. All gameplay ran in disposable +**512 KB MC6809** workers. Inputs used ordinary physical guest key chords, with +release fields between presses. No guest memory or registers were modified by +a debugger. Personal emulator media and the original running machine were preserved. + +## Final source validation + +| Check | Result | +| --- | --- | +| Release, Debug, Test disk builds | All succeeded; no diagnostics | +| Complete multiple-choice quiz | 50 unique states, numbering 1–50, 42/50 (84%) | +| Complete typed quiz | 50 unique states, 47/50 (94%), 2 spelling corrections | +| Complete ordinary Release quiz | 50 unique states, 50/50 (100%), perfect review | +| Four distinct choices and varied correct slots | All 50 captured questions checked | +| Full state name and current-state fill | All 50 national framebuffer masks checked | +| Alaska / Hawaii / Northeast | Actual captures inspected; Hawaii island grouping corrected | +| Typed casing | Uppercase, lowercase and mixed case actually entered | +| Spaces and aliases | Multiword names, surrounding/repeated spaces, mixed-case St Paul | +| Spelling retry | Charleston and Denver transpositions: no early point/reveal; Backspace edits then correct | +| Reveal | Near Tallahassee spelling → V reveals and records a miss | +| Known wrong capital | Austin for Connecticut → incorrect, not spelling retry | +| Long input | 45 attempted X characters: bounded at 39; Enter and subsequent questions work | +| Missed review | Eight MC misses over 3 pages, three typed misses over 1 page; state, entered answer and capital checked | +| Held key | First answer held 600 fields through feedback; no accidental advance | +| Replay | P returns to mode menu; Release starts a different first-five-state order | +| Credits | Source URL, license URL and adaptation notice read from actual framebuffer | +| Exit | Title and results Quit return to BASIC with final thank-you text | + +Host checks additionally passed **2,000 shuffles**, **100,000 choice sets**, all +50 exact capitals in varied casing, all **2,450** wrong-capital pairs, all +Saint Paul aliases (including **St. Paul**), edit-distance/transposition cases, +long-string bounds, one-point-per-state guarding, correction accounting and reset. +Geometry checks cover 50 unique stable IDs, disjoint bounded spans and all +national masks, plus Northeast and Hawaii detail coverage. The Hawaii detail +contains only Hawaiian state pixels. The geography converter uses explicit +inset rules for detached Hawaiian/Alaskan islands and Michigan’s Upper Peninsula. + +## Reproduce and inspect + +Run `make test` for host checks. For two full deterministic guest quizzes: +```sh +PYTHONDONTWRITEBYTECODE=1 python3 tests/playtest.py /private/path/grant.json \ + --evidence /tmp/capital-quiz-evidence +``` + +The grant must enable Use Project Makefile and Allow Disposable Playtests. +The Test configuration uses seed 2709; Release uses timing/start-input entropy. +Captured PNG pixels are decoded against the font in the matching linked artifact. +Text, scores, options and selected-state fill are checked from real frames. +Full PNG captures and public receipts are in ignored `build/evidence/test/` and +`build/evidence/release/`. Compact receipts are retained in `docs/evidence/`. +The typed report’s answer field records the initial test input when a spelling +correction was subsequently made; the captured feedback and score verify the correction. + +## Release artifact + +- Build: `9922B526-537B-4820-BF6C-100EB8846077` +- Artifact: `B6BCF288-91C9-43D8-A460-595792BFD457` +- Release gameplay run: `4EC7FB7D-CBF8-4235-AE82-4363E57376CE` +- Binary: `e69f25c3cf8375f8fe20829d6c11a0a8cb57ceafbf10b5ccefe18c3a1773527a` (SHA-256) +- Disk: `98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68` (SHA-256) +- Executable: `build/CAPITAL.bin`; disk: `build/CAPITAL.dsk` (35 tracks, 161,280 bytes). +- Release code/static storage ends at `$7530`, below the `$7800` limit, leaving + 720 bytes before the separate 2 KiB stack allowance to `$8000`. +- Map runs and offset tables total **4,080 bytes**; the public GIME helper + reserves 64 KiB of separate physical RAM for two display pages. +- Captures report **zero guest disk writes**. Test disk originals were preserved. + +## Limits + +No physical CoCo hardware test was performed. VCC’s public key enumeration +omits punctuation, so the dotted **St. Paul** alias was verified in the actual +shared C logic rather than typed through MCP. The custom-Make build receipt +did not advertise verified C/function stop lists, and a general pause followed +by snapshot inspection returned `verified_pause_required`; no source-debug +watch or memory inspection is claimed. These limits and reusable MCP +enhancement proposals are described in [MCP-NOTES.md](MCP-NOTES.md). diff --git a/docs/evidence/build-receipt.json b/docs/evidence/build-receipt.json new file mode 100644 index 0000000..9e7c687 --- /dev/null +++ b/docs/evidence/build-receipt.json @@ -0,0 +1,24 @@ +{ + "outputs": [ + { + "path": "build/CAPITAL.bin", + "bytes": 19046, + "sha256": "fcd4a9226276e04e6a82cefc3f98fb15ba5a5c250b67932dd50005cef3ec7df1" + }, + { + "path": "build/CAPITAL.dsk", + "bytes": 161280, + "sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924" + } + ], + "status": "succeeded", + "build_id": "2B5749C4-68F8-46B2-B9A3-23BB09A963CF", + "revision": 0, + "artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "action": "disk", + "configuration": "Test", + "recipe_id": "a5a78327c6844ae71842b05ea69b7bafd2c113136370619877a4b2a4f2b94570", + "log": "\"cmoc\" -DTEST_SEED=2709 -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/states.o src/states.c\n\"cmoc\" -DTEST_SEED=2709 -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/ui.o src/ui.c\n\"cmoc\" -DTEST_SEED=2709 -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/quiz.o src/quiz.c\n\"cmoc\" -DTEST_SEED=2709 -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/ -c -o obj/main.o main.c\n\"cmoc\" --dos -O0 --limit=2800 -o obj/boot.bin tools/boot.c\n\"cmoc\" -DTEST_SEED=2709 -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/map_data.o src/map_data.c\n\"cmoc\" --coco --intermediate --org=2000 --limit=7800 -o build/CAPITAL.bin obj/main.o obj/src/quiz.o obj/src/ui.o obj/src/states.o obj/src/map_data.o -lgime -linput -lbcontrol -lhirestxt\nperl -e 'print chr(255) x (35*18*256)' > build/CAPITAL.dsk\n\"install-coco-boot-loader\" build/CAPITAL.dsk obj/boot.bin\n\"writecocofile\" build/CAPITAL.dsk build/CAPITAL.bin\n", + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "diagnostics": [] +} \ No newline at end of file diff --git a/docs/evidence/debug-build.json b/docs/evidence/debug-build.json new file mode 100644 index 0000000..f9615d1 --- /dev/null +++ b/docs/evidence/debug-build.json @@ -0,0 +1,24 @@ +{ + "outputs": [ + { + "path": "build/CAPITAL.bin", + "sha256": "49f604ae56458b3d32cc6557f4c54ffd146de3b50c29bd1e5c65ce9e2c6f229e", + "bytes": 19089 + }, + { + "sha256": "603b4726e8aa17f8ecaf4628b8d30dcfda5c037dd75203126727e81faa12f5a0", + "path": "build/CAPITAL.dsk", + "bytes": 161280 + } + ], + "status": "succeeded", + "action": "disk", + "revision": 0, + "artifact_id": "144A785F-4DE1-4D6C-8354-C7DD49AA77D5", + "build_id": "09FB9FC6-E0D2-4174-A575-0FCCF050AF54", + "configuration": "Debug", + "recipe_id": "a5a78327c6844ae71842b05ea69b7bafd2c113136370619877a4b2a4f2b94570", + "log": "\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 -fno-omit-frame-pointer --intdir=obj/src/ -c -o obj/src/states.o src/states.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 -fno-omit-frame-pointer --intdir=obj/src/ -c -o obj/src/ui.o src/ui.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 -fno-omit-frame-pointer --intdir=obj/src/ -c -o obj/src/quiz.o src/quiz.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 -fno-omit-frame-pointer --intdir=obj/ -c -o obj/main.o main.c\n\"cmoc\" --dos -O0 --limit=2800 -o obj/boot.bin tools/boot.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 -fno-omit-frame-pointer --intdir=obj/src/ -c -o obj/src/map_data.o src/map_data.c\n\"cmoc\" --coco --intermediate --org=2000 --limit=7800 -o build/CAPITAL.bin obj/main.o obj/src/quiz.o obj/src/ui.o obj/src/states.o obj/src/map_data.o -lgime -linput -lbcontrol -lhirestxt\nperl -e 'print chr(255) x (35*18*256)' > build/CAPITAL.dsk\n\"install-coco-boot-loader\" build/CAPITAL.dsk obj/boot.bin\n\"writecocofile\" build/CAPITAL.dsk build/CAPITAL.bin\n", + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "diagnostics": [] +} \ No newline at end of file diff --git a/docs/evidence/mc-report.json b/docs/evidence/mc-report.json new file mode 100644 index 0000000..5135b33 --- /dev/null +++ b/docs/evidence/mc-report.json @@ -0,0 +1,901 @@ +{ + "score": 42, + "positions": [ + 15, + 15, + 13, + 7 + ], + "questions": [ + { + "question": 1, + "code": "MN", + "state": "Minnesota", + "options": [ + "Saint Paul", + "Des Moines", + "Concord", + "Olympia" + ], + "answer": "Des Moines", + "correct": false, + "score": 0, + "gold_pixels": 265, + "expected_state_pixels": 265, + "field": 2168 + }, + { + "question": 2, + "code": "WV", + "state": "West Virginia", + "options": [ + "Boise", + "Indianapolis", + "Charleston", + "Topeka" + ], + "answer": "Charleston", + "correct": true, + "score": 1, + "gold_pixels": 67, + "expected_state_pixels": 67, + "field": 3726 + }, + { + "question": 3, + "code": "CT", + "state": "Connecticut", + "options": [ + "Boston", + "Olympia", + "Hartford", + "Pierre" + ], + "answer": "Hartford", + "correct": true, + "score": 2, + "gold_pixels": 18, + "expected_state_pixels": 18, + "field": 4692 + }, + { + "question": 4, + "code": "KY", + "state": "Kentucky", + "options": [ + "Frankfort", + "Bismarck", + "Indianapolis", + "Providence" + ], + "answer": "Frankfort", + "correct": true, + "score": 3, + "gold_pixels": 109, + "expected_state_pixels": 109, + "field": 5658 + }, + { + "question": 5, + "code": "FL", + "state": "Florida", + "options": [ + "Tallahassee", + "Charleston", + "Cheyenne", + "Salt Lake City" + ], + "answer": "Tallahassee", + "correct": true, + "score": 4, + "gold_pixels": 204, + "expected_state_pixels": 204, + "field": 6624 + }, + { + "question": 6, + "code": "LA", + "state": "Louisiana", + "options": [ + "Juneau", + "Pierre", + "Baton Rouge", + "Oklahoma City" + ], + "answer": "Baton Rouge", + "correct": true, + "score": 5, + "gold_pixels": 150, + "expected_state_pixels": 150, + "field": 7590 + }, + { + "question": 7, + "code": "WY", + "state": "Wyoming", + "options": [ + "Denver", + "Providence", + "Sacramento", + "Cheyenne" + ], + "answer": "Cheyenne", + "correct": true, + "score": 6, + "gold_pixels": 308, + "expected_state_pixels": 308, + "field": 8556 + }, + { + "question": 8, + "code": "OK", + "state": "Oklahoma", + "options": [ + "Des Moines", + "Oklahoma City", + "Richmond", + "Carson City" + ], + "answer": "Richmond", + "correct": false, + "score": 6, + "gold_pixels": 204, + "expected_state_pixels": 204, + "field": 9522 + }, + { + "question": 9, + "code": "MT", + "state": "Montana", + "options": [ + "Montpelier", + "Helena", + "Little Rock", + "Indianapolis" + ], + "answer": "Helena", + "correct": true, + "score": 7, + "gold_pixels": 473, + "expected_state_pixels": 473, + "field": 10488 + }, + { + "question": 10, + "code": "TX", + "state": "Texas", + "options": [ + "Austin", + "Carson City", + "Montgomery", + "Salem" + ], + "answer": "Austin", + "correct": true, + "score": 8, + "gold_pixels": 913, + "expected_state_pixels": 913, + "field": 11454 + }, + { + "question": 11, + "code": "GA", + "state": "Georgia", + "options": [ + "Madison", + "Lincoln", + "Pierre", + "Atlanta" + ], + "answer": "Atlanta", + "correct": true, + "score": 9, + "gold_pixels": 180, + "expected_state_pixels": 180, + "field": 12420 + }, + { + "question": 12, + "code": "SC", + "state": "South Carolina", + "options": [ + "Springfield", + "Columbia", + "Pierre", + "Atlanta" + ], + "answer": "Columbia", + "correct": true, + "score": 10, + "gold_pixels": 94, + "expected_state_pixels": 94, + "field": 13386 + }, + { + "question": 13, + "code": "NH", + "state": "New Hampshire", + "options": [ + "Concord", + "Austin", + "Richmond", + "Jefferson City" + ], + "answer": "Concord", + "correct": true, + "score": 11, + "gold_pixels": 19, + "expected_state_pixels": 19, + "field": 14352 + }, + { + "question": 14, + "code": "UT", + "state": "Utah", + "options": [ + "Annapolis", + "Salt Lake City", + "Topeka", + "Des Moines" + ], + "answer": "Salt Lake City", + "correct": true, + "score": 12, + "gold_pixels": 263, + "expected_state_pixels": 263, + "field": 15318 + }, + { + "question": 15, + "code": "VA", + "state": "Virginia", + "options": [ + "Bismarck", + "Lansing", + "Richmond", + "Madison" + ], + "answer": "Madison", + "correct": false, + "score": 12, + "gold_pixels": 113, + "expected_state_pixels": 113, + "field": 16284 + }, + { + "question": 16, + "code": "NY", + "state": "New York", + "options": [ + "Salt Lake City", + "Cheyenne", + "Albany", + "Oklahoma City" + ], + "answer": "Albany", + "correct": true, + "score": 13, + "gold_pixels": 134, + "expected_state_pixels": 134, + "field": 17250 + }, + { + "question": 17, + "code": "IL", + "state": "Illinois", + "options": [ + "Bismarck", + "Richmond", + "Springfield", + "Tallahassee" + ], + "answer": "Springfield", + "correct": true, + "score": 14, + "gold_pixels": 173, + "expected_state_pixels": 173, + "field": 18216 + }, + { + "question": 18, + "code": "NV", + "state": "Nevada", + "options": [ + "Carson City", + "Albany", + "Topeka", + "Cheyenne" + ], + "answer": "Carson City", + "correct": true, + "score": 15, + "gold_pixels": 350, + "expected_state_pixels": 350, + "field": 19182 + }, + { + "question": 19, + "code": "RI", + "state": "Rhode Island", + "options": [ + "Honolulu", + "Columbia", + "Topeka", + "Providence" + ], + "answer": "Providence", + "correct": true, + "score": 16, + "gold_pixels": 3, + "expected_state_pixels": 3, + "field": 20148 + }, + { + "question": 20, + "code": "IN", + "state": "Indiana", + "options": [ + "Indianapolis", + "Denver", + "Jefferson City", + "Columbus" + ], + "answer": "Indianapolis", + "correct": true, + "score": 17, + "gold_pixels": 105, + "expected_state_pixels": 105, + "field": 21114 + }, + { + "question": 21, + "code": "MA", + "state": "Massachusetts", + "options": [ + "Indianapolis", + "Albany", + "Boston", + "Montgomery" + ], + "answer": "Boston", + "correct": true, + "score": 18, + "gold_pixels": 21, + "expected_state_pixels": 21, + "field": 22080 + }, + { + "question": 22, + "code": "HI", + "state": "Hawaii", + "options": [ + "Saint Paul", + "Honolulu", + "Bismarck", + "Salt Lake City" + ], + "answer": "Bismarck", + "correct": false, + "score": 18, + "gold_pixels": 20, + "expected_state_pixels": 20, + "field": 23046 + }, + { + "question": 23, + "code": "ME", + "state": "Maine", + "options": [ + "Little Rock", + "Hartford", + "Augusta", + "Helena" + ], + "answer": "Augusta", + "correct": true, + "score": 19, + "gold_pixels": 111, + "expected_state_pixels": 111, + "field": 24012 + }, + { + "question": 24, + "code": "VT", + "state": "Vermont", + "options": [ + "Montpelier", + "Carson City", + "Pierre", + "Richmond" + ], + "answer": "Montpelier", + "correct": true, + "score": 20, + "gold_pixels": 22, + "expected_state_pixels": 22, + "field": 24978 + }, + { + "question": 25, + "code": "CO", + "state": "Colorado", + "options": [ + "Richmond", + "Augusta", + "Pierre", + "Denver" + ], + "answer": "Denver", + "correct": true, + "score": 21, + "gold_pixels": 327, + "expected_state_pixels": 327, + "field": 25944 + }, + { + "question": 26, + "code": "AL", + "state": "Alabama", + "options": [ + "Bismarck", + "Montgomery", + "Salem", + "Austin" + ], + "answer": "Montgomery", + "correct": true, + "score": 22, + "gold_pixels": 155, + "expected_state_pixels": 155, + "field": 26910 + }, + { + "question": 27, + "code": "WI", + "state": "Wisconsin", + "options": [ + "Montgomery", + "Madison", + "Lincoln", + "Saint Paul" + ], + "answer": "Madison", + "correct": true, + "score": 23, + "gold_pixels": 183, + "expected_state_pixels": 183, + "field": 27876 + }, + { + "question": 28, + "code": "AK", + "state": "Alaska", + "options": [ + "Juneau", + "Oklahoma City", + "Jackson", + "Saint Paul" + ], + "answer": "Juneau", + "correct": true, + "score": 24, + "gold_pixels": 266, + "expected_state_pixels": 266, + "field": 28842 + }, + { + "question": 29, + "code": "OH", + "state": "Ohio", + "options": [ + "Sacramento", + "Jefferson City", + "Columbus", + "Santa Fe" + ], + "answer": "Santa Fe", + "correct": false, + "score": 24, + "gold_pixels": 124, + "expected_state_pixels": 124, + "field": 29808 + }, + { + "question": 30, + "code": "MD", + "state": "Maryland", + "options": [ + "Raleigh", + "Atlanta", + "Helena", + "Annapolis" + ], + "answer": "Annapolis", + "correct": true, + "score": 25, + "gold_pixels": 22, + "expected_state_pixels": 22, + "field": 30774 + }, + { + "question": 31, + "code": "MO", + "state": "Missouri", + "options": [ + "Columbus", + "Jefferson City", + "Raleigh", + "Frankfort" + ], + "answer": "Jefferson City", + "correct": true, + "score": 26, + "gold_pixels": 205, + "expected_state_pixels": 205, + "field": 31740 + }, + { + "question": 32, + "code": "PA", + "state": "Pennsylvania", + "options": [ + "Harrisburg", + "Columbia", + "Tallahassee", + "Cheyenne" + ], + "answer": "Harrisburg", + "correct": true, + "score": 27, + "gold_pixels": 138, + "expected_state_pixels": 138, + "field": 32706 + }, + { + "question": 33, + "code": "MS", + "state": "Mississippi", + "options": [ + "Annapolis", + "Jackson", + "Atlanta", + "Denver" + ], + "answer": "Jackson", + "correct": true, + "score": 28, + "gold_pixels": 143, + "expected_state_pixels": 143, + "field": 33672 + }, + { + "question": 34, + "code": "TN", + "state": "Tennessee", + "options": [ + "Nashville", + "Raleigh", + "Oklahoma City", + "Hartford" + ], + "answer": "Nashville", + "correct": true, + "score": 29, + "gold_pixels": 121, + "expected_state_pixels": 121, + "field": 34638 + }, + { + "question": 35, + "code": "KS", + "state": "Kansas", + "options": [ + "Montgomery", + "Providence", + "Topeka", + "Baton Rouge" + ], + "answer": "Topeka", + "correct": true, + "score": 30, + "gold_pixels": 256, + "expected_state_pixels": 256, + "field": 35604 + }, + { + "question": 36, + "code": "NE", + "state": "Nebraska", + "options": [ + "Montpelier", + "Cheyenne", + "Lincoln", + "Harrisburg" + ], + "answer": "Harrisburg", + "correct": false, + "score": 30, + "gold_pixels": 236, + "expected_state_pixels": 236, + "field": 36570 + }, + { + "question": 37, + "code": "WA", + "state": "Washington", + "options": [ + "Olympia", + "Helena", + "Charleston", + "Hartford" + ], + "answer": "Olympia", + "correct": true, + "score": 31, + "gold_pixels": 210, + "expected_state_pixels": 210, + "field": 37536 + }, + { + "question": 38, + "code": "NC", + "state": "North Carolina", + "options": [ + "Olympia", + "Montpelier", + "Helena", + "Raleigh" + ], + "answer": "Raleigh", + "correct": true, + "score": 32, + "gold_pixels": 156, + "expected_state_pixels": 156, + "field": 38502 + }, + { + "question": 39, + "code": "SD", + "state": "South Dakota", + "options": [ + "Pierre", + "Columbia", + "Concord", + "Annapolis" + ], + "answer": "Pierre", + "correct": true, + "score": 33, + "gold_pixels": 243, + "expected_state_pixels": 243, + "field": 39468 + }, + { + "question": 40, + "code": "OR", + "state": "Oregon", + "options": [ + "Salt Lake City", + "Salem", + "Juneau", + "Phoenix" + ], + "answer": "Salem", + "correct": true, + "score": 34, + "gold_pixels": 303, + "expected_state_pixels": 303, + "field": 40434 + }, + { + "question": 41, + "code": "DE", + "state": "Delaware", + "options": [ + "Augusta", + "Annapolis", + "Dover", + "Honolulu" + ], + "answer": "Dover", + "correct": true, + "score": 35, + "gold_pixels": 7, + "expected_state_pixels": 7, + "field": 41400 + }, + { + "question": 42, + "code": "NM", + "state": "New Mexico", + "options": [ + "Albany", + "Indianapolis", + "Santa Fe", + "Olympia" + ], + "answer": "Santa Fe", + "correct": true, + "score": 36, + "gold_pixels": 395, + "expected_state_pixels": 395, + "field": 42366 + }, + { + "question": 43, + "code": "NJ", + "state": "New Jersey", + "options": [ + "Phoenix", + "Trenton", + "Little Rock", + "Jackson" + ], + "answer": "Little Rock", + "correct": false, + "score": 36, + "gold_pixels": 23, + "expected_state_pixels": 23, + "field": 43332 + }, + { + "question": 44, + "code": "ID", + "state": "Idaho", + "options": [ + "Madison", + "Boise", + "Baton Rouge", + "Columbia" + ], + "answer": "Boise", + "correct": true, + "score": 37, + "gold_pixels": 251, + "expected_state_pixels": 251, + "field": 44298 + }, + { + "question": 45, + "code": "IA", + "state": "Iowa", + "options": [ + "Annapolis", + "Harrisburg", + "Hartford", + "Des Moines" + ], + "answer": "Des Moines", + "correct": true, + "score": 38, + "gold_pixels": 172, + "expected_state_pixels": 172, + "field": 45264 + }, + { + "question": 46, + "code": "ND", + "state": "North Dakota", + "options": [ + "Montgomery", + "Bismarck", + "Richmond", + "Charleston" + ], + "answer": "Bismarck", + "correct": true, + "score": 39, + "gold_pixels": 219, + "expected_state_pixels": 219, + "field": 46230 + }, + { + "question": 47, + "code": "MI", + "state": "Michigan", + "options": [ + "Lansing", + "Atlanta", + "Nashville", + "Pierre" + ], + "answer": "Lansing", + "correct": true, + "score": 40, + "gold_pixels": 177, + "expected_state_pixels": 177, + "field": 47196 + }, + { + "question": 48, + "code": "AR", + "state": "Arkansas", + "options": [ + "Little Rock", + "Santa Fe", + "Atlanta", + "Dover" + ], + "answer": "Little Rock", + "correct": true, + "score": 41, + "gold_pixels": 160, + "expected_state_pixels": 160, + "field": 48162 + }, + { + "question": 49, + "code": "AZ", + "state": "Arizona", + "options": [ + "Salt Lake City", + "Phoenix", + "Harrisburg", + "Tallahassee" + ], + "answer": "Phoenix", + "correct": true, + "score": 42, + "gold_pixels": 374, + "expected_state_pixels": 374, + "field": 49128 + }, + { + "question": 50, + "code": "CA", + "state": "California", + "options": [ + "Albany", + "Sacramento", + "Harrisburg", + "Boise" + ], + "answer": "Harrisburg", + "correct": false, + "score": 42, + "gold_pixels": 516, + "expected_state_pixels": 516, + "field": 50094 + } + ], + "run_id": "6386E425-D645-4C5F-9380-9CACBB3FB5B0", + "artifact": "54851E31-863B-47CB-B152-807BB1327913", + "exit": { + "fields": 53808, + "disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "machine_frame": 53808, + "frame_number": 53808, + "image_content": true, + "cpu": "6809", + "cycles": 1597785753, + "generation": 2, + "revision": 0, + "remaining_field_budget": 162192, + "field_clock": 53808, + "isolated": true, + "state": "running", + "ram_kb": 512, + "screen_text": "DISK EXTENDED COLOR BASIC 2.1\nCOPR. 1982, 1986 BY TANDY\nUNDER LICENSE FROM MICROSOFT\nAND MICROWARE SYSTEMS CORP.\n\nOK\nDOS\nLOADM\"CAPITAL.BIN\":EXEC\nTHANKS FOR PLAYING CAPITAL QUEST\n!\nOK\n", + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "boot": 1, + "remaining_boots": 15, + "artifact_disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "height": 480, + "width": 640, + "run_id": "6386E425-D645-4C5F-9380-9CACBB3FB5B0", + "artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "pc": 42963, + "disk_reads": 24320, + "disk_dirty": false, + "disk_provenance": { + "origin_artifact_disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "artifact_disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "origin_artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "origin": "verified_artifact" + }, + "disk_origin": "verified_artifact", + "disk_writes": 0, + "disk_original_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924" + } +} \ No newline at end of file diff --git a/docs/evidence/release-build.json b/docs/evidence/release-build.json new file mode 100644 index 0000000..0977517 --- /dev/null +++ b/docs/evidence/release-build.json @@ -0,0 +1,24 @@ +{ + "action": "disk", + "status": "succeeded", + "build_id": "9922B526-537B-4820-BF6C-100EB8846077", + "recipe_id": "a5a78327c6844ae71842b05ea69b7bafd2c113136370619877a4b2a4f2b94570", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "outputs": [ + { + "sha256": "e69f25c3cf8375f8fe20829d6c11a0a8cb57ceafbf10b5ccefe18c3a1773527a", + "path": "build/CAPITAL.bin", + "bytes": 19041 + }, + { + "bytes": 161280, + "path": "build/CAPITAL.dsk", + "sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68" + } + ], + "configuration": "Release", + "revision": 0, + "log": "\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/states.o src/states.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/ui.o src/ui.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/quiz.o src/quiz.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/ -c -o obj/main.o main.c\n\"cmoc\" --dos -O0 --limit=2800 -o obj/boot.bin tools/boot.c\n\"cmoc\" -Iinclude --coco --intermediate --deps --stack-space=2048 -O2 --intdir=obj/src/ -c -o obj/src/map_data.o src/map_data.c\n\"cmoc\" --coco --intermediate --org=2000 --limit=7800 -o build/CAPITAL.bin obj/main.o obj/src/quiz.o obj/src/ui.o obj/src/states.o obj/src/map_data.o -lgime -linput -lbcontrol -lhirestxt\nperl -e 'print chr(255) x (35*18*256)' > build/CAPITAL.dsk\n\"install-coco-boot-loader\" build/CAPITAL.dsk obj/boot.bin\n\"writecocofile\" build/CAPITAL.dsk build/CAPITAL.bin\n", + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "diagnostics": [] +} \ No newline at end of file diff --git a/docs/evidence/release-report.json b/docs/evidence/release-report.json new file mode 100644 index 0000000..2bea2dc --- /dev/null +++ b/docs/evidence/release-report.json @@ -0,0 +1,211 @@ +{ + "configuration": "Release", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "run_id": "4EC7FB7D-CBF8-4235-AE82-4363E57376CE", + "order": [ + "IN", + "MT", + "AR", + "ID", + "NH", + "MA", + "NV", + "NM", + "MO", + "SD", + "VT", + "DE", + "MS", + "MN", + "RI", + "AL", + "MD", + "NE", + "CT", + "WI", + "NY", + "KY", + "WY", + "VA", + "OK", + "WA", + "AK", + "ND", + "TX", + "OH", + "CA", + "FL", + "OR", + "KS", + "GA", + "TN", + "IL", + "WV", + "LA", + "AZ", + "ME", + "MI", + "NC", + "NJ", + "SC", + "UT", + "CO", + "PA", + "IA", + "HI" + ], + "positions": [ + 15, + 14, + 12, + 9 + ], + "score": 50, + "percentage": 100, + "replay_first_five": [ + "MO", + "SD", + "NM", + "IA", + "IN" + ], + "credits_run": "74632153-2D82-4DBB-86A2-B0DD23E85769", + "exit": { + "disk_original_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "machine_frame": 3084, + "frame_number": 3084, + "image_content": true, + "cpu": "6809", + "cycles": 75479687, + "generation": 2, + "revision": 0, + "remaining_field_budget": 212916, + "field_clock": 3084, + "isolated": true, + "state": "running", + "ram_kb": 512, + "screen_text": "DISK EXTENDED COLOR BASIC 2.1\nCOPR. 1982, 1986 BY TANDY\nUNDER LICENSE FROM MICROSOFT\nAND MICROWARE SYSTEMS CORP.\n\nOK\nDOS\nLOADM\"CAPITAL.BIN\":EXEC\nTHANKS FOR PLAYING CAPITAL QUEST\n!\nOK\n", + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "boot": 1, + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "height": 480, + "width": 640, + "run_id": "74632153-2D82-4DBB-86A2-B0DD23E85769", + "remaining_boots": 15, + "pc": 42963, + "disk_dirty": false, + "disk_provenance": { + "origin_artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "origin_artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "origin": "verified_artifact" + }, + "disk_reads": 24320, + "fields": 3084, + "disk_origin": "verified_artifact", + "disk_writes": 0 + }, + "retained": { + "disk_original_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "machine_frame": 56464, + "status": "stopped", + "disk_retained": true, + "disk_origin": "verified_artifact", + "retained_disk": { + "run_id": "4EC7FB7D-CBF8-4235-AE82-4363E57376CE", + "origin_artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "origin": "verified_artifact", + "byte_count": 161280, + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "created_at": "2026-11-10T01:35:53Z", + "disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "origin_artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "retained_disk_id": "4EC7FB7D-CBF8-4235-AE82-4363E57376CE" + }, + "cpu": "6809", + "retained_disk_id": "4EC7FB7D-CBF8-4235-AE82-4363E57376CE", + "revision": 0, + "generation": 2, + "cycles": 1680371171, + "request_id": "84bf065a-0bf6-40f1-84ef-463c501e9934", + "remaining_field_budget": 159536, + "field_clock": 56464, + "isolated": true, + "state": "paused", + "ram_kb": 512, + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "boot": 1, + "remaining_boots": 15, + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "run_id": "4EC7FB7D-CBF8-4235-AE82-4363E57376CE", + "pc": 11460, + "disk_dirty": false, + "disk_reads": 24320, + "disk_provenance": { + "origin_artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "origin_artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "origin": "verified_artifact" + }, + "retained_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "fields": 56464, + "disk_writes": 0 + }, + "retained_credits": { + "disk_origin": "verified_artifact", + "disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "disk_retained": true, + "machine_frame": 3084, + "status": "stopped", + "disk_writes": 0, + "cpu": "6809", + "retained_disk": { + "origin": "verified_artifact", + "run_id": "74632153-2D82-4DBB-86A2-B0DD23E85769", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "created_at": "2026-11-10T01:35:55Z", + "byte_count": 161280, + "origin_artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "origin_artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "retained_disk_id": "74632153-2D82-4DBB-86A2-B0DD23E85769" + }, + "retained_disk_id": "74632153-2D82-4DBB-86A2-B0DD23E85769", + "cycles": 75479687, + "generation": 2, + "revision": 0, + "remaining_field_budget": 212916, + "request_id": "204f9fe3-eec4-4e72-84bc-3a41c173da01", + "field_clock": 3084, + "isolated": true, + "state": "paused", + "ram_kb": 512, + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "boot": 1, + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "remaining_boots": 15, + "run_id": "74632153-2D82-4DBB-86A2-B0DD23E85769", + "pc": 42963, + "disk_dirty": false, + "disk_provenance": { + "origin_artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "artifact_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "origin_artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "artifact_id": "B6BCF288-91C9-43D8-A460-595792BFD457", + "origin": "verified_artifact" + }, + "disk_reads": 24320, + "fields": 3084, + "disk_original_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68", + "retained_disk_sha256": "98c5e46b17f29b10e28b818a72512cd2e8331294da223600de99589ac4e3aa68" + } +} \ No newline at end of file diff --git a/docs/evidence/typed-report.json b/docs/evidence/typed-report.json new file mode 100644 index 0000000..c11f375 --- /dev/null +++ b/docs/evidence/typed-report.json @@ -0,0 +1,395 @@ +{ + "score": 47, + "corrections": 2, + "questions": [ + { + "question": 1, + "code": "MN", + "answer": "sT pAuL", + "correct": true, + "correction": false + }, + { + "question": 2, + "code": "WV", + "answer": "Chalreston", + "correct": true, + "correction": true + }, + { + "question": 3, + "code": "CT", + "answer": "Austin", + "correct": false, + "correction": false + }, + { + "question": 4, + "code": "KY", + "answer": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "correct": false, + "correction": false + }, + { + "question": 5, + "code": "FL", + "answer": "Tallhassee", + "correct": false, + "correction": false + }, + { + "question": 6, + "code": "LA", + "answer": " bAtOn rOuGe ", + "correct": true, + "correction": false + }, + { + "question": 7, + "code": "WY", + "answer": "cheyenne", + "correct": true, + "correction": false + }, + { + "question": 8, + "code": "OK", + "answer": "OKLAHOMA CITY", + "correct": true, + "correction": false + }, + { + "question": 9, + "code": "MT", + "answer": "HeLeNa", + "correct": true, + "correction": false + }, + { + "question": 10, + "code": "TX", + "answer": "austin", + "correct": true, + "correction": false + }, + { + "question": 11, + "code": "GA", + "answer": "ATLANTA", + "correct": true, + "correction": false + }, + { + "question": 12, + "code": "SC", + "answer": "CoLuMbIa", + "correct": true, + "correction": false + }, + { + "question": 13, + "code": "NH", + "answer": "concord", + "correct": true, + "correction": false + }, + { + "question": 14, + "code": "UT", + "answer": "SALT LAKE CITY", + "correct": true, + "correction": false + }, + { + "question": 15, + "code": "VA", + "answer": "RiChMoNd", + "correct": true, + "correction": false + }, + { + "question": 16, + "code": "NY", + "answer": "albany", + "correct": true, + "correction": false + }, + { + "question": 17, + "code": "IL", + "answer": "SPRINGFIELD", + "correct": true, + "correction": false + }, + { + "question": 18, + "code": "NV", + "answer": "CaRsOn cItY", + "correct": true, + "correction": false + }, + { + "question": 19, + "code": "RI", + "answer": "providence", + "correct": true, + "correction": false + }, + { + "question": 20, + "code": "IN", + "answer": "INDIANAPOLIS", + "correct": true, + "correction": false + }, + { + "question": 21, + "code": "MA", + "answer": "BoStOn", + "correct": true, + "correction": false + }, + { + "question": 22, + "code": "HI", + "answer": "honolulu", + "correct": true, + "correction": false + }, + { + "question": 23, + "code": "ME", + "answer": "AUGUSTA", + "correct": true, + "correction": false + }, + { + "question": 24, + "code": "VT", + "answer": "MoNtPeLiEr", + "correct": true, + "correction": false + }, + { + "question": 25, + "code": "CO", + "answer": "Dnever", + "correct": true, + "correction": true + }, + { + "question": 26, + "code": "AL", + "answer": "MONTGOMERY", + "correct": true, + "correction": false + }, + { + "question": 27, + "code": "WI", + "answer": "MaDiSoN", + "correct": true, + "correction": false + }, + { + "question": 28, + "code": "AK", + "answer": "juneau", + "correct": true, + "correction": false + }, + { + "question": 29, + "code": "OH", + "answer": "COLUMBUS", + "correct": true, + "correction": false + }, + { + "question": 30, + "code": "MD", + "answer": "AnNaPoLiS", + "correct": true, + "correction": false + }, + { + "question": 31, + "code": "MO", + "answer": "jefferson city", + "correct": true, + "correction": false + }, + { + "question": 32, + "code": "PA", + "answer": "HARRISBURG", + "correct": true, + "correction": false + }, + { + "question": 33, + "code": "MS", + "answer": "JaCkSoN", + "correct": true, + "correction": false + }, + { + "question": 34, + "code": "TN", + "answer": "nashville", + "correct": true, + "correction": false + }, + { + "question": 35, + "code": "KS", + "answer": "TOPEKA", + "correct": true, + "correction": false + }, + { + "question": 36, + "code": "NE", + "answer": "LiNcOlN", + "correct": true, + "correction": false + }, + { + "question": 37, + "code": "WA", + "answer": "olympia", + "correct": true, + "correction": false + }, + { + "question": 38, + "code": "NC", + "answer": "RALEIGH", + "correct": true, + "correction": false + }, + { + "question": 39, + "code": "SD", + "answer": "PiErRe", + "correct": true, + "correction": false + }, + { + "question": 40, + "code": "OR", + "answer": "salem", + "correct": true, + "correction": false + }, + { + "question": 41, + "code": "DE", + "answer": "DOVER", + "correct": true, + "correction": false + }, + { + "question": 42, + "code": "NM", + "answer": "SaNtA Fe", + "correct": true, + "correction": false + }, + { + "question": 43, + "code": "NJ", + "answer": "trenton", + "correct": true, + "correction": false + }, + { + "question": 44, + "code": "ID", + "answer": "BOISE", + "correct": true, + "correction": false + }, + { + "question": 45, + "code": "IA", + "answer": "DeS MoInEs", + "correct": true, + "correction": false + }, + { + "question": 46, + "code": "ND", + "answer": "bismarck", + "correct": true, + "correction": false + }, + { + "question": 47, + "code": "MI", + "answer": "LANSING", + "correct": true, + "correction": false + }, + { + "question": 48, + "code": "AR", + "answer": "LiTtLe rOcK", + "correct": true, + "correction": false + }, + { + "question": 49, + "code": "AZ", + "answer": "phoenix", + "correct": true, + "correction": false + }, + { + "question": 50, + "code": "CA", + "answer": "SACRAMENTO", + "correct": true, + "correction": false + } + ], + "run_id": "DEA80B37-7A53-4F77-82B2-86A9569376C3", + "exit": { + "disk_reads": 24320, + "disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "machine_frame": 123344, + "frame_number": 123344, + "image_content": true, + "cpu": "6809", + "cycles": 3681115004, + "generation": 2, + "revision": 0, + "remaining_field_budget": 92656, + "field_clock": 123344, + "isolated": true, + "state": "running", + "ram_kb": 512, + "screen_text": "DISK EXTENDED COLOR BASIC 2.1\nCOPR. 1982, 1986 BY TANDY\nUNDER LICENSE FROM MICROSOFT\nAND MICROWARE SYSTEMS CORP.\n\nOK\nDOS\nLOADM\"CAPITAL.BIN\":EXEC\nTHANKS FOR PLAYING CAPITAL QUEST\n!\nOK\n", + "project_id": "56AE77C5-04F7-463D-8596-A549B22EBAE8", + "boot": 1, + "artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "remaining_boots": 15, + "height": 480, + "width": 640, + "run_id": "DEA80B37-7A53-4F77-82B2-86A9569376C3", + "artifact_disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "pc": 42963, + "disk_dirty": false, + "fields": 123344, + "disk_provenance": { + "artifact_disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "origin_artifact_disk_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "origin_artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "artifact_id": "54851E31-863B-47CB-B152-807BB1327913", + "origin": "verified_artifact" + }, + "disk_origin": "verified_artifact", + "disk_original_sha256": "309aee9234063387bb57fba54f0b11ed9304c07d03e3dab0e55564d27bb17924", + "disk_writes": 0 + } +} \ No newline at end of file diff --git a/include/map_data.h b/include/map_data.h new file mode 100644 index 0000000..c4a9c81 --- /dev/null +++ b/include/map_data.h @@ -0,0 +1,6 @@ +extern const unsigned char national_spans[]; +extern const unsigned national_offsets[51]; +extern const unsigned char northeast_spans[]; +extern const unsigned northeast_offsets[51]; +extern const unsigned char hawaii_spans[]; +extern const unsigned hawaii_offsets[51]; diff --git a/include/quiz.h b/include/quiz.h new file mode 100644 index 0000000..4e81827 --- /dev/null +++ b/include/quiz.h @@ -0,0 +1,19 @@ +#ifndef QUIZ_H +#define QUIZ_H +#define STATE_COUNT 50 +#define ANSWER_SIZE 40 +typedef unsigned char U8; +typedef struct { const char *code; const char *name; const char *capital; } State; +extern const State states[50]; +extern U8 order[50], options[4], question, score, corrections; +extern U8 answered[50], correct[50], corrected[50]; +extern char responses[50][ANSWER_SIZE]; +extern unsigned random_state; +void quiz_start(unsigned seed); +unsigned quiz_random(unsigned bound); +void quiz_options(U8 state); +void normalize(const char *in, char *out); +/* 2 exact/alias, 1 near, 0 wrong (including a different known capital). */ +U8 classify(U8 state, const char *answer); +void quiz_record(U8 state, const char *answer, U8 right, U8 spelling); +#endif diff --git a/include/ui.h b/include/ui.h new file mode 100644 index 0000000..7b025af --- /dev/null +++ b/include/ui.h @@ -0,0 +1,11 @@ +#ifndef UI_H +#define UI_H +#include "quiz.h" +void text(unsigned x,unsigned y,const char *s,U8 color); +void frame(const char *label); +void show_map(U8 state); +U8 next_key(void); +void release_keys(void); +void close_input(void); +extern unsigned entropy; +#endif diff --git a/main.c b/main.c new file mode 100644 index 0000000..87c89af --- /dev/null +++ b/main.c @@ -0,0 +1,188 @@ +#include +#include +#include +#include +#include "quiz.h" +#include "ui.h" +static char line[54],answer[ANSWER_SIZE]; +static U8 mode,spelling_attempt; +/* Named phases make read-only debugger snapshots useful without altering play. */ +U8 phase, current_state; +static void present(void) +{ + if(!gime_present()) {gime_close();setHighSpeed(FALSE);printf("Graphics timer stopped.\n");exit(1);} +} +static U8 choose(const char *allowed) +{ + U8 c;release_keys(); + do {c=next_key();if(c>='a' && c<='z')c-='a'-'A';}while(!strchr(allowed,c)); + return c; +} +static void credits(void) +{ + phase=5;frame("CREDITS"); + text(8,19,"A MAP FOR EVERY STATE",6); + text(8,39,"Map (c) Fla-shop.com",7); + text(8,51,"https://www.fla-shop.com/svg/usa/",2); + text(8,65,"Creative Commons Attribution 4.0",7); + text(8,77,"https://creativecommons.org/licenses/by/4.0/",2); + text(8,94,"Adapted: rasterized, reduced, recolored;",7); + text(8,105,"state masks and enlarged detail views added.",7); + text(8,124,"Font: Pierre Sarrazin, public domain.",2); + text(8,138,"C / CMOC; VCC Plus GIME and keyboard APIs.",2); + text(8,158,"Full sources and notices: assets/CREDITS.md",7); + text(8,180,"SPACE: back",6);present();choose(" "); +} +static U8 title(void) +{ + U8 c; + do { + phase=0;frame("50 STATES"); + text(8,19,"HOW WELL DO YOU KNOW YOUR CAPITALS?",6); + show_map(49); + /* Right panel is replaced by the mode selector. */ + gime_fill_rect(209,32,111,111,0); + text(212,40,"CHOOSE A MODE",6); + text(212,58,"1 MULTIPLE",7);text(224,69,"CHOICE",7); + text(212,89,"2 TYPE THE",7);text(224,100,"CAPITAL",7); + text(212,123,"C CREDITS",2);text(212,136,"Q QUIT",2); + text(8,149,"Choice: 1-4. Type: letters, spaces, Enter.",7); + text(8,160,"Backspace edits. Near spelling: retry/reveal.",2); + text(8,171,"50 questions. Release keys between presses.",2); + text(8,182,"Gold marks the state. SPACE after feedback.",6); + present();c=choose("12CQ");if(c=='C')credits(); + }while(c=='C'); + return c; +} +static void question_screen(void) +{ + phase=1;frame(mode==1?"MULTIPLE CHOICE":"TYPE THE CAPITAL"); + sprintf(line,"Question %u of 50 Score %u",(unsigned)question+1,(unsigned)score); + text(8,19,line,7); + show_map(current_state); + gime_fill_rect(0,143,320,49,1); + sprintf(line,"%s: what is its capital?",states[current_state].name); + text(8,145,line,6); +} +static U8 multiple_choice(void) +{ + U8 i,c; + quiz_options(current_state);question_screen(); + for(i=0;i<4;++i) { + sprintf(line,"%u %s",(unsigned)i+1,states[options[i]].capital); + text(8+(i%2)*156,157+(i/2)*12,line,7); + } + text(8,183,"Press 1, 2, 3 or 4",2);present();c=choose("1234")-'1'; + strcpy(answer,states[options[c]].capital); + return options[c]==current_state; +} +static void input_screen(U8 too_long) +{ + gime_fill_rect(0,155,320,37,1);text(8,158,answer,7); + text(8+strlen(answer)*6,158,"_",6); + text(8,171,too_long?"39 characters maximum. Backspace to edit.":"Enter submits. Backspace edits. Esc reveals.",2); + text(8,183,"Case and extra spaces do not matter.",2);present(); +} +static void input_edit(U8 old_n,U8 new_n) +{ + U8 p,first=old_n