diff --git a/homebrew/dialbug/.gitignore b/homebrew/dialbug/.gitignore new file mode 100644 index 0000000..77b53e4 --- /dev/null +++ b/homebrew/dialbug/.gitignore @@ -0,0 +1,9 @@ +build/ +__pycache__/ +dialbug.wsc +dist/ +release/battery-glow-mednafen-proof.wav +release/swansong-final-frame.png +release/swansong-playtest-report.json +release/verification-report.json +release/tracks/ diff --git a/homebrew/dialbug/COPYING b/homebrew/dialbug/COPYING new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/homebrew/dialbug/COPYING @@ -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/homebrew/dialbug/CREDITS.md b/homebrew/dialbug/CREDITS.md new file mode 100644 index 0000000..cb75f84 --- /dev/null +++ b/homebrew/dialbug/CREDITS.md @@ -0,0 +1,25 @@ +# Credits and provenance + +- **Dialbug** title, original SD mobile-suit technician direction, interface, native + cartridge player, and five-song score: newly created for this project. +- OpenAI ImageGen: original Dialbug visual-development master, generated from + the archived prompt in `assets/source-art/`; the runtime derivative and exact + interface typography were selected and built specifically for this ROM. +- **Humming Cat** compact sound-driver/data-player concept: DOI Hiroyuki, beta + 04, May 12, 2002. It is credited as a technical research reference, not as + Dialbug's name, mascot, artwork, soundtrack, or distributed code. +- Wonderful Toolchain and WonderSwan system libraries: Adrian “asie” Siekierka + and contributors; linked system libraries are zlib-licensed and the GCC + runtime uses the GCC Runtime Library Exception. See `THIRD_PARTY_NOTICES.md`. +- Swan Song desktop playtest engine: its bundled pinned ares backend and Swan + Song contributors, with exact build identity recorded in release evidence. +- Mednafen: independent WonderSwan boot, checksum, and WAV-recording proof. + +Humming Cat research reference: + + +No Humming Cat binary, compiler, sample song data, name treatment, or mascot art +is included in Dialbug. + +Dialbug's project-authored material is released under GPL-3.0-or-later. See +`COPYING` and `release/LICENSE_STATUS.md`. diff --git a/homebrew/dialbug/Makefile b/homebrew/dialbug/Makefile new file mode 100644 index 0000000..0b7f26f --- /dev/null +++ b/homebrew/dialbug/Makefile @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2026 Regionally Famous contributors + +WONDERFUL_TOOLCHAIN ?= /opt/wonderful +TARGET := wswan/medium +include $(WONDERFUL_TOOLCHAIN)/target/$(TARGET)/makedefs.mk + +MAKEFLAGS += --no-builtin-rules + +NAME := dialbug +BUILDDIR := build +ELF := $(BUILDDIR)/$(NAME).elf +ELF_STAGE1 := $(BUILDDIR)/$(NAME)_stage1.elf +ROM := $(NAME).wsc + +SOURCEDIRS := src +ASSETDIRS := assets/runtime +INCLUDEDIRS := src $(BUILDDIR)/assets +LIBS := -lwse -lwsx -lws +LIBDIRS := $(WF_TARGET_DIR) + +INCLUDEFLAGS := $(foreach path,$(INCLUDEDIRS),-I$(path)) \ + $(foreach path,$(LIBDIRS),-isystem $(path)/include) +LIBDIRFLAGS := $(foreach path,$(LIBDIRS),-L$(path)/lib) + +CFLAGS := -std=gnu11 -Wall -Wextra -Werror \ + $(WF_ARCH_CFLAGS) $(INCLUDEFLAGS) \ + -ffunction-sections -fdata-sections -fno-common -Os -MMD -MP +LDFLAGS := -T$(WF_LDSCRIPT) $(LIBDIRFLAGS) $(WF_ARCH_LDFLAGS) $(LIBS) + +SOURCES_C := $(shell find $(SOURCEDIRS) -name "*.c") +SOURCES_WFPROCESS := $(shell find $(ASSETDIRS) -name "*.lua") +OBJS_ASSETS := $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_WFPROCESS))) +OBJS_C := $(patsubst %.c,$(BUILDDIR)/%.o,$(SOURCES_C)) +OBJS := $(OBJS_ASSETS) $(OBJS_C) + +.PHONY: all clean verify package + +all: $(ROM) + +$(ROM): $(ELF_STAGE1) + @echo " ROM $@" + $(BUILDROM) -c wfconfig.toml -o $@ --output-elf $(ELF) $< + +$(ELF_STAGE1): $(OBJS) + @mkdir -p $(@D) + @echo " LD $@" + $(CC) -r -o $@ $(OBJS) $(WF_CRT0) $(LDFLAGS) -lgcc + +$(BUILDDIR)/%.o: %.c | $(OBJS_ASSETS) + @mkdir -p $(@D) + @echo " CC $<" + $(CC) $(CFLAGS) -c -o $@ $< + +$(BUILDDIR)/%.lua.o: %.lua + @mkdir -p $(@D) + @echo " PROCESS $<" + $(WF)/bin/wf-process -o $(BUILDDIR)/$*.c -t $(TARGET) \ + --depfile $(BUILDDIR)/$*.lua.d \ + --depfile-target $(BUILDDIR)/$*.lua.o $< + python3 scripts/normalize_wfprocess_c.py $(BUILDDIR)/$*.c + $(CC) $(CFLAGS) -c -o $@ $(BUILDDIR)/$*.c + +clean: + $(RM) $(BUILDDIR) $(ROM) + +verify: $(ROM) + python3 scripts/verify_release.py + +package: verify + python3 scripts/package_release.py + +-include $(OBJS:.o=.d) diff --git a/homebrew/dialbug/README.md b/homebrew/dialbug/README.md new file mode 100644 index 0000000..e56b1d4 --- /dev/null +++ b/homebrew/dialbug/README.md @@ -0,0 +1,61 @@ +# Dialbug + +Dialbug is a self-contained WonderSwan Color chiptune-player ROM with five +original songs and its own SD mobile-suit-style technician identity. Its +signature parts are amber armor, a split cyan visor, asymmetric tuning antenna, +round tuner core, circuit radiator backpack, and mixer gauntlet. SD proportions +keep the helmet, shoulders, chest, hands, and feet readable at 72×64 pixels. + +The player provides four hardware channels, wavetable instruments, channel-3 +hardware sweep, channel-4 noise percussion, per-frame envelopes, looping patterns, variable playback +speed, master volume, pause/restart, per-channel mute, and a live mix display. + +## Interface art + +The high-resolution Dialbug SD master, exact ImageGen prompt, and provenance +record are in `assets/source-art/`. Run +`python3 scripts/build_interface_art.py` to reproducibly reduce the mascot to a +72×64, four-color PNG. Wonderful Toolchain converts it into 9×8 native 2bpp +tiles. Titles, values, meters, and control hints are rendered exactly by ROM +code rather than generated as part of the image. + +## Controls + +- X-pad left/right: previous/next song +- X-pad up/down: volume up/down +- A: pause or continue +- B: restart the current song +- Start: cycle 50%, 75%, 100%, 125%, and 150% speed +- Y1/Y2/Y3/Y4: mute channels 1/2/3/4 + +## Build + +```sh +source /opt/wonderful/bin/wf-env +python3 scripts/build_interface_art.py +make +``` + +The output is `dialbug.wsc`. + +## Technical provenance + +DOI Hiroyuki's 2002 WonderWitch Humming Cat project was a research reference +for the compact VBlank-sequencer/player concept: + +- +- + +Dialbug does not use the Humming Cat name as its product identity and does not +copy its mascot, player binary, driver binary, or sample song data. The native +cartridge implementation, five-song score, title, mascot, and interface are new +for this project. + +## Status + +Version 0.1.0 is an emulator-qualified public release under +GPL-3.0-or-later. Its deterministic package includes the ROM, complete +corresponding Dialbug source, license, notices, and hash-bound evidence. + +Do not claim physical WonderSwan-family, flash-cartridge, Analogue Pocket, or +Dock compatibility until the hardware checks in `release/` have been completed. diff --git a/homebrew/dialbug/THIRD_PARTY_NOTICES.md b/homebrew/dialbug/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..1fa0689 --- /dev/null +++ b/homebrew/dialbug/THIRD_PARTY_NOTICES.md @@ -0,0 +1,48 @@ +# Third-party notices + +Dialbug is built with Wonderful Toolchain. The public release does not include +the compiler or toolchain installation, but the ROM statically links the +following runtime components. + +## Wonderful target-wswan-syslibs + +Installed package: `target-wswan-syslibs 0.2.0.r254.d7d97ce-1` + +License: zlib + +Copyright (c) 2022, 2023, 2024 Adrian "asie" Siekierka + +This software is provided 'as-is', without any express or implied warranty. In +no event will the authors be held liable for any damages arising from the use +of this software. + +Permission is granted to anyone to use this software for any purpose, including +commercial applications, and to alter it and redistribute it freely, subject +to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a product, + an acknowledgment in the product documentation would be appreciated but is + not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +## Wonderful IA-16 GCC runtime + +Installed package: `toolchain-gcc-ia16-elf-gcc-libs +6.3.0.r147159.e7507d1845e-1` + +License: `GPL-3.0-or-later WITH GCC-exception-3.1` + +The GCC Runtime Library Exception permits eligible compiled programs to use +the GCC runtime without imposing GCC's license on independently written code. +The Dialbug source is independently released under GPL-3.0-or-later. The +exception text and GCC sources are available from the Wonderful Toolchain GCC +package source identified above. + +## Build-time asset tools + +Wonderful's `wf-process` Lua modules used by this project identify themselves +as MIT-licensed. They run at build time and are not embedded as Lua source in +the distributed ROM. diff --git a/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v4-preview.png b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v4-preview.png new file mode 100644 index 0000000..ed237af Binary files /dev/null and b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v4-preview.png differ diff --git a/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v4.png b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v4.png new file mode 100644 index 0000000..6061e33 Binary files /dev/null and b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v4.png differ diff --git a/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v5-preview.png b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v5-preview.png new file mode 100644 index 0000000..03510ce Binary files /dev/null and b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v5-preview.png differ diff --git a/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v5.png b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v5.png new file mode 100644 index 0000000..18e87d7 Binary files /dev/null and b/homebrew/dialbug/assets/runtime/dialbug-sd-mascot-v5.png differ diff --git a/homebrew/dialbug/assets/runtime/dialbug.lua b/homebrew/dialbug/assets/runtime/dialbug.lua new file mode 100644 index 0000000..35ef74f --- /dev/null +++ b/homebrew/dialbug/assets/runtime/dialbug.lua @@ -0,0 +1,17 @@ +-- SPDX-License-Identifier: GPL-3.0-or-later +-- Copyright (C) 2026 Regionally Famous contributors + +local process = require("wf.api.v1.process") +local superfamiconv = require("wf.api.v1.process.tools.superfamiconv") + +local files = process.inputs("dialbug-sd-mascot-v5.png") +for _, file in pairs(files) do + local tilemap = superfamiconv.convert_tilemap( + file, + superfamiconv.config() + :mode("wsc"):bpp(2) + :color_zero("#00091e") + :tile_base(0):palette_base(6) + ) + process.emit_symbol("gfx_dialbug_mascot", tilemap) +end diff --git a/homebrew/dialbug/assets/source-art/asset-provenance.json b/homebrew/dialbug/assets/source-art/asset-provenance.json new file mode 100644 index 0000000..ad062b2 --- /dev/null +++ b/homebrew/dialbug/assets/source-art/asset-provenance.json @@ -0,0 +1,16 @@ +{ + "schema": "dialbug-source-art-provenance-v5", + "asset": "dialbug-sd-mobile-suit-imagegen-v5.png", + "created": "2026-07-18", + "generator": "OpenAI ImageGen built-in tool", + "mode": "edit/reference-guided-generation", + "purpose": "Original SD mobile-suit mascot source art for the Dialbug WonderSwan player", + "sha256": "228164e1875b03bd006ee8c6f64f48f205874facb3fce5f486e7c9cac6d5cf18", + "prompt": "dialbug-sd-mobile-suit-imagegen-v5.prompt.md", + "runtimeDerivative": "../runtime/dialbug-sd-mascot-v5.png", + "originality": { + "kept": ["amber armor", "separate cyan camera eyes", "asymmetric tuning antenna", "round tuner core", "radiator backpack", "three-lamp mixer gauntlet"], + "avoided": ["named Gundam replica", "classic twin V-fin", "red chin", "RX-78 color layout", "franchise weapon or shield", "known faction marks", "cat anatomy"] + }, + "notes": "The v4 Dialbug mascot was used only as an identity reference for a targeted tiny-screen readability pass. V5 simplifies the face, antenna, chest core, shoulders, and mixer lights. Retired cat and insect assets were not used as inputs. Exact interface text is rendered by ROM code." +} diff --git a/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v4.png b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v4.png new file mode 100644 index 0000000..c293e33 Binary files /dev/null and b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v4.png differ diff --git a/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v4.prompt.md b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v4.prompt.md new file mode 100644 index 0000000..5911096 --- /dev/null +++ b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v4.prompt.md @@ -0,0 +1,60 @@ +# Dialbug SD mobile-suit source-art prompt + +- Generator: OpenAI ImageGen (built-in tool) +- Mode: edit/reference-guided generation +- Use case: original SD mobile-suit production sprite source +- Generated: 2026-07-18 +- Master SHA-256: `60ae8d7ef0fe5e1e1e8be7d50adfff38278bbf9ad769f534a3f40f9b525b19f6` + +## Prompt + +Use case: precise-object-edit + +Asset type: production sprite-source illustration for an original SD +mobile-suit mascot in a 72×64-pixel WonderSwan Color interface + +Input image: use the most recent tall Dialbug mobile-suit sprite source only as +a character-design reference + +Primary request: transform Dialbug into a true SD Gundam-style proportion +system while preserving its original identity; the result should instantly +read as an SD Japanese mobile suit, but it must not be a replica of any existing +Gundam + +SD proportion rules: complete robot approximately 2.1 heads tall; enormous +mechanical helmet/head taking nearly half the total height; tiny compact armored +torso; very short stubby upper arms and thighs; oversized simple shoulder blocks +and forearms; small three-finger mechanical mitts; broad chunky lower legs; huge +simple split-toe block feet; sparse purposeful panel lines + +Mechanical face: large angular helmet shell, one clean asymmetric tuning-fork +antenna on the left instead of a twin V-fin, strong brow, split cyan camera-eye +visor, compact vented faceplate, small tapered gunmetal chin guard with no red +chin; absolutely no human face + +Original Dialbug signatures to preserve: burnt amber armor, midnight gunmetal +frame, bright cyan sensors, round analog tuner-core centered in the tiny chest, +two simplified circuit-radiator backpack plates, forearm mixing-console tool +with three cyan lamps + +Pose/composition: one complete SD robot centered on a perfectly flat uniform +solid midnight navy #00091e background, neutral friendly heroic stance, slight +three-quarter turn, both feet and full antenna visible, large within the frame +with minimal padding + +Style/medium: authentic late-1980s/1990s SD mecha cel art and sprite-source +design, crisp flat color blocks, hard clean silhouette, simple mechanical +shading, highly readable when reduced to 72×64 + +Color palette: only midnight navy background, gunmetal inner frame, burnt amber +armor, and electric cyan sensors + +Constraints: original design; no exact Gundam head, no classic twin V-fin, no +RX-78 red-blue-yellow-white color layout, no franchise logo, no unit numbers, +no readable text, no watermark, no gun, no shield, no cat or animal anatomy, no +second character + +Avoid: tall realistic limbs, complex layered armor, generic humanoid robot, +human mouth or eyes, chibi human face, toy photography, model-kit sprues, battle +scene, UI panels, background objects, floor shadow, glossy 3D, recognizable +named Gundam diff --git a/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.png b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.png new file mode 100644 index 0000000..836364d Binary files /dev/null and b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.png differ diff --git a/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.prompt.md b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.prompt.md new file mode 100644 index 0000000..479301d --- /dev/null +++ b/homebrew/dialbug/assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.prompt.md @@ -0,0 +1,68 @@ +# Dialbug SD mobile-suit source-art prompt — v5 + +Mode: OpenAI ImageGen built-in tool, edit/reference-guided generation. + +Reference: the approved Dialbug v4 mascot. The reference establishes character +identity only; the result must remain an original design rather than reproduce +any named licensed mobile suit. + +## Prompt + +PRECISION CHARACTER REDESIGN / REFERENCE-GUIDED EDIT. + +Use the supplied Dialbug image as the identity reference. Create a cleaner v5 +of the SAME original mascot for conversion into a 72×64 four-color WonderSwan +sprite. + +Preserve these identity invariants: + +- Original super-deformed real-robot music mascot named Dialbug; never depict + an existing licensed mobile suit. +- About two heads tall: enormous mechanical helmet/head, tiny compact torso, + stubby limbs, broad block feet. +- Burnt amber armor, dark gunmetal frame, bright cyan optical/music accents, + very dark navy background. +- One asymmetric tuning-fork / antenna blade, a circular chest tuner core, + compact radiator-like backpack shapes, and a right forearm mixer/controller + gauntlet. +- Confident neutral front three-quarter stance, full body visible. + +Targeted v5 improvements: + +- Shorten and thicken the single asymmetric antenna so it survives at tiny + scale; keep it fully inside the image. +- Make the face unmistakably mechanical and instantly readable: two separate + angular cyan camera-eye shapes under one strong amber brow, a dark gunmetal + central faceplate with a compact vent, no human mouth, no smile, no nose, no + skin. +- Remove the huge cyan forehead panel. A tiny cyan forehead sensor is + acceptable, but cyan must be concentrated in the two eyes, circular chest + core, and exactly three simple indicator lights on the mixer gauntlet. +- Enlarge and simplify the circular chest tuner core. +- Simplify shoulder armor and backpack silhouette. Reduce panel-line noise and + incidental little marks. +- Make the stance slightly more frontal and stable, with clear gaps between + arms, torso, and legs. +- Make the mixer gauntlet a single readable rectangular music-control object + integrated into the right forearm, with exactly three vertically arranged + cyan square lights. +- Keep the left hand as a small mechanical three-finger mitt. +- No weapon, shield, gun, sword, logo, lettering, number, decal, pseudo-text, + cockpit, human pilot, scenery, floor, cast shadow, or extra props. +- Avoid a twin V-fin, red chin, white/blue/red hero palette, or any exact Gundam + franchise silhouette. + +Rendering contract: + +- Square character-design image, full body centered, about 82% of canvas + height, generous safe padding. +- True crisp pixel-art aesthetic with deliberate chunky clusters and hard + stair-stepped edges. +- Flat graphic color blocking only. Use exactly these visual colors with no + gradients, bloom, texture, glow, atmospheric lighting, transparency, or + antialias softness: deep navy `#00091e` background, gunmetal `#283543`, burnt + amber `#dc760a`, electric cyan `#22cfdc`. +- Quiet solid background, strongest silhouette possible, suitable for + downsampling and strict four-color quantization. +- Polished late-1980s handheld-game SD-mecha character portrait, but fully + original. diff --git a/homebrew/dialbug/music/signal-bloom.md b/homebrew/dialbug/music/signal-bloom.md new file mode 100644 index 0000000..50aa2f1 --- /dev/null +++ b/homebrew/dialbug/music/signal-bloom.md @@ -0,0 +1,26 @@ +# Signal Bloom + +- Scene: a quiet service robot sends a handshake into low orbit and receives a + bright, slightly mysterious reply. +- Tempo and meter: 140 BPM, 4/4, sixteenth-note engine rows. +- Tonal center: E minor, with a B-major-colored dominant turnaround. +- Hook: E-G-B, answered by A-G-F-sharp and a high E pickup. +- Form: eight bars, `A A B A / B B A T`. +- Loop duration: approximately 13.714 seconds at 100% speed. + +## Channel plan + +1. Pluck/lead melody, moving between the E-minor hook and a wider B section. +2. Triangle bass outlining E minor, C, G, D, A minor, and B. +3. Sine-like hardware sweep replies; signed amount `+2` every 24 ticks of the + 375 Hz sweep clock, producing a restrained upward gesture. +4. Wave-table kick plus long-sequence snare and short metallic hat noise. + +## Initial proof + +- Dialbug score lint: pass (15 patterns, 137 populated rows, 5 songs). +- Wonderful Toolchain build: pass. +- SwanSong full loop: 1,400 frames, non-silent stereo audio, peak 0.38575026. +- SwanSong isolated final-window peaks: channel 1 0.12566361; channel 2 + 0.07353656; channel 3 0.07539817; channel 4 0.11555749. +- Physical WonderSwan and headphone-adapter listening: pending. diff --git a/homebrew/dialbug/release/HARDWARE_TEST.md b/homebrew/dialbug/release/HARDWARE_TEST.md new file mode 100644 index 0000000..25c0e74 --- /dev/null +++ b/homebrew/dialbug/release/HARDWARE_TEST.md @@ -0,0 +1,14 @@ +# Physical hardware test + +Status: **pending** + +This does not block the emulator-qualified 0.1.0 public release. It does block +claims that Dialbug is physically qualified for a WonderSwan-family console, +flash cartridge, Analogue Pocket, or Dock. + +Before calling this a hardware release, test the exact ROM hash recorded in +`verification-report.json` on at least one WonderSwan Color or SwanCrystal and +a supported flash cartridge. Confirm boot, all five songs, headphones, built-in +speaker, pause/resume, volume, every speed, every channel mute, loop seams, LCD +readability, and a 30-minute soak. Record the console model, flash cartridge, +firmware, date, tester, and any audio/video evidence here. diff --git a/homebrew/dialbug/release/LICENSE_STATUS.md b/homebrew/dialbug/release/LICENSE_STATUS.md new file mode 100644 index 0000000..8565052 --- /dev/null +++ b/homebrew/dialbug/release/LICENSE_STATUS.md @@ -0,0 +1,17 @@ +# License status + +Dialbug 0.1.0 is authorized for public distribution under +**GNU GPL v3 or any later version** (`GPL-3.0-or-later`). The license applies to +the project-authored source, scripts, score, documentation, and original Dialbug +visual assets to the extent copyright or similar rights apply. The complete +license text is in `COPYING`. + +The public package contains the ROM and its complete corresponding Dialbug +source. Wonderful Toolchain's linked WonderSwan libraries use the zlib license, +and the GCC runtime is distributed under GPLv3-or-later with the GCC Runtime +Library Exception. Their notices and installed package identities are recorded +in `THIRD_PARTY_NOTICES.md`. + +No Humming Cat source, binary, mascot artwork, name treatment, or song data is +included. Its project and archive are cited only because the original +documentation informed the low-level player/sequencer research. diff --git a/homebrew/dialbug/release/RELEASE_NOTES.md b/homebrew/dialbug/release/RELEASE_NOTES.md new file mode 100644 index 0000000..e7f0366 --- /dev/null +++ b/homebrew/dialbug/release/RELEASE_NOTES.md @@ -0,0 +1,47 @@ +# Dialbug 0.1.0 + +Dialbug is a playable, self-contained WonderSwan Color music-player ROM with +five original chiptunes: + +1. **Battery Glow** — 148 BPM +2. **Neon Raintrace** — 132 BPM +3. **Soft Reset Sunrise** — 106 BPM +4. **Last Save Point** — 164 BPM +5. **Signal Bloom** — 140 BPM + +Dialbug has an independent name and original SD mobile-suit technician mascot: +an oversized mechanical helmet, amber armor, split cyan visor, asymmetric +tuning antenna, round tuner core, circuit radiator backpack, and mixer gauntlet. +It avoids named-suit replicas, classic twin V-fins, RX-78 color blocking, known +weapons, and faction marks. Earlier cat, insect, and tall-suit concepts and +their generated assets are not included. + +DOI Hiroyuki's 2002 WonderWitch Humming Cat project remains credited only as a +technical research reference for the compact sequencer/player concept. Dialbug +does not include its binaries, tools, sample resources, name treatment, or +mascot artwork. + +## What is verified + +- Two clean Wonderful Toolchain builds produce identical 128 KiB ROMs. +- The ROM footer checksum is valid and independently accepted by Mednafen. +- The Swan Song ares engine boots all five tracks with isolated empty + persistence; every track produces distinct, finite, non-silent audio. +- The combined plan exercises pause/continue, song changes, channel + mute/unmute, and speed change. +- The ImageGen master is hash-locked and the runtime mascot is exactly 9×8 + hardware tiles. +- Mednafen records more than two complete loops of Battery Glow at 48 kHz + stereo; the measured loop period is checked against its 148 BPM score. + +## What is not verified + +- No physical WonderSwan, WonderSwan Color, SwanCrystal, flash cartridge, + Analogue Pocket, or Dock test has been performed. + +## Distribution + +- Public distribution is authorized under GPL-3.0-or-later. +- The release archive includes the ROM, complete corresponding Dialbug source, + license text, third-party notices, deterministic verification report, and + SwanSong/Mednafen evidence. diff --git a/homebrew/dialbug/release/plans/song-1.json b/homebrew/dialbug/release/plans/song-1.json new file mode 100644 index 0000000..1630517 --- /dev/null +++ b/homebrew/dialbug/release/plans/song-1.json @@ -0,0 +1,7 @@ +{ + "schema": "swan-song-frame-input-plan-v1", + "totalFrames": 1200, + "events": [ + { "frameIndex": 0, "inputs": [] } + ] +} diff --git a/homebrew/dialbug/release/plans/song-2.json b/homebrew/dialbug/release/plans/song-2.json new file mode 100644 index 0000000..dcf55d9 --- /dev/null +++ b/homebrew/dialbug/release/plans/song-2.json @@ -0,0 +1,9 @@ +{ + "schema": "swan-song-frame-input-plan-v1", + "totalFrames": 1200, + "events": [ + { "frameIndex": 0, "inputs": [] }, + { "frameIndex": 120, "inputs": ["x2"] }, + { "frameIndex": 123, "inputs": [] } + ] +} diff --git a/homebrew/dialbug/release/plans/song-3.json b/homebrew/dialbug/release/plans/song-3.json new file mode 100644 index 0000000..909bf9d --- /dev/null +++ b/homebrew/dialbug/release/plans/song-3.json @@ -0,0 +1,11 @@ +{ + "schema": "swan-song-frame-input-plan-v1", + "totalFrames": 1200, + "events": [ + { "frameIndex": 0, "inputs": [] }, + { "frameIndex": 120, "inputs": ["x2"] }, + { "frameIndex": 123, "inputs": [] }, + { "frameIndex": 180, "inputs": ["x2"] }, + { "frameIndex": 183, "inputs": [] } + ] +} diff --git a/homebrew/dialbug/release/plans/song-4.json b/homebrew/dialbug/release/plans/song-4.json new file mode 100644 index 0000000..affa7e3 --- /dev/null +++ b/homebrew/dialbug/release/plans/song-4.json @@ -0,0 +1,13 @@ +{ + "schema": "swan-song-frame-input-plan-v1", + "totalFrames": 1200, + "events": [ + { "frameIndex": 0, "inputs": [] }, + { "frameIndex": 120, "inputs": ["x2"] }, + { "frameIndex": 123, "inputs": [] }, + { "frameIndex": 180, "inputs": ["x2"] }, + { "frameIndex": 183, "inputs": [] }, + { "frameIndex": 240, "inputs": ["x2"] }, + { "frameIndex": 243, "inputs": [] } + ] +} diff --git a/homebrew/dialbug/release/plans/song-5.json b/homebrew/dialbug/release/plans/song-5.json new file mode 100644 index 0000000..4ea7eaf --- /dev/null +++ b/homebrew/dialbug/release/plans/song-5.json @@ -0,0 +1,15 @@ +{ + "schema": "swan-song-frame-input-plan-v1", + "totalFrames": 1400, + "events": [ + { "frameIndex": 0, "inputs": [] }, + { "frameIndex": 120, "inputs": ["x2"] }, + { "frameIndex": 123, "inputs": [] }, + { "frameIndex": 180, "inputs": ["x2"] }, + { "frameIndex": 183, "inputs": [] }, + { "frameIndex": 240, "inputs": ["x2"] }, + { "frameIndex": 243, "inputs": [] }, + { "frameIndex": 300, "inputs": ["x2"] }, + { "frameIndex": 303, "inputs": [] } + ] +} diff --git a/homebrew/dialbug/release/playtest-plan.json b/homebrew/dialbug/release/playtest-plan.json new file mode 100644 index 0000000..fbc49ae --- /dev/null +++ b/homebrew/dialbug/release/playtest-plan.json @@ -0,0 +1,33 @@ +{ + "schema": "swan-song-frame-input-plan-v1", + "totalFrames": 2700, + "events": [ + { "frameIndex": 0, "inputs": [] }, + { "frameIndex": 300, "inputs": ["a"] }, + { "frameIndex": 303, "inputs": [] }, + { "frameIndex": 360, "inputs": ["a"] }, + { "frameIndex": 363, "inputs": [] }, + { "frameIndex": 480, "inputs": ["x4"] }, + { "frameIndex": 483, "inputs": [] }, + { "frameIndex": 540, "inputs": ["x2"] }, + { "frameIndex": 543, "inputs": [] }, + { "frameIndex": 600, "inputs": ["x2"] }, + { "frameIndex": 603, "inputs": [] }, + { "frameIndex": 1200, "inputs": ["x2"] }, + { "frameIndex": 1203, "inputs": [] }, + { "frameIndex": 1500, "inputs": ["y3"] }, + { "frameIndex": 1503, "inputs": [] }, + { "frameIndex": 1560, "inputs": ["y3"] }, + { "frameIndex": 1563, "inputs": [] }, + { "frameIndex": 1800, "inputs": ["x2"] }, + { "frameIndex": 1803, "inputs": [] }, + { "frameIndex": 2100, "inputs": ["y4"] }, + { "frameIndex": 2103, "inputs": [] }, + { "frameIndex": 2160, "inputs": ["y4"] }, + { "frameIndex": 2163, "inputs": [] }, + { "frameIndex": 2400, "inputs": ["start"] }, + { "frameIndex": 2403, "inputs": [] }, + { "frameIndex": 2520, "inputs": ["b"] }, + { "frameIndex": 2523, "inputs": [] } + ] +} diff --git a/homebrew/dialbug/scripts/build_interface_art.py b/homebrew/dialbug/scripts/build_interface_art.py new file mode 100644 index 0000000..e3e2aa2 --- /dev/null +++ b/homebrew/dialbug/scripts/build_interface_art.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2026 Regionally Famous contributors +"""Build the four-color, tile-aligned mascot used by the WonderSwan ROM.""" + +from __future__ import annotations + +import hashlib +from pathlib import Path + +from PIL import Image + + +ROOT = Path(__file__).resolve().parents[1] +SOURCE = ROOT / "assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.png" +OUTPUT = ROOT / "assets/runtime/dialbug-sd-mascot-v5.png" +PREVIEW = ROOT / "assets/runtime/dialbug-sd-mascot-v5-preview.png" + +EXPECTED_SOURCE_SHA256 = ( + "228164e1875b03bd006ee8c6f64f48f205874facb3fce5f486e7c9cac6d5cf18" +) + +# The crop isolates the complete SD mobile suit and its antenna. The 72x64 +# result occupies exactly 9x8 WonderSwan tiles. +CROP = (120, 70, 1135, 1220) +OUTPUT_SIZE = (72, 64) +MASCOT_SIZE = (64, 64) + +# Midnight navy, gunmetal inner frame, amber armor, and cyan sensors. Keeping a +# fixed four-color palette makes the runtime derivative exactly reproducible. +COLORS = ( + (0x00, 0x09, 0x1E), + (0x28, 0x35, 0x43), + (0xDC, 0x76, 0x0A), + (0x22, 0xCF, 0xDC), +) + + +def sha256(path: Path) -> str: + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def fixed_palette() -> Image.Image: + palette = Image.new("P", (1, 1)) + values = [component for color in COLORS for component in color] + values.extend([0] * (768 - len(values))) + palette.putpalette(values) + return palette + + +def main() -> int: + if sha256(SOURCE) != EXPECTED_SOURCE_SHA256: + raise SystemExit("ImageGen source master changed; review the crop before rebuilding") + + source = Image.open(SOURCE).convert("RGB") + crop = source.crop(CROP) + # The SD source is normalized to a square runtime field so the head, + # shoulders, tuner core, and feet remain bold at hardware scale. + reduced = crop.resize(MASCOT_SIZE, Image.Resampling.LANCZOS) + + # Preserve the cyan eyes, tuner core, and mixer lamps through the aggressive + # downsample. The v5 source deliberately makes these accents large enough + # to survive without expanding the mask into neighboring armor pixels. + cyan_mask = Image.new("L", crop.size) + cyan_mask.putdata([ + 255 if green > 105 and blue > 120 and red < 110 and blue > red + 35 else 0 + for red, green, blue in crop.get_flattened_data() + ]) + cyan_mask = cyan_mask.resize(MASCOT_SIZE, Image.Resampling.BOX) + cyan_mask = cyan_mask.point(lambda value: 255 if value >= 8 else 0) + reduced.paste(COLORS[3], mask=cyan_mask) + + canvas = Image.new("RGB", OUTPUT_SIZE, COLORS[0]) + canvas.paste( + reduced, + ((OUTPUT_SIZE[0] - reduced.width) // 2, (OUTPUT_SIZE[1] - reduced.height) // 2), + ) + indexed = canvas.quantize( + palette=fixed_palette(), + dither=Image.Dither.NONE, + ) + # Pillow may choose a duplicate black entry beyond the four meaningful + # slots in the padded palette. Collapse every padded entry back to color 0 + # so each 8x8 source tile is genuinely 2bpp-compatible. + indexed = indexed.point([0, 1, 2, 3] + [0] * 252) + indexed.putpalette(fixed_palette().getpalette()) + OUTPUT.parent.mkdir(parents=True, exist_ok=True) + indexed.save(OUTPUT, optimize=False) + indexed.resize((288, 256), Image.Resampling.NEAREST).save(PREVIEW, optimize=False) + print(f"wrote {OUTPUT.relative_to(ROOT)} ({OUTPUT_SIZE[0]}x{OUTPUT_SIZE[1]})") + print(f"sha256 {sha256(OUTPUT)}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/homebrew/dialbug/scripts/normalize_wfprocess_c.py b/homebrew/dialbug/scripts/normalize_wfprocess_c.py new file mode 100644 index 0000000..cfcf8d6 --- /dev/null +++ b/homebrew/dialbug/scripts/normalize_wfprocess_c.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2026 Regionally Famous contributors +"""Normalize wf-process symbol order so clean ROM builds are reproducible.""" + +from __future__ import annotations + +from pathlib import Path +import re +import sys + + +DEFINITION = re.compile( + r"const uint8_t __wf_rom (?P[A-Za-z0-9_]+)\[[0-9]+\] " + r"__attribute__\(\(aligned\(2\)\)\) = \{\n.*?\n\};\n", + re.DOTALL, +) + + +def main() -> int: + if len(sys.argv) != 2: + raise SystemExit("usage: normalize_wfprocess_c.py GENERATED.c") + path = Path(sys.argv[1]) + text = path.read_text(encoding="utf-8") + matches = list(DEFINITION.finditer(text)) + if not matches: + raise SystemExit(f"no wf-process symbols found in {path}") + + preamble = text[: matches[0].start()] + trailer = text[matches[-1].end() :] + # wf-process stores emitted symbols in a Lua hash table. Sorting the + # resulting definitions prevents hash iteration order from changing ELF + # section placement and, consequently, otherwise identical ROM bytes. + definitions = sorted( + (match.group("name"), match.group(0)) for match in matches + ) + preamble = re.sub( + r"^// autogenerated by wf-process on .*?$", + "// autogenerated by wf-process; symbol order normalized", + preamble, + count=1, + flags=re.MULTILINE, + ) + path.write_text( + preamble + "".join(block for _, block in definitions) + trailer, + encoding="utf-8", + ) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/homebrew/dialbug/scripts/package_release.py b/homebrew/dialbug/scripts/package_release.py new file mode 100644 index 0000000..24bb997 --- /dev/null +++ b/homebrew/dialbug/scripts/package_release.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2026 Regionally Famous contributors +"""Create the deterministic, source-inclusive Dialbug public release.""" + +from __future__ import annotations + +import hashlib +import json +from pathlib import Path +import shutil +import zipfile + + +ROOT = Path(__file__).resolve().parents[1] +DIST = ROOT / "dist" +RELEASE_VERSION = "0.1.0" +LICENSE_ID = "GPL-3.0-or-later" +NAME = f"dialbug-{RELEASE_VERSION}" +ROM_SOURCE = ROOT / "dialbug.wsc" + + +def sha256_bytes(data: bytes) -> str: + return hashlib.sha256(data).hexdigest() + + +def sha256_file(path: Path) -> str: + return sha256_bytes(path.read_bytes()) + + +def package_files() -> list[Path]: + files = [ + ROOT / "dialbug.wsc", + ROOT / "README.md", + ROOT / "CREDITS.md", + ROOT / "COPYING", + ROOT / "THIRD_PARTY_NOTICES.md", + ROOT / "Makefile", + ROOT / "wfconfig.toml", + ROOT / "scripts" / "verify_release.py", + ROOT / "scripts" / "package_release.py", + ROOT / "scripts" / "build_interface_art.py", + ROOT / "scripts" / "normalize_wfprocess_c.py", + ROOT / "release" / "RELEASE_NOTES.md", + ROOT / "release" / "HARDWARE_TEST.md", + ROOT / "release" / "LICENSE_STATUS.md", + ROOT / "release" / "verification-report.json", + ROOT / "release" / "playtest-plan.json", + ROOT / "release" / "swansong-playtest-report.json", + ROOT / "release" / "swansong-final-frame.png", + ROOT / "release" / "battery-glow-mednafen-proof.wav", + ] + files.extend(sorted((ROOT / "src").glob("*.[ch]"))) + files.extend(sorted(path for path in (ROOT / "assets").rglob("*") if path.is_file())) + files.extend(sorted(path for path in (ROOT / "music").rglob("*") if path.is_file())) + files.extend(sorted((ROOT / "release" / "plans").glob("*.json"))) + files.extend(sorted((ROOT / "release" / "tracks").glob("*"))) + missing = [path for path in files if not path.is_file()] + if missing: + raise SystemExit("missing release inputs: " + ", ".join(map(str, missing))) + return sorted(set(files), key=lambda path: path.relative_to(ROOT).as_posix()) + + +def main() -> int: + verification = json.loads( + (ROOT / "release" / "verification-report.json").read_text(encoding="utf-8") + ) + if verification.get("status") != "pass": + raise SystemExit("verification-report.json does not pass") + current_rom_hash = sha256_file(ROM_SOURCE) + if current_rom_hash != verification.get("rom", {}).get("sha256"): + raise SystemExit("ROM changed after release verification") + + files = package_files() + manifest = { + "schema": "dialbug-package-manifest-v1", + "release": RELEASE_VERSION, + "license": LICENSE_ID, + "publicDistributionAuthorized": True, + "correspondingSourceIncluded": True, + "files": [ + { + "path": path.relative_to(ROOT).as_posix(), + "byteCount": path.stat().st_size, + "sha256": sha256_file(path), + } + for path in files + ], + } + manifest_data = (json.dumps(manifest, indent=2, sort_keys=True) + "\n").encode() + + DIST.mkdir(parents=True, exist_ok=True) + rom_output = DIST / f"{NAME}.wsc" + archive_output = DIST / f"{NAME}.zip" + manifest_output = DIST / f"{NAME}.manifest.json" + temporary_archive = DIST / f".{NAME}.zip.tmp" + + shutil.copyfile(ROM_SOURCE, rom_output) + manifest_output.write_bytes(manifest_data) + with zipfile.ZipFile( + temporary_archive, "w", compression=zipfile.ZIP_DEFLATED, compresslevel=9 + ) as archive: + for path in files: + relative = path.relative_to(ROOT).as_posix() + info = zipfile.ZipInfo(f"{NAME}/{relative}", (1980, 1, 1, 0, 0, 0)) + info.compress_type = zipfile.ZIP_DEFLATED + info.external_attr = 0o100644 << 16 + archive.writestr(info, path.read_bytes()) + info = zipfile.ZipInfo(f"{NAME}/SHA256SUMS.json", (1980, 1, 1, 0, 0, 0)) + info.compress_type = zipfile.ZIP_DEFLATED + info.external_attr = 0o100644 << 16 + archive.writestr(info, manifest_data) + temporary_archive.replace(archive_output) + + result = { + "rom": { + "path": str(rom_output.relative_to(ROOT)), + "byteCount": rom_output.stat().st_size, + "sha256": sha256_file(rom_output), + }, + "archive": { + "path": str(archive_output.relative_to(ROOT)), + "byteCount": archive_output.stat().st_size, + "sha256": sha256_file(archive_output), + }, + "manifest": { + "path": str(manifest_output.relative_to(ROOT)), + "byteCount": manifest_output.stat().st_size, + "sha256": sha256_file(manifest_output), + }, + } + print(json.dumps(result, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/homebrew/dialbug/scripts/verify_release.py b/homebrew/dialbug/scripts/verify_release.py new file mode 100644 index 0000000..4badc0f --- /dev/null +++ b/homebrew/dialbug/scripts/verify_release.py @@ -0,0 +1,351 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2026 Regionally Famous contributors +"""Validate the Dialbug ROM, emulator evidence, and audio proof.""" + +from __future__ import annotations + +import argparse +from array import array +import hashlib +import json +import math +from pathlib import Path +import struct +import wave + + +ROOT = Path(__file__).resolve().parents[1] +ROM = ROOT / "dialbug.wsc" +RELEASE = ROOT / "release" +WAV = RELEASE / "battery-glow-mednafen-proof.wav" +ALL_REPORT = RELEASE / "swansong-playtest-report.json" +ALL_PLAN = RELEASE / "playtest-plan.json" +OUTPUT = RELEASE / "verification-report.json" +INTERFACE_MASTER = ROOT / "assets/source-art/dialbug-sd-mobile-suit-imagegen-v5.png" +INTERFACE_RUNTIME = ROOT / "assets/runtime/dialbug-sd-mascot-v5.png" +INTERFACE_MASTER_SHA256 = ( + "228164e1875b03bd006ee8c6f64f48f205874facb3fce5f486e7c9cac6d5cf18" +) + +SONGS = ( + ("BATTERY GLOW", 148), + ("NEON RAINTRACE", 132), + ("SOFT RESET SUNRISE", 106), + ("LAST SAVE POINT", 164), + ("SIGNAL BLOOM", 140), +) +STEPS_PER_LOOP = 8 * 16 + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with path.open("rb") as handle: + for chunk in iter(lambda: handle.read(1024 * 1024), b""): + digest.update(chunk) + return digest.hexdigest() + + +def png_size(path: Path) -> tuple[int, int]: + data = path.read_bytes() + if len(data) < 24 or data[:8] != b"\x89PNG\r\n\x1a\n": + raise ValueError(f"not a PNG: {path}") + return struct.unpack(">II", data[16:24]) + + +def correlation(values: list[float], lag: int, start: int) -> float: + left = values[start : len(values) - lag] + right = values[start + lag :] + if len(left) < 100: + return 0.0 + left_mean = sum(left) / len(left) + right_mean = sum(right) / len(right) + numerator = sum( + (x - left_mean) * (y - right_mean) for x, y in zip(left, right) + ) + left_power = sum((x - left_mean) ** 2 for x in left) + right_power = sum((y - right_mean) ** 2 for y in right) + denominator = math.sqrt(left_power * right_power) + return numerator / denominator if denominator else 0.0 + + +def inspect_audio(path: Path, bpm: int) -> dict[str, object]: + with wave.open(str(path), "rb") as wav: + channels = wav.getnchannels() + sample_rate = wav.getframerate() + sample_width = wav.getsampwidth() + frame_count = wav.getnframes() + raw = wav.readframes(frame_count) + + if channels != 2 or sample_rate != 48_000 or sample_width != 2: + raise ValueError("audio proof must be 16-bit stereo PCM at 48 kHz") + + samples = array("h") + samples.frombytes(raw) + if not samples: + raise ValueError("audio proof is empty") + + peak = max(abs(value) for value in samples) / 32768.0 + rms = math.sqrt(sum(value * value for value in samples) / len(samples)) / 32768.0 + dc_offset = (sum(samples) / len(samples)) / 32768.0 + duration = frame_count / sample_rate + + # The sequencer's 16th-note step is exactly 15/BPM seconds on the default + # 40,704-clock frame. Compare 10 ms RMS-envelope windows so oscillator + # phase does not hide a correctly repeating musical pattern. + expected_period = STEPS_PER_LOOP * 15.0 / bpm + window_frames = sample_rate // 100 + envelope: list[float] = [] + stride = window_frames * channels + for offset in range(0, len(samples), stride): + window = samples[offset : offset + stride] + if not window: + continue + envelope.append(math.sqrt(sum(v * v for v in window) / len(window))) + + window_seconds = window_frames / sample_rate + low_lag = int((expected_period - 0.55) / window_seconds) + high_lag = int((expected_period + 0.55) / window_seconds) + start = int(1.0 / window_seconds) + candidates = ( + (correlation(envelope, lag, start), lag) + for lag in range(low_lag, high_lag + 1) + ) + loop_correlation, best_lag = max(candidates) + measured_period = best_lag * window_seconds + + if duration < expected_period * 2.25: + raise ValueError("audio proof does not contain at least two complete loops") + if peak <= 0.001 or peak >= 0.99: + raise ValueError(f"audio peak is implausible or clipping: {peak:.6f}") + if rms <= 0.001: + raise ValueError(f"audio proof is effectively silent: RMS {rms:.6f}") + if abs(measured_period - expected_period) > 0.03: + raise ValueError( + f"measured loop {measured_period:.3f}s differs from expected " + f"{expected_period:.3f}s" + ) + if loop_correlation < 0.80: + raise ValueError(f"loop-envelope correlation is too weak: {loop_correlation:.3f}") + + return { + "path": str(path.relative_to(ROOT)), + "sha256": sha256(path), + "byteCount": path.stat().st_size, + "channels": channels, + "sampleRate": sample_rate, + "bitsPerSample": sample_width * 8, + "sampleFrames": frame_count, + "durationSeconds": round(duration, 6), + "peakAbsoluteSample": round(peak, 8), + "peakDBFS": round(20.0 * math.log10(peak), 6), + "rms": round(rms, 8), + "rmsDBFS": round(20.0 * math.log10(rms), 6), + "dcOffset": round(dc_offset, 8), + "expectedLoopSeconds": round(expected_period, 6), + "measuredLoopSeconds": round(measured_period, 6), + "loopPeriodErrorSeconds": round(measured_period - expected_period, 6), + "loopEnvelopeCorrelation": round(loop_correlation, 6), + } + + +def inspect_rom(path: Path) -> dict[str, object]: + data = path.read_bytes() + if len(data) < 65_536 or len(data) > 16 * 1024 * 1024: + raise ValueError("ROM size is outside Swan Song's supported range") + if len(data) % 65_536: + raise ValueError("ROM is not a whole number of 64 KiB banks") + recorded_checksum = int.from_bytes(data[-2:], "little") + real_checksum = sum(data[:-2]) & 0xFFFF + if recorded_checksum != real_checksum: + raise ValueError( + f"ROM checksum mismatch: {recorded_checksum:04x} != {real_checksum:04x}" + ) + return { + "path": str(path.relative_to(ROOT)), + "sha256": sha256(path), + "byteCount": len(data), + "bankCount": len(data) // 65_536, + "recordedChecksum": recorded_checksum, + "realChecksum": real_checksum, + "footerHex": data[-16:].hex(), + } + + +def inspect_interface_art() -> dict[str, object]: + master_size = png_size(INTERFACE_MASTER) + runtime_size = png_size(INTERFACE_RUNTIME) + master_hash = sha256(INTERFACE_MASTER) + if master_hash != INTERFACE_MASTER_SHA256: + raise ValueError("ImageGen interface master changed without provenance review") + if master_size != (1254, 1254): + raise ValueError(f"unexpected interface master dimensions: {master_size}") + if runtime_size != (72, 64): + raise ValueError(f"runtime mascot is not 9x8 tiles: {runtime_size}") + return { + "generator": "OpenAI ImageGen built-in tool", + "mode": "edit/reference-guided-generation", + "master": { + "path": str(INTERFACE_MASTER.relative_to(ROOT)), + "sha256": master_hash, + "width": master_size[0], + "height": master_size[1], + }, + "runtimeDerivative": { + "path": str(INTERFACE_RUNTIME.relative_to(ROOT)), + "sha256": sha256(INTERFACE_RUNTIME), + "width": runtime_size[0], + "height": runtime_size[1], + "tileWidth": runtime_size[0] // 8, + "tileHeight": runtime_size[1] // 8, + }, + } + + +def inspect_swansong(rom_sha256: str) -> dict[str, object]: + reports = [] + final_audio_hashes = set() + for song_index, (title, bpm) in enumerate(SONGS, start=1): + report_path = RELEASE / "tracks" / f"song-{song_index}-report.json" + frame_path = RELEASE / "tracks" / f"song-{song_index}-frame.png" + report = json.loads(report_path.read_text(encoding="utf-8")) + if report.get("schema") != "swan-song-playtest-report-v1": + raise ValueError(f"unexpected Swan Song report schema: {report_path}") + if report.get("romSHA256") != rom_sha256: + raise ValueError(f"Swan Song report is bound to a different ROM: {report_path}") + audio = report.get("audio", {}) + if audio.get("nonzeroSamples", 0) <= 0: + raise ValueError(f"Swan Song reported silent audio: {report_path}") + if not 0.001 < audio.get("peakAbsoluteSample", 0) < 0.99: + raise ValueError(f"Swan Song audio peak failed: {report_path}") + width, height = png_size(frame_path) + if (width, height) != (report.get("captureWidth"), report.get("captureHeight")): + raise ValueError(f"capture dimensions disagree with report: {frame_path}") + if sha256(frame_path) != report.get("capturePNG_SHA256"): + raise ValueError(f"capture hash disagrees with report: {frame_path}") + final_audio_hashes.add(audio["finalWindowWAVSHA256"]) + reports.append( + { + "songIndex": song_index, + "title": title, + "bpm": bpm, + "report": str(report_path.relative_to(ROOT)), + "capture": str(frame_path.relative_to(ROOT)), + "captureSHA256": report["capturePNG_SHA256"], + "audioSampleFrames": audio["sampleFrames"], + "audioNonzeroSamples": audio["nonzeroSamples"], + "audioPeakAbsoluteSample": audio["peakAbsoluteSample"], + "finalWindowWAVSHA256": audio["finalWindowWAVSHA256"], + } + ) + if len(final_audio_hashes) != len(SONGS): + raise ValueError("per-song final audio windows are not distinct") + + all_report = json.loads(ALL_REPORT.read_text(encoding="utf-8")) + all_plan = json.loads(ALL_PLAN.read_text(encoding="utf-8")) + if all_report.get("romSHA256") != rom_sha256: + raise ValueError("all-controls Swan Song report is bound to a different ROM") + if all_plan.get("schema") != "swan-song-frame-input-plan-v1": + raise ValueError("all-controls input plan has an unexpected schema") + expected_transitions = len(all_plan.get("events", [])) + if all_report.get("plan") != all_plan: + raise ValueError("all-controls Swan Song report does not contain the release input plan") + if all_report.get("scheduledInputTransitions") != expected_transitions: + raise ValueError("all-controls input plan did not execute every transition") + if all_report.get("audio", {}).get("nonzeroSamples", 0) <= 0: + raise ValueError("all-controls Swan Song report has no audio") + + return { + "engineBackend": all_report["engineBackend"], + "engineBuildID": all_report["engineBuildID"], + "hardwareModel": all_report["hardwareModel"], + "openIPLIdentifier": all_report["openIPLIdentifier"], + "allControlsReport": str(ALL_REPORT.relative_to(ROOT)), + "scheduledInputTransitions": all_report["scheduledInputTransitions"], + "scheduledInputFrames": all_report["scheduledInputFrames"], + "songs": reports, + } + + +def source_facts() -> list[dict[str, object]]: + paths = [ + ROOT / "COPYING", + ROOT / "THIRD_PARTY_NOTICES.md", + ROOT / "CREDITS.md", + ROOT / "README.md", + ROOT / "Makefile", + ROOT / "wfconfig.toml", + ROOT / "scripts" / "build_interface_art.py", + ROOT / "scripts" / "normalize_wfprocess_c.py", + *sorted((ROOT / "src").glob("*.[ch]")), + *sorted(path for path in (ROOT / "assets").rglob("*") if path.is_file()), + *sorted(path for path in (ROOT / "music").rglob("*") if path.is_file()), + ] + return [ + { + "path": str(path.relative_to(ROOT)), + "sha256": sha256(path), + "byteCount": path.stat().st_size, + } + for path in paths + ] + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--output", type=Path, default=OUTPUT) + args = parser.parse_args() + + rom = inspect_rom(ROM) + swansong = inspect_swansong(str(rom["sha256"])) + mednafen = inspect_audio(WAV, SONGS[0][1]) + report = { + "schema": "dialbug-release-verification-v1", + "status": "pass", + "release": "0.1.0", + "rom": rom, + "soundtrack": { + "songCount": len(SONGS), + "stepsPerLoop": STEPS_PER_LOOP, + "songs": [ + {"index": index, "title": title, "bpm": bpm} + for index, (title, bpm) in enumerate(SONGS, start=1) + ], + }, + "interfaceArt": inspect_interface_art(), + "swansong": swansong, + "mednafenAudio": mednafen, + "sourceFiles": source_facts(), + "physicalHardware": { + "status": "pending", + "releaseImpact": "Does not block the emulator-qualified 0.1.0 release.", + "claim": "No physical WonderSwan-family or flash-cartridge compatibility claim is made.", + }, + "licensing": { + "status": "authorized", + "license": "GPL-3.0-or-later", + "publicDistributionAuthorized": True, + "correspondingSourceIncluded": True, + "linkedLibraries": [ + { + "component": "Wonderful target-wswan-syslibs", + "license": "Zlib", + "notice": "THIRD_PARTY_NOTICES.md", + }, + { + "component": "Wonderful IA-16 GCC runtime", + "license": "GPL-3.0-or-later WITH GCC-exception-3.1", + "notice": "THIRD_PARTY_NOTICES.md", + }, + ], + }, + } + output = args.output.resolve() + output.parent.mkdir(parents=True, exist_ok=True) + output.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n", encoding="utf-8") + print(json.dumps(report, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/homebrew/dialbug/src/main.c b/homebrew/dialbug/src/main.c new file mode 100644 index 0000000..30092f5 --- /dev/null +++ b/homebrew/dialbug/src/main.c @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (C) 2026 Regionally Famous contributors + +#include +#include +#include +#include +#include +#include +#include + +#include "runtime/dialbug.h" +#include "music.h" + +WSE_RESERVE_TILES(512, 0); + +enum { + PAL_BODY = 0, + PAL_TITLE = 1, + PAL_ACCENT = 2, + PAL_GOOD = 3, + PAL_WARN = 4, + PAL_DIM = 5, + PAL_MASCOT = 6, + PAL_HEADER = 8 +}; + +static uint16_t previous_keys; +static uint8_t ui_frame; + +static void set_palette(uint8_t index, uint16_t background, uint16_t foreground) { + uint16_t *palette = WS_SCREEN_COLOR_MEM(index); + palette[0] = background; + palette[1] = foreground; + palette[2] = foreground; + palette[3] = foreground; +} + +static void put_char(uint8_t x, uint8_t y, char value, uint8_t palette) { + uint16_t tile; + if (x >= 28 || y >= 18) return; + /* wsx_console_init_default installs printable ASCII 0x20..0x7f at tiles + * 0x1a0..0x1ff. The console cursor is intentionally bypassed so the live + * player can update individual cells without scrolling. */ + if ((uint8_t)value < 0x20 || (uint8_t)value > 0x7f) value = '?'; + tile = (uint16_t)(0x1a0u + (uint8_t)value - 0x20u); + wse_screen1.row[y].cell[x] = WS_SCREEN_ATTR_TILE(tile) | + WS_SCREEN_ATTR_PALETTE(palette); +} + +static void put_text(uint8_t x, uint8_t y, const char *text, uint8_t palette) { + while (*text && x < 28) put_char(x++, y, *text++, palette); +} + +static void put_far_text(uint8_t x, uint8_t y, const char __far *text, + uint8_t width, uint8_t palette) { + uint8_t count = 0; + while (*text && count < width && x < 28) { + put_char(x++, y, *text++, palette); + count++; + } + while (count++ < width && x < 28) put_char(x++, y, ' ', palette); +} + +static void put_u8(uint8_t x, uint8_t y, uint8_t value, uint8_t width, uint8_t palette) { + uint8_t divisor = width == 3 ? 100 : (width == 2 ? 10 : 1); + bool started = false; + while (divisor) { + uint8_t digit = value / divisor; + value = (uint8_t)(value % divisor); + if (digit || started || divisor == 1) { + put_char(x, y, (char)('0' + digit), palette); + started = true; + } else { + put_char(x, y, ' ', palette); + } + x++; + divisor = (uint8_t)(divisor / 10); + } +} + +static void fill_row(uint8_t y, char value, uint8_t palette) { + uint8_t x; + for (x = 0; x < 28; x++) put_char(x, y, value, palette); +} + +static void load_mascot(void) { + uint16_t *palette = WS_SCREEN_COLOR_MEM(PAL_MASCOT); + memcpy(WS_TILE_MEM(0), gfx_dialbug_mascot_tiles, gfx_dialbug_mascot_tiles_size); + memcpy(palette, gfx_dialbug_mascot_palette, gfx_dialbug_mascot_palette_size); + ws_screen_put_tiles(&wse_screen1, gfx_dialbug_mascot_map, 0, 2, 9, 8); +} + +static void draw_static_ui(void) { + uint8_t y; + for (y = 0; y < 18; y++) fill_row(y, ' ', PAL_BODY); + fill_row(0, ' ', PAL_HEADER); + put_text(1, 0, "DIALBUG // POCKET MIX", PAL_HEADER); + put_text(23, 0, "WSC", PAL_HEADER); + fill_row(1, '=', PAL_DIM); + put_text(1, 1, ":: FOUR-CHANNEL MIXER ::", PAL_ACCENT); + + put_text(10, 2, "TRACK / ", PAL_DIM); + put_text(10, 5, "LOOP [ ]", PAL_DIM); + put_text(18, 6, "BPM", PAL_DIM); + put_text(10, 7, "SPD", PAL_DIM); + put_text(20, 7, "VOL", PAL_DIM); + put_text(10, 8, "LIVE MIX", PAL_ACCENT); + put_text(10, 9, "o o o o o o o o o", PAL_DIM); + + fill_row(10, '-', PAL_DIM); + for (y = 0; y < DIALBUG_CHANNEL_COUNT; y++) { + put_char(0, (uint8_t)(10 + y), (char)('1' + y), PAL_TITLE); + put_char(1, (uint8_t)(10 + y), '|', PAL_DIM); + put_char(27, (uint8_t)(10 + y), '|', PAL_DIM); + } + fill_row(14, '=', PAL_DIM); + put_text(1, 15, "A PAUSE B RESTART", PAL_BODY); + put_text(1, 16, "X < > SONG ^ v VOL", PAL_BODY); + put_text(1, 17, "START SPEED Y1-4 MUTE", PAL_DIM); +} + +static void draw_note(uint8_t x, uint8_t y, uint8_t note, uint8_t palette) { + static const char names[12][2] = { + { 'C', ' ' }, { 'C', '#' }, { 'D', ' ' }, { 'D', '#' }, + { 'E', ' ' }, { 'F', ' ' }, { 'F', '#' }, { 'G', ' ' }, + { 'G', '#' }, { 'A', ' ' }, { 'A', '#' }, { 'B', ' ' } + }; + uint8_t index; + uint8_t octave; + if (note == DIALBUG_NOTE_NONE || note == DIALBUG_NOTE_OFF) { + put_text(x, y, "---", palette); + return; + } + index = (uint8_t)((note - 1) % 12); + octave = (uint8_t)(((note - 1) / 12) + 2); + put_char(x, y, names[index][0], palette); + put_char((uint8_t)(x + 1), y, names[index][1], palette); + put_char((uint8_t)(x + 2), y, (char)('0' + octave), palette); +} + +static void draw_meter(uint8_t x, uint8_t y, uint8_t level, bool muted) { + uint8_t i; + uint8_t filled = (uint8_t)(((uint16_t)level * 12u + 14u) / 15u); + for (i = 0; i < 12; i++) { + put_char((uint8_t)(x + i), y, i < filled ? '#' : '.', + muted ? PAL_WARN : PAL_GOOD); + } +} + +static void draw_dynamic_ui(void) { + const dialbug_song_t __far *song = dialbug_music_song(); + uint16_t step = dialbug_music_step(); + uint16_t total = dialbug_music_total_steps(); + uint8_t progress = total ? (uint8_t)((step * 10u) / total) : 0; + uint8_t i; + + put_u8(16, 2, (uint8_t)(dialbug_music_song_index() + 1), 2, PAL_ACCENT); + put_u8(21, 2, dialbug_song_count, 2, PAL_DIM); + put_far_text(10, 3, song->title, 18, PAL_TITLE); + put_far_text(10, 4, song->subtitle, 18, PAL_DIM); + + for (i = 0; i < 10; i++) { + put_char((uint8_t)(16 + i), 5, i < progress ? '=' : '-', + i < progress ? PAL_GOOD : PAL_DIM); + } + put_text(10, 6, dialbug_music_is_paused() ? "PAUSED " : "PLAYING", + dialbug_music_is_paused() ? PAL_WARN : PAL_GOOD); + put_u8(22, 6, (uint8_t)song->bpm, 3, PAL_BODY); + put_u8(14, 7, dialbug_music_speed_percent(), 3, PAL_BODY); + put_char(17, 7, '%', PAL_BODY); + put_u8(24, 7, dialbug_music_master_volume(), 1, PAL_BODY); + put_text(10, 9, "o o o o o o o o o", PAL_DIM); + put_char((uint8_t)(10 + ((ui_frame >> 3) & 7)), 9, '*', PAL_ACCENT); + + for (i = 0; i < DIALBUG_CHANNEL_COUNT; i++) { + uint8_t y = (uint8_t)(10 + i); + bool muted = dialbug_music_is_muted(i); + put_far_text(3, y, + dialbug_music_instrument_name(dialbug_music_channel_instrument(i)), 6, + muted ? PAL_WARN : PAL_BODY); + draw_note(9, y, dialbug_music_channel_note(i), muted ? PAL_WARN : PAL_BODY); + draw_meter(13, y, dialbug_music_channel_level(i), muted); + put_char(26, y, muted ? 'M' : ' ', muted ? PAL_WARN : PAL_BODY); + } +} + +static void handle_input(void) { + uint16_t keys = ws_keypad_scan(); + uint16_t pressed = keys & (uint16_t)~previous_keys; + uint8_t song = dialbug_music_song_index(); + uint8_t volume = dialbug_music_master_volume(); + + if (pressed & WS_KEY_A) dialbug_music_toggle_pause(); + if (pressed & WS_KEY_B) dialbug_music_restart(); + if (pressed & WS_KEY_X4) { + dialbug_music_select(song ? (uint8_t)(song - 1) : (uint8_t)(dialbug_song_count - 1)); + } + if (pressed & WS_KEY_X2) dialbug_music_select((uint8_t)((song + 1) % dialbug_song_count)); + if ((pressed & WS_KEY_X1) && volume < 8) dialbug_music_set_master_volume((uint8_t)(volume + 1)); + if ((pressed & WS_KEY_X3) && volume > 0) dialbug_music_set_master_volume((uint8_t)(volume - 1)); + if (pressed & WS_KEY_START) { + dialbug_music_set_speed_index((uint8_t)(dialbug_music_speed_index() + 1)); + } + if (pressed & WS_KEY_Y1) dialbug_music_toggle_mute(0); + if (pressed & WS_KEY_Y2) dialbug_music_toggle_mute(1); + if (pressed & WS_KEY_Y3) dialbug_music_toggle_mute(2); + if (pressed & WS_KEY_Y4) dialbug_music_toggle_mute(3); + previous_keys = keys; +} + +void main(void) { + ws_display_set_control(0); + ws_system_set_mode(WS_MODE_COLOR); + wsx_console_init_default(&wse_screen1); + ws_display_set_screen_addresses(&wse_screen1, &wse_screen2); + ws_display_scroll_screen1_to(0, 0); + + set_palette(PAL_BODY, WS_RGB(0, 1, 3), WS_RGB(10, 13, 15)); + set_palette(PAL_TITLE, WS_RGB(0, 1, 3), WS_RGB(15, 10, 3)); + set_palette(PAL_ACCENT, WS_RGB(0, 1, 3), WS_RGB(3, 14, 15)); + set_palette(PAL_GOOD, WS_RGB(0, 1, 3), WS_RGB(2, 14, 15)); + set_palette(PAL_WARN, WS_RGB(0, 1, 3), WS_RGB(15, 4, 6)); + set_palette(PAL_DIM, WS_RGB(0, 1, 3), WS_RGB(6, 8, 11)); + set_palette(PAL_HEADER, WS_RGB(15, 10, 2), WS_RGB(0, 1, 3)); + + draw_static_ui(); + load_mascot(); + dialbug_music_init(); + draw_dynamic_ui(); + ws_display_set_control(WS_DISPLAY_CTRL_SCR1_ENABLE); + + ws_int_set_default_handler_vblank(); + ws_int_enable(WS_INT_ENABLE_VBLANK); + ia16_enable_irq(); + + while (1) { + ia16_halt(); + handle_input(); + dialbug_music_update(); + if (!(++ui_frame & 3)) draw_dynamic_ui(); + } +} diff --git a/homebrew/dialbug/src/music.c b/homebrew/dialbug/src/music.c new file mode 100644 index 0000000..b302698 --- /dev/null +++ b/homebrew/dialbug/src/music.c @@ -0,0 +1,446 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (C) 2026 Regionally Famous contributors + +#include +#include +#include +#include + +#include "music.h" + +enum { + WAVE_SQUARE = 0, + WAVE_PULSE, + WAVE_TRIANGLE, + WAVE_SAW, + WAVE_SINE +}; + +enum { + INST_FLAG_NONE = 0, + INST_FLAG_NOISE = 1, + INST_FLAG_ARP_MINOR = 2, + INST_FLAG_ARP_MAJOR = 4, + INST_FLAG_SWEEP = 8 +}; + +enum { + ENV_OFF = 0, + ENV_ATTACK, + ENV_DECAY, + ENV_SUSTAIN, + ENV_RELEASE +}; + +typedef struct { + char name[7]; + uint8_t wave; + uint8_t attack_rate; + uint8_t decay_rate; + uint8_t sustain; + uint8_t release_rate; + uint8_t pan_left; + uint8_t pan_right; + uint8_t vibrato_depth; + uint8_t vibrato_speed; + int8_t pitch_slide; + uint8_t noise_mode; + uint8_t flags; +} dialbug_instrument_t; + +typedef struct { + uint8_t note; + uint8_t instrument; + uint8_t event_volume; + uint8_t gate_rows; + uint8_t env_stage; + uint8_t env_level; + uint8_t frame; + uint8_t meter; + uint16_t base_frequency; +} dialbug_voice_t; + +static const dialbug_instrument_t __far instruments[DIALBUG_INSTRUMENT_COUNT] = { + { "LEAD", WAVE_SQUARE, 96, 5, 190, 18, 15, 10, 3, 3, 0, 0, INST_FLAG_NONE }, + { "PULSE", WAVE_PULSE, 128, 8, 155, 24, 9, 15, 2, 4, 0, 0, INST_FLAG_NONE }, + { "BASS", WAVE_TRIANGLE, 72, 3, 205, 12, 12, 12, 0, 0, 0, 0, INST_FLAG_NONE }, + { "MINARP",WAVE_PULSE, 160, 9, 135, 32, 8, 15, 0, 0, 0, 0, INST_FLAG_ARP_MINOR }, + { "MAJARP",WAVE_PULSE, 160, 9, 135, 32, 15, 8, 0, 0, 0, 0, INST_FLAG_ARP_MAJOR }, + { "BELL", WAVE_SINE, 255, 7, 90, 14, 15, 13, 3, 5, 0, 0, INST_FLAG_NONE }, + { "PAD", WAVE_TRIANGLE, 28, 2, 175, 7, 11, 15, 2, 6, 0, 0, INST_FLAG_NONE }, + { "KICK", WAVE_TRIANGLE,255,18, 65, 35, 15, 15, 0, 0, -11, 0, INST_FLAG_NONE }, + { "SNARE", WAVE_SQUARE, 255,20, 55, 42, 15, 15, 0, 0, 0, + WS_SOUND_NOISE_CTRL_LENGTH_32767 | WS_SOUND_NOISE_CTRL_TAP_14, INST_FLAG_NOISE }, + { "HAT", WAVE_SQUARE, 255,32, 25, 70, 11, 15, 0, 0, 0, + WS_SOUND_NOISE_CTRL_LENGTH_73 | WS_SOUND_NOISE_CTRL_TAP_8, INST_FLAG_NOISE }, + { "SAW", WAVE_SAW, 88, 7, 165, 18, 15, 11, 4, 3, 0, 0, INST_FLAG_NONE }, + { "PLUCK", WAVE_SQUARE, 255,16, 70, 30, 9, 15, 1, 4, 0, 0, INST_FLAG_NONE }, + /* On channel 3, pitch_slide is the signed hardware sweep amount and + * noise_mode is the 375 Hz sweep interval minus one. */ + { "SWEEP", WAVE_SINE, 192, 9, 96, 28, 15, 12, 0, 0, 2, 23, INST_FLAG_SWEEP } +}; + +/* Rounded equal-tempered note frequencies from C2 through C7. */ +static const uint16_t __far note_hz[] = { + 0, + 65, 69, 73, 78, 82, 87, 92, 98, 104, 110, 117, 123, + 131, 139, 147, 156, 165, 175, 185, 196, 208, 220, 233, 247, + 262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494, + 523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988, + 1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1976, + 2093 +}; + +static const uint8_t speed_percentages[] = { 50, 75, 100, 125, 150 }; +static const uint8_t freq_ports[DIALBUG_CHANNEL_COUNT] = { + WS_SOUND_FREQ_CH1_PORT, WS_SOUND_FREQ_CH2_PORT, + WS_SOUND_FREQ_CH3_PORT, WS_SOUND_FREQ_CH4_PORT +}; +static const uint8_t volume_ports[DIALBUG_CHANNEL_COUNT] = { + WS_SOUND_VOL_CH1_PORT, WS_SOUND_VOL_CH2_PORT, + WS_SOUND_VOL_CH3_PORT, WS_SOUND_VOL_CH4_PORT +}; + +static dialbug_voice_t voices[DIALBUG_CHANNEL_COUNT]; +static uint8_t current_song; +static uint8_t current_order; +static uint8_t current_row; +static uint8_t master_volume = 6; +static uint8_t speed_index = 2; +static uint8_t mute_mask; +static bool paused; +static uint32_t tempo_accumulator; + +static uint16_t note_to_frequency(uint8_t note) { + if (note == DIALBUG_NOTE_NONE || note == DIALBUG_NOTE_OFF || + note >= (uint8_t)(sizeof(note_hz) / sizeof(note_hz[0]))) { + return 0; + } + return WS_SOUND_WAVE_HZ_TO_FREQ(note_hz[note], 32); +} + +static void fill_wave(uint8_t wave, uint8_t samples[32]) { + static const uint8_t sine[32] = { + 8, 9, 11, 12, 13, 14, 15, 15, + 15, 15, 14, 13, 12, 11, 9, 8, + 7, 5, 4, 3, 2, 1, 0, 0, + 0, 0, 1, 2, 3, 4, 5, 7 + }; + uint8_t i; + + switch (wave) { + case WAVE_PULSE: + for (i = 0; i < 24; i++) samples[i] = 0; + for (; i < 32; i++) samples[i] = 15; + break; + case WAVE_TRIANGLE: + for (i = 0; i < 16; i++) samples[i] = i; + for (; i < 32; i++) samples[i] = (uint8_t)(31 - i); + break; + case WAVE_SAW: + for (i = 0; i < 32; i++) samples[i] = (uint8_t)(i & 15); + break; + case WAVE_SINE: + for (i = 0; i < 32; i++) samples[i] = sine[i]; + break; + case WAVE_SQUARE: + default: + for (i = 0; i < 16; i++) samples[i] = 0; + for (; i < 32; i++) samples[i] = 15; + break; + } +} + +static void set_channel_wave(uint8_t channel, uint8_t wave) { + uint8_t samples[32]; + uint8_t i; + fill_wave(wave, samples); + for (i = 0; i < 16; i++) { + wse_wavetable1.wave[channel].data[i] = + (uint8_t)((samples[i * 2] & 15) | ((samples[i * 2 + 1] & 15) << 4)); + } +} + +static void update_channel_control(void) { + uint8_t control = WS_SOUND_CH_CTRL_CH1_ENABLE | + WS_SOUND_CH_CTRL_CH2_ENABLE | + WS_SOUND_CH_CTRL_CH3_ENABLE | + WS_SOUND_CH_CTRL_CH4_ENABLE; + if (instruments[voices[3].instrument].flags & INST_FLAG_NOISE) { + control |= WS_SOUND_CH_CTRL_CH4_NOISE; + } + if (instruments[voices[2].instrument].flags & INST_FLAG_SWEEP) { + control |= WS_SOUND_CH_CTRL_CH3_SWEEP; + } + outportb(WS_SOUND_CH_CTRL_PORT, control); +} + +static void release_voice(dialbug_voice_t *voice) { + if (voice->env_stage != ENV_OFF) voice->env_stage = ENV_RELEASE; +} + +static void trigger_voice(uint8_t channel, const dialbug_event_t __far *event) { + dialbug_voice_t *voice = &voices[channel]; + const dialbug_instrument_t __far *instrument; + + if (event->note == DIALBUG_NOTE_OFF) { + release_voice(voice); + return; + } + if (event->note == DIALBUG_NOTE_NONE || event->instrument >= DIALBUG_INSTRUMENT_COUNT) return; + + voice->note = event->note; + voice->instrument = event->instrument; + voice->event_volume = event->volume > 15 ? 15 : event->volume; + voice->gate_rows = event->gate_rows; + voice->env_level = 0; + voice->env_stage = ENV_ATTACK; + voice->frame = 0; + voice->base_frequency = note_to_frequency(event->note); + + instrument = &instruments[voice->instrument]; + set_channel_wave(channel, instrument->wave); + outportw(freq_ports[channel], voice->base_frequency); + if (channel == 2) { + if (instrument->flags & INST_FLAG_SWEEP) { + outportb(WS_SOUND_SWEEP_PORT, (uint8_t)instrument->pitch_slide); + outportb(WS_SOUND_SWEEP_TIME_PORT, instrument->noise_mode); + } else { + outportb(WS_SOUND_SWEEP_PORT, 0); + outportb(WS_SOUND_SWEEP_TIME_PORT, 0); + } + update_channel_control(); + } + + if (channel == 3) { + if (instrument->flags & INST_FLAG_NOISE) { + outportb(WS_SOUND_NOISE_CTRL_PORT, + (uint8_t)(WS_SOUND_NOISE_CTRL_ENABLE | + WS_SOUND_NOISE_CTRL_RESET | instrument->noise_mode)); + } else { + outportb(WS_SOUND_NOISE_CTRL_PORT, 0); + } + update_channel_control(); + } +} + +static void process_row(void) { + const dialbug_song_t __far *song = &dialbug_songs[current_song]; + uint8_t pattern_index = song->order[current_order]; + const dialbug_pattern_t __far *pattern = &dialbug_patterns[pattern_index]; + uint8_t channel; + + for (channel = 0; channel < DIALBUG_CHANNEL_COUNT; channel++) { + if (voices[channel].gate_rows) { + voices[channel].gate_rows--; + if (!voices[channel].gate_rows) release_voice(&voices[channel]); + } + trigger_voice(channel, &pattern->row[current_row][channel]); + } +} + +static void advance_row(void) { + const dialbug_song_t __far *song = &dialbug_songs[current_song]; + current_row++; + if (current_row >= DIALBUG_PATTERN_ROWS) { + current_row = 0; + current_order++; + if (current_order >= song->order_length) current_order = 0; + } + process_row(); +} + +static uint16_t voice_frequency(dialbug_voice_t *voice, const dialbug_instrument_t __far *instrument) { + uint16_t frequency = voice->base_frequency; + uint8_t arp_offset = 0; + + if (instrument->flags & (INST_FLAG_ARP_MINOR | INST_FLAG_ARP_MAJOR)) { + uint8_t phase = (uint8_t)((voice->frame >> 2) % 3); + if (phase == 1) { + arp_offset = (instrument->flags & INST_FLAG_ARP_MINOR) ? 3 : 4; + } else if (phase == 2) { + arp_offset = 7; + } + frequency = note_to_frequency((uint8_t)(voice->note + arp_offset)); + } + + if (instrument->vibrato_depth && + (voice->frame & ((1u << instrument->vibrato_speed) - 1u)) >= + (1u << (instrument->vibrato_speed - 1u))) { + frequency = (uint16_t)(frequency + instrument->vibrato_depth); + } + return frequency; +} + +static void update_voice(uint8_t channel) { + dialbug_voice_t *voice = &voices[channel]; + const dialbug_instrument_t __far *instrument = &instruments[voice->instrument]; + uint8_t sustain = instrument->sustain; + uint16_t scaled; + uint8_t level; + uint8_t left; + uint8_t right; + + if (voice->env_stage == ENV_OFF) { + voice->meter = 0; + outportb(volume_ports[channel], 0); + return; + } + + switch (voice->env_stage) { + case ENV_ATTACK: + if ((uint16_t)voice->env_level + instrument->attack_rate >= 255) { + voice->env_level = 255; + voice->env_stage = ENV_DECAY; + } else { + voice->env_level = (uint8_t)(voice->env_level + instrument->attack_rate); + } + break; + case ENV_DECAY: + if (voice->env_level <= (uint8_t)(sustain + instrument->decay_rate)) { + voice->env_level = sustain; + voice->env_stage = ENV_SUSTAIN; + } else { + voice->env_level = (uint8_t)(voice->env_level - instrument->decay_rate); + } + break; + case ENV_RELEASE: + if (voice->env_level <= instrument->release_rate) { + voice->env_level = 0; + voice->env_stage = ENV_OFF; + voice->note = DIALBUG_NOTE_NONE; + } else { + voice->env_level = (uint8_t)(voice->env_level - instrument->release_rate); + } + break; + default: + break; + } + + if (instrument->pitch_slide && !(instrument->flags & INST_FLAG_SWEEP)) { + voice->base_frequency = (uint16_t)(voice->base_frequency + instrument->pitch_slide); + } + if (channel != 2 || !(instrument->flags & INST_FLAG_SWEEP)) { + outportw(freq_ports[channel], voice_frequency(voice, instrument)); + } + + scaled = (uint16_t)(voice->env_level >> 4) * voice->event_volume * master_volume; + level = (uint8_t)(scaled / 120u); + if (level > 15) level = 15; + voice->meter = level; + if (paused || (mute_mask & (1u << channel))) level = 0; + + left = (uint8_t)(((uint16_t)level * instrument->pan_left + 7u) / 15u); + right = (uint8_t)(((uint16_t)level * instrument->pan_right + 7u) / 15u); + outportb(volume_ports[channel], (uint8_t)((left << 4) | right)); + voice->frame++; +} + +void dialbug_music_init(void) { + uint8_t channel; + ws_sound_reset(); + ws_sound_set_wavetable_address(&wse_wavetable1); + outportb(WS_SOUND_OUT_CTRL_PORT, + WS_SOUND_OUT_CTRL_SPEAKER_ENABLE | + WS_SOUND_OUT_CTRL_HEADPHONE_ENABLE | + WS_SOUND_OUT_CTRL_SPEAKER_VOLUME_800); + for (channel = 0; channel < DIALBUG_CHANNEL_COUNT; channel++) { + voices[channel].instrument = DIALBUG_INST_LEAD; + voices[channel].env_stage = ENV_OFF; + set_channel_wave(channel, WAVE_SQUARE); + } + update_channel_control(); + dialbug_music_select(0); +} + +void dialbug_music_update(void) { + const dialbug_song_t __far *song = &dialbug_songs[current_song]; + uint8_t channel; + + if (paused) { + for (channel = 0; channel < DIALBUG_CHANNEL_COUNT; channel++) { + outportb(volume_ports[channel], 0); + } + return; + } + for (channel = 0; channel < DIALBUG_CHANNEL_COUNT; channel++) update_voice(channel); + + /* One default frame is 40,704 clocks at 3.072 MHz (~75.472 Hz). + * A 16th-note step uses the exact reduced accumulator from the HCAT-style + * VBlank sequencer, with an additional percentage speed control. */ + tempo_accumulator += (uint32_t)song->bpm * 106UL * speed_percentages[speed_index]; + while (tempo_accumulator >= 12000000UL) { + tempo_accumulator -= 12000000UL; + advance_row(); + } +} + +void dialbug_music_select(uint8_t song_index) { + uint8_t channel; + if (song_index >= dialbug_song_count) song_index = 0; + current_song = song_index; + current_order = 0; + current_row = 0; + tempo_accumulator = 0; + paused = false; + for (channel = 0; channel < DIALBUG_CHANNEL_COUNT; channel++) { + memset(&voices[channel], 0, sizeof(voices[channel])); + voices[channel].instrument = DIALBUG_INST_LEAD; + outportb(volume_ports[channel], 0); + } + outportb(WS_SOUND_SWEEP_PORT, 0); + outportb(WS_SOUND_SWEEP_TIME_PORT, 0); + update_channel_control(); + process_row(); +} + +void dialbug_music_restart(void) { + dialbug_music_select(current_song); +} + +void dialbug_music_toggle_pause(void) { + paused = !paused; +} + +void dialbug_music_set_master_volume(uint8_t volume) { + master_volume = volume > 8 ? 8 : volume; +} + +void dialbug_music_set_speed_index(uint8_t new_speed_index) { + if (new_speed_index >= (uint8_t)(sizeof(speed_percentages) / sizeof(speed_percentages[0]))) { + new_speed_index = 0; + } + speed_index = new_speed_index; +} + +void dialbug_music_toggle_mute(uint8_t channel) { + if (channel < DIALBUG_CHANNEL_COUNT) mute_mask ^= (uint8_t)(1u << channel); +} + +uint8_t dialbug_music_song_index(void) { return current_song; } +uint8_t dialbug_music_master_volume(void) { return master_volume; } +uint8_t dialbug_music_speed_index(void) { return speed_index; } +uint8_t dialbug_music_speed_percent(void) { return speed_percentages[speed_index]; } +bool dialbug_music_is_paused(void) { return paused; } +bool dialbug_music_is_muted(uint8_t channel) { + return channel < DIALBUG_CHANNEL_COUNT && (mute_mask & (1u << channel)); +} +uint8_t dialbug_music_channel_note(uint8_t channel) { + return channel < DIALBUG_CHANNEL_COUNT ? voices[channel].note : DIALBUG_NOTE_NONE; +} +uint8_t dialbug_music_channel_level(uint8_t channel) { + return channel < DIALBUG_CHANNEL_COUNT ? voices[channel].meter : 0; +} +uint8_t dialbug_music_channel_instrument(uint8_t channel) { + return channel < DIALBUG_CHANNEL_COUNT ? voices[channel].instrument : 0; +} +uint16_t dialbug_music_step(void) { + return (uint16_t)current_order * DIALBUG_PATTERN_ROWS + current_row; +} +uint16_t dialbug_music_total_steps(void) { + return (uint16_t)dialbug_songs[current_song].order_length * DIALBUG_PATTERN_ROWS; +} +const dialbug_song_t __far *dialbug_music_song(void) { return &dialbug_songs[current_song]; } +const char __far *dialbug_music_instrument_name(uint8_t instrument) { + return instruments[instrument < DIALBUG_INSTRUMENT_COUNT ? instrument : 0].name; +} diff --git a/homebrew/dialbug/src/music.h b/homebrew/dialbug/src/music.h new file mode 100644 index 0000000..fa58376 --- /dev/null +++ b/homebrew/dialbug/src/music.h @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (C) 2026 Regionally Famous contributors + +#ifndef HUMMING_CAT_REFRAIN_MUSIC_H +#define HUMMING_CAT_REFRAIN_MUSIC_H + +#include +#include +#include + +#define DIALBUG_CHANNEL_COUNT 4 +#define DIALBUG_PATTERN_ROWS 16 +#define DIALBUG_MAX_ORDER 8 + +#define DIALBUG_NOTE_NONE 0 +#define DIALBUG_NOTE_OFF 255 + +#define DIALBUG_NOTE(octave, semitone) \ + ((uint8_t)((((octave) - 2) * 12) + (semitone) + 1)) +#define C(octave) DIALBUG_NOTE((octave), 0) +#define CS(octave) DIALBUG_NOTE((octave), 1) +#define D(octave) DIALBUG_NOTE((octave), 2) +#define DS(octave) DIALBUG_NOTE((octave), 3) +#define E(octave) DIALBUG_NOTE((octave), 4) +#define F(octave) DIALBUG_NOTE((octave), 5) +#define FS(octave) DIALBUG_NOTE((octave), 6) +#define G(octave) DIALBUG_NOTE((octave), 7) +#define GS(octave) DIALBUG_NOTE((octave), 8) +#define A(octave) DIALBUG_NOTE((octave), 9) +#define AS(octave) DIALBUG_NOTE((octave), 10) +#define B(octave) DIALBUG_NOTE((octave), 11) + +typedef enum { + DIALBUG_INST_LEAD = 0, + DIALBUG_INST_PULSE, + DIALBUG_INST_BASS, + DIALBUG_INST_ARP_MINOR, + DIALBUG_INST_ARP_MAJOR, + DIALBUG_INST_BELL, + DIALBUG_INST_PAD, + DIALBUG_INST_KICK, + DIALBUG_INST_SNARE, + DIALBUG_INST_HAT, + DIALBUG_INST_SAW, + DIALBUG_INST_PLUCK, + DIALBUG_INST_SWEEP, + DIALBUG_INSTRUMENT_COUNT +} dialbug_instrument_id_t; + +typedef struct { + uint8_t note; + uint8_t instrument; + uint8_t volume; + uint8_t gate_rows; +} dialbug_event_t; + +typedef struct { + dialbug_event_t row[DIALBUG_PATTERN_ROWS][DIALBUG_CHANNEL_COUNT]; +} dialbug_pattern_t; + +typedef struct { + char title[24]; + char subtitle[27]; + uint16_t bpm; + uint8_t order_length; + uint8_t order[DIALBUG_MAX_ORDER]; +} dialbug_song_t; + +extern const dialbug_pattern_t __far dialbug_patterns[]; +extern const dialbug_song_t __far dialbug_songs[]; +extern const uint8_t dialbug_song_count; + +void dialbug_music_init(void); +void dialbug_music_update(void); +void dialbug_music_select(uint8_t song_index); +void dialbug_music_restart(void); +void dialbug_music_toggle_pause(void); +void dialbug_music_set_master_volume(uint8_t volume); +void dialbug_music_set_speed_index(uint8_t speed_index); +void dialbug_music_toggle_mute(uint8_t channel); + +uint8_t dialbug_music_song_index(void); +uint8_t dialbug_music_master_volume(void); +uint8_t dialbug_music_speed_index(void); +uint8_t dialbug_music_speed_percent(void); +bool dialbug_music_is_paused(void); +bool dialbug_music_is_muted(uint8_t channel); +uint8_t dialbug_music_channel_note(uint8_t channel); +uint8_t dialbug_music_channel_level(uint8_t channel); +uint8_t dialbug_music_channel_instrument(uint8_t channel); +uint16_t dialbug_music_step(void); +uint16_t dialbug_music_total_steps(void); +const dialbug_song_t __far *dialbug_music_song(void); +const char __far *dialbug_music_instrument_name(uint8_t instrument); + +#endif diff --git a/homebrew/dialbug/src/songs.c b/homebrew/dialbug/src/songs.c new file mode 100644 index 0000000..e98b6d7 --- /dev/null +++ b/homebrew/dialbug/src/songs.c @@ -0,0 +1,252 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (C) 2026 Regionally Famous contributors + +#include "music.h" + +#define N { DIALBUG_NOTE_NONE, 0, 0, 0 } +#define OFF { DIALBUG_NOTE_OFF, 0, 0, 0 } +#define EV(note_, instrument_, volume_, gate_) \ + { (note_), (instrument_), (volume_), (gate_) } +#define ROW(ch1, ch2, ch3, ch4) { ch1, ch2, ch3, ch4 } + +/* Original four-channel soundtrack. Each pattern is a 16-row grid; omitted + * rows are holds. Songs reuse patterns through an eight-entry order list, + * echoing Humming Cat's compact score/loop model without copying its data. */ +const dialbug_pattern_t __far dialbug_patterns[] = { + /* 0: BATTERY GLOW / A */ + { .row = { + [0] = ROW(EV(E(5), DIALBUG_INST_LEAD, 14, 2), EV(E(2), DIALBUG_INST_BASS, 13, 4), EV(E(4), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(G(5), DIALBUG_INST_LEAD, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 8, 1)), + [4] = ROW(EV(B(5), DIALBUG_INST_LEAD, 14, 3), EV(C(3), DIALBUG_INST_BASS, 12, 4), EV(C(4), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [6] = ROW(EV(A(5), DIALBUG_INST_LEAD, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 7, 1)), + [8] = ROW(EV(G(5), DIALBUG_INST_LEAD, 13, 2), EV(D(3), DIALBUG_INST_BASS, 13, 4), EV(D(4), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(FS(5), DIALBUG_INST_LEAD, 12, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 8, 1)), + [12] = ROW(EV(D(5), DIALBUG_INST_LEAD, 13, 2), EV(B(2), DIALBUG_INST_BASS, 12, 4), EV(B(3), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [14] = ROW(EV(FS(5), DIALBUG_INST_LEAD, 12, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [15] = ROW(EV(D(6), DIALBUG_INST_LEAD, 14, 1), N, N, N) + } }, + + /* 1: BATTERY GLOW / B */ + { .row = { + [0] = ROW(EV(B(5), DIALBUG_INST_PLUCK, 15, 2), EV(E(2), DIALBUG_INST_BASS, 14, 4), EV(E(4), DIALBUG_INST_ARP_MINOR, 11, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(D(6), DIALBUG_INST_PLUCK, 14, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [4] = ROW(EV(E(6), DIALBUG_INST_LEAD, 15, 2), EV(G(2), DIALBUG_INST_BASS, 13, 4), EV(G(4), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [6] = ROW(EV(D(6), DIALBUG_INST_LEAD, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [8] = ROW(EV(A(5), DIALBUG_INST_PLUCK, 14, 2), EV(D(3), DIALBUG_INST_BASS, 14, 4), EV(D(4), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(FS(5), DIALBUG_INST_PLUCK, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 9, 1)), + [12] = ROW(EV(E(5), DIALBUG_INST_LEAD, 14, 2), EV(A(2), DIALBUG_INST_BASS, 13, 4), EV(A(3), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [14] = ROW(EV(G(5), DIALBUG_INST_LEAD, 13, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [15] = ROW(EV(B(5), DIALBUG_INST_LEAD, 15, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 7, 1)) + } }, + + /* 2: BATTERY GLOW / turn-around */ + { .row = { + [0] = ROW(EV(E(6), DIALBUG_INST_SAW, 14, 2), EV(E(2), DIALBUG_INST_BASS, 14, 4), EV(E(4), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(D(6), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 9, 1)), + [4] = ROW(EV(B(5), DIALBUG_INST_SAW, 13, 2), EV(C(3), DIALBUG_INST_BASS, 13, 4), EV(C(4), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [6] = ROW(EV(A(5), DIALBUG_INST_SAW, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [8] = ROW(EV(G(5), DIALBUG_INST_SAW, 13, 2), EV(D(3), DIALBUG_INST_BASS, 14, 4), EV(D(4), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(FS(5), DIALBUG_INST_SAW, 12, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 9, 1)), + [12] = ROW(EV(E(5), DIALBUG_INST_LEAD, 14, 1), EV(B(2), DIALBUG_INST_BASS, 13, 4), EV(B(3), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [13] = ROW(EV(FS(5), DIALBUG_INST_LEAD, 13, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [14] = ROW(EV(G(5), DIALBUG_INST_LEAD, 14, 1), N, N, EV(C(5), DIALBUG_INST_SNARE, 11, 1)), + [15] = ROW(EV(B(5), DIALBUG_INST_LEAD, 15, 1), N, OFF, EV(C(6), DIALBUG_INST_HAT, 10, 1)) + } }, + + /* 3: NEON RAINTRACE / A */ + { .row = { + [0] = ROW(EV(G(4), DIALBUG_INST_PULSE, 14, 2), EV(C(2), DIALBUG_INST_BASS, 14, 4), EV(C(4), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(C(5), DIALBUG_INST_PULSE, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [4] = ROW(EV(DS(5), DIALBUG_INST_PULSE, 14, 3), EV(GS(2), DIALBUG_INST_BASS, 13, 4), EV(GS(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [6] = ROW(EV(C(5), DIALBUG_INST_PULSE, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 7, 1)), + [8] = ROW(EV(G(5), DIALBUG_INST_PULSE, 14, 2), EV(DS(2), DIALBUG_INST_BASS, 13, 4), EV(DS(4), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(F(5), DIALBUG_INST_PULSE, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 8, 1)), + [12] = ROW(EV(D(5), DIALBUG_INST_PULSE, 13, 2), EV(AS(2), DIALBUG_INST_BASS, 13, 4), EV(AS(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [14] = ROW(EV(C(5), DIALBUG_INST_PULSE, 14, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)) + } }, + + /* 4: NEON RAINTRACE / B */ + { .row = { + [0] = ROW(EV(C(5), DIALBUG_INST_BELL, 15, 2), EV(F(2), DIALBUG_INST_BASS, 13, 4), EV(F(3), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(G(5), DIALBUG_INST_BELL, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [4] = ROW(EV(GS(5), DIALBUG_INST_BELL, 14, 2), EV(GS(2), DIALBUG_INST_BASS, 13, 4), EV(GS(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [6] = ROW(EV(G(5), DIALBUG_INST_BELL, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [8] = ROW(EV(DS(5), DIALBUG_INST_PULSE, 14, 2), EV(C(3), DIALBUG_INST_BASS, 14, 4), EV(C(4), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(C(5), DIALBUG_INST_PULSE, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 9, 1)), + [12] = ROW(EV(D(5), DIALBUG_INST_PULSE, 13, 2), EV(G(2), DIALBUG_INST_BASS, 13, 4), EV(G(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [14] = ROW(EV(G(5), DIALBUG_INST_PULSE, 14, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [15] = ROW(EV(AS(5), DIALBUG_INST_PULSE, 13, 1), N, N, N) + } }, + + /* 5: NEON RAINTRACE / sign-off */ + { .row = { + [0] = ROW(EV(C(6), DIALBUG_INST_PULSE, 15, 2), EV(C(2), DIALBUG_INST_BASS, 14, 4), EV(C(4), DIALBUG_INST_ARP_MINOR, 11, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(AS(5), DIALBUG_INST_PULSE, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [4] = ROW(EV(GS(5), DIALBUG_INST_PULSE, 13, 2), EV(GS(2), DIALBUG_INST_BASS, 13, 4), EV(GS(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [6] = ROW(EV(G(5), DIALBUG_INST_PULSE, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [8] = ROW(EV(F(5), DIALBUG_INST_BELL, 13, 2), EV(AS(2), DIALBUG_INST_BASS, 13, 4), EV(AS(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(DS(5), DIALBUG_INST_BELL, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 9, 1)), + [12] = ROW(EV(D(5), DIALBUG_INST_PULSE, 13, 1), EV(G(2), DIALBUG_INST_BASS, 13, 4), EV(G(3), DIALBUG_INST_ARP_MAJOR, 9, 4), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [13] = ROW(EV(DS(5), DIALBUG_INST_PULSE, 13, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [14] = ROW(EV(G(5), DIALBUG_INST_PULSE, 14, 1), N, N, EV(C(5), DIALBUG_INST_SNARE, 11, 1)), + [15] = ROW(EV(C(6), DIALBUG_INST_PULSE, 15, 1), N, OFF, EV(C(6), DIALBUG_INST_HAT, 10, 1)) + } }, + + /* 6: SOFT RESET SUNRISE / A */ + { .row = { + [0] = ROW(EV(A(4), DIALBUG_INST_BELL, 13, 4), EV(F(2), DIALBUG_INST_BASS, 11, 8), EV(F(3), DIALBUG_INST_PAD, 8, 8), EV(C(3), DIALBUG_INST_KICK, 11, 1)), + [2] = ROW(N, N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [4] = ROW(EV(C(5), DIALBUG_INST_BELL, 13, 4), N, N, EV(C(5), DIALBUG_INST_SNARE, 8, 1)), + [6] = ROW(N, N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [8] = ROW(EV(F(5), DIALBUG_INST_BELL, 14, 4), EV(D(2), DIALBUG_INST_BASS, 11, 8), EV(D(3), DIALBUG_INST_PAD, 8, 8), EV(C(3), DIALBUG_INST_KICK, 11, 1)), + [10] = ROW(N, N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [12] = ROW(EV(E(5), DIALBUG_INST_BELL, 12, 4), N, N, EV(C(5), DIALBUG_INST_SNARE, 8, 1)), + [14] = ROW(EV(C(5), DIALBUG_INST_BELL, 11, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)) + } }, + + /* 7: SOFT RESET SUNRISE / B */ + { .row = { + [0] = ROW(EV(D(5), DIALBUG_INST_BELL, 13, 4), EV(AS(2), DIALBUG_INST_BASS, 11, 8), EV(AS(3), DIALBUG_INST_PAD, 8, 8), EV(C(3), DIALBUG_INST_KICK, 11, 1)), + [2] = ROW(N, N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [4] = ROW(EV(F(5), DIALBUG_INST_BELL, 13, 4), N, N, EV(C(5), DIALBUG_INST_SNARE, 8, 1)), + [6] = ROW(EV(G(5), DIALBUG_INST_BELL, 11, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [8] = ROW(EV(E(5), DIALBUG_INST_BELL, 13, 4), EV(C(3), DIALBUG_INST_BASS, 11, 8), EV(C(4), DIALBUG_INST_PAD, 8, 8), EV(C(3), DIALBUG_INST_KICK, 11, 1)), + [10] = ROW(N, N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [12] = ROW(EV(C(5), DIALBUG_INST_BELL, 12, 2), N, N, EV(C(5), DIALBUG_INST_SNARE, 8, 1)), + [14] = ROW(EV(G(4), DIALBUG_INST_BELL, 11, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)) + } }, + + /* 8: SOFT RESET SUNRISE / horizon */ + { .row = { + [0] = ROW(EV(F(5), DIALBUG_INST_BELL, 14, 4), EV(F(2), DIALBUG_INST_BASS, 12, 8), EV(F(3), DIALBUG_INST_PAD, 9, 8), EV(C(3), DIALBUG_INST_KICK, 11, 1)), + [2] = ROW(EV(A(5), DIALBUG_INST_BELL, 11, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [4] = ROW(EV(G(5), DIALBUG_INST_BELL, 13, 4), N, N, EV(C(5), DIALBUG_INST_SNARE, 8, 1)), + [6] = ROW(EV(E(5), DIALBUG_INST_BELL, 11, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [8] = ROW(EV(D(5), DIALBUG_INST_BELL, 13, 4), EV(AS(2), DIALBUG_INST_BASS, 11, 8), EV(AS(3), DIALBUG_INST_PAD, 8, 8), EV(C(3), DIALBUG_INST_KICK, 11, 1)), + [10] = ROW(EV(F(5), DIALBUG_INST_BELL, 11, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [12] = ROW(EV(C(5), DIALBUG_INST_BELL, 12, 2), EV(C(3), DIALBUG_INST_BASS, 11, 4), EV(C(4), DIALBUG_INST_ARP_MAJOR, 7, 4), EV(C(5), DIALBUG_INST_SNARE, 8, 1)), + [14] = ROW(EV(G(4), DIALBUG_INST_BELL, 10, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 5, 1)), + [15] = ROW(EV(C(5), DIALBUG_INST_BELL, 12, 1), N, OFF, N) + } }, + + /* 9: LAST SAVE POINT / A */ + { .row = { + [0] = ROW(EV(A(4), DIALBUG_INST_SAW, 14, 2), EV(A(2), DIALBUG_INST_BASS, 14, 4), EV(A(3), DIALBUG_INST_ARP_MINOR, 11, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(C(5), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 10, 1)), + [4] = ROW(EV(E(5), DIALBUG_INST_SAW, 15, 2), EV(F(2), DIALBUG_INST_BASS, 13, 4), EV(F(3), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 15, 1)), + [6] = ROW(EV(F(5), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [8] = ROW(EV(E(5), DIALBUG_INST_SAW, 14, 2), EV(C(3), DIALBUG_INST_BASS, 14, 4), EV(C(4), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(C(5), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 10, 1)), + [12] = ROW(EV(G(4), DIALBUG_INST_SAW, 14, 2), EV(G(2), DIALBUG_INST_BASS, 13, 4), EV(G(3), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 15, 1)), + [14] = ROW(EV(B(4), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)) + } }, + + /* 10: LAST SAVE POINT / B */ + { .row = { + [0] = ROW(EV(E(5), DIALBUG_INST_LEAD, 15, 2), EV(A(2), DIALBUG_INST_BASS, 14, 4), EV(A(3), DIALBUG_INST_ARP_MINOR, 11, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(A(5), DIALBUG_INST_LEAD, 14, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 10, 1)), + [4] = ROW(EV(G(5), DIALBUG_INST_LEAD, 14, 2), EV(F(2), DIALBUG_INST_BASS, 13, 4), EV(F(3), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 15, 1)), + [6] = ROW(EV(E(5), DIALBUG_INST_LEAD, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [8] = ROW(EV(D(5), DIALBUG_INST_PLUCK, 14, 2), EV(D(3), DIALBUG_INST_BASS, 14, 4), EV(D(4), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(F(5), DIALBUG_INST_PLUCK, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 10, 1)), + [12] = ROW(EV(E(5), DIALBUG_INST_LEAD, 14, 2), EV(E(3), DIALBUG_INST_BASS, 13, 4), EV(E(4), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 15, 1)), + [14] = ROW(EV(B(4), DIALBUG_INST_LEAD, 13, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [15] = ROW(EV(GS(5), DIALBUG_INST_LEAD, 14, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)) + } }, + + /* 11: LAST SAVE POINT / continue? */ + { .row = { + [0] = ROW(EV(A(5), DIALBUG_INST_SAW, 15, 2), EV(A(2), DIALBUG_INST_BASS, 14, 4), EV(A(3), DIALBUG_INST_ARP_MINOR, 11, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(G(5), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 10, 1)), + [4] = ROW(EV(E(5), DIALBUG_INST_SAW, 14, 2), EV(F(2), DIALBUG_INST_BASS, 13, 4), EV(F(3), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 15, 1)), + [6] = ROW(EV(C(5), DIALBUG_INST_SAW, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 10, 1)), + [8] = ROW(EV(D(5), DIALBUG_INST_PLUCK, 14, 2), EV(D(3), DIALBUG_INST_BASS, 14, 4), EV(D(4), DIALBUG_INST_ARP_MINOR, 10, 4), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(E(5), DIALBUG_INST_PLUCK, 13, 2), N, N, EV(C(5), DIALBUG_INST_HAT, 10, 1)), + [12] = ROW(EV(G(5), DIALBUG_INST_LEAD, 14, 1), EV(E(3), DIALBUG_INST_BASS, 13, 4), EV(E(4), DIALBUG_INST_ARP_MAJOR, 10, 4), EV(C(5), DIALBUG_INST_SNARE, 15, 1)), + [13] = ROW(EV(A(5), DIALBUG_INST_LEAD, 14, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [14] = ROW(EV(B(5), DIALBUG_INST_LEAD, 15, 1), N, N, EV(C(5), DIALBUG_INST_SNARE, 12, 1)), + [15] = ROW(EV(E(6), DIALBUG_INST_LEAD, 15, 1), N, OFF, EV(C(6), DIALBUG_INST_HAT, 11, 1)) + } }, + + /* 12: SIGNAL BLOOM / A - E minor, rising channel-3 sweep replies */ + { .row = { + [0] = ROW(EV(E(5), DIALBUG_INST_PLUCK, 14, 2), EV(E(2), DIALBUG_INST_BASS, 13, 4), EV(B(4), DIALBUG_INST_SWEEP, 10, 3), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(N, N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [3] = ROW(EV(G(5), DIALBUG_INST_PLUCK, 13, 2), N, N, N), + [4] = ROW(N, EV(C(3), DIALBUG_INST_BASS, 12, 4), EV(G(4), DIALBUG_INST_SWEEP, 9, 3), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [6] = ROW(EV(B(5), DIALBUG_INST_PLUCK, 14, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [8] = ROW(EV(A(5), DIALBUG_INST_LEAD, 13, 2), EV(G(2), DIALBUG_INST_BASS, 13, 4), EV(D(5), DIALBUG_INST_SWEEP, 10, 3), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(G(5), DIALBUG_INST_LEAD, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [12] = ROW(N, EV(D(3), DIALBUG_INST_BASS, 12, 4), EV(A(4), DIALBUG_INST_SWEEP, 9, 3), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [14] = ROW(EV(FS(5), DIALBUG_INST_PLUCK, 13, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [15] = ROW(EV(E(6), DIALBUG_INST_PLUCK, 14, 1), N, N, N) + } }, + + /* 13: SIGNAL BLOOM / B - wider contour and a darker second cadence */ + { .row = { + [0] = ROW(EV(B(5), DIALBUG_INST_LEAD, 14, 2), EV(C(3), DIALBUG_INST_BASS, 13, 4), EV(E(5), DIALBUG_INST_SWEEP, 10, 3), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(D(6), DIALBUG_INST_LEAD, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [4] = ROW(EV(E(6), DIALBUG_INST_SAW, 14, 2), EV(A(2), DIALBUG_INST_BASS, 13, 4), EV(C(5), DIALBUG_INST_SWEEP, 9, 3), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [6] = ROW(EV(D(6), DIALBUG_INST_SAW, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [8] = ROW(EV(B(5), DIALBUG_INST_PLUCK, 14, 2), EV(E(2), DIALBUG_INST_BASS, 13, 4), EV(B(4), DIALBUG_INST_SWEEP, 10, 3), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(A(5), DIALBUG_INST_PLUCK, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [11] = ROW(EV(G(5), DIALBUG_INST_PLUCK, 12, 1), N, N, N), + [12] = ROW(N, EV(B(2), DIALBUG_INST_BASS, 13, 4), EV(FS(5), DIALBUG_INST_SWEEP, 9, 3), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [14] = ROW(EV(FS(5), DIALBUG_INST_LEAD, 13, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [15] = ROW(EV(B(5), DIALBUG_INST_LEAD, 14, 1), N, N, N) + } }, + + /* 14: SIGNAL BLOOM / handoff - descending signal, dominant pickup */ + { .row = { + [0] = ROW(EV(G(5), DIALBUG_INST_BELL, 14, 2), EV(E(2), DIALBUG_INST_BASS, 13, 4), EV(B(4), DIALBUG_INST_SWEEP, 10, 3), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [2] = ROW(EV(FS(5), DIALBUG_INST_BELL, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [4] = ROW(EV(E(5), DIALBUG_INST_BELL, 13, 2), EV(D(3), DIALBUG_INST_BASS, 12, 4), EV(A(4), DIALBUG_INST_SWEEP, 9, 3), EV(C(5), DIALBUG_INST_SNARE, 13, 1)), + [6] = ROW(EV(D(5), DIALBUG_INST_BELL, 12, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 8, 1)), + [8] = ROW(EV(C(5), DIALBUG_INST_PLUCK, 13, 2), EV(C(3), DIALBUG_INST_BASS, 12, 4), EV(G(4), DIALBUG_INST_SWEEP, 9, 3), EV(C(3), DIALBUG_INST_KICK, 15, 1)), + [10] = ROW(EV(E(5), DIALBUG_INST_PLUCK, 13, 2), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [12] = ROW(EV(DS(5), DIALBUG_INST_LEAD, 13, 1), EV(B(2), DIALBUG_INST_BASS, 13, 4), EV(FS(4), DIALBUG_INST_SWEEP, 10, 3), EV(C(5), DIALBUG_INST_SNARE, 14, 1)), + [13] = ROW(EV(FS(5), DIALBUG_INST_LEAD, 13, 1), N, N, N), + [14] = ROW(EV(B(5), DIALBUG_INST_LEAD, 14, 1), N, N, EV(C(6), DIALBUG_INST_HAT, 9, 1)), + [15] = ROW(EV(D(6), DIALBUG_INST_LEAD, 14, 1), N, OFF, N) + } } +}; + +const dialbug_song_t __far dialbug_songs[] = { + { + .title = "BATTERY GLOW", + .subtitle = "battery-lit velocity", + .bpm = 148, + .order_length = 8, + .order = { 0, 0, 1, 0, 1, 1, 0, 2 } + }, + { + .title = "NEON RAINTRACE", + .subtitle = "rain on the cartridge bus", + .bpm = 132, + .order_length = 8, + .order = { 3, 3, 4, 3, 4, 4, 3, 5 } + }, + { + .title = "SOFT RESET SUNRISE", + .subtitle = "warm pixels at midnight", + .bpm = 106, + .order_length = 8, + .order = { 6, 6, 7, 6, 7, 7, 6, 8 } + }, + { + .title = "LAST SAVE POINT", + .subtitle = "continue? always", + .bpm = 164, + .order_length = 8, + .order = { 9, 9, 10, 9, 10, 10, 9, 11 } + }, + { + .title = "SIGNAL BLOOM", + .subtitle = "a reply from low orbit", + .bpm = 140, + .order_length = 8, + .order = { 12, 12, 13, 12, 13, 13, 12, 14 } + } +}; + +const uint8_t dialbug_song_count = (uint8_t)(sizeof(dialbug_songs) / sizeof(dialbug_songs[0])); diff --git a/homebrew/dialbug/wfconfig.toml b/homebrew/dialbug/wfconfig.toml new file mode 100644 index 0000000..6e5dee0 --- /dev/null +++ b/homebrew/dialbug/wfconfig.toml @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2026 Regionally Famous contributors + +[cartridge] +publisher_id = 0x00 +game_id = 73 +game_version = 1 + +save_type = "NONE" +color = true +rtc = false +vertical = false + +rom_speed = 1 +rom_bus_width = 16