{"id":938,"date":"2010-06-20T16:10:19","date_gmt":"2010-06-20T20:10:19","guid":{"rendered":"http:\/\/nickm.com\/post\/?p=938"},"modified":"2012-11-29T14:43:08","modified_gmt":"2012-11-29T19:43:08","slug":"party-weaving-thread","status":"publish","type":"post","link":"https:\/\/nickm.com\/post\/2010\/06\/party-weaving-thread\/","title":{"rendered":"@party: Weaving thread"},"content":{"rendered":"<p>I spent this weekend at @party 2010, the first (and hopefully not last) demoparty of this name. The event was in the Town of Harvard, Massachusetts &#8211; a bit outside of Boston. I heard four live music performances, saw an early cut of Jason Scott&#8217;s almost-finished <i>Get Lamp<\/i> documentary, and saw and heard grafix, music, and demos (wild and windows) in the Saturday evening compos. There were great tunes, a truly excellent 4k windows demo, an incredible demo running on an Arduino, and much more. Many thanks to the organizer, Metoikos, and everyone who helped her out. And, a big thanks to the demoscene!<\/p>\n<p><a href=\"http:\/\/nickm.com\/if\/thread.zip\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/nickm.com\/post\/wp-content\/stuff\/thread_screen.png\" alt=\"\" title=\"thread (c64 demo in 31 bytes by le colonial, nom de nom, &amp; rv6502)\" width=\"382\" height=\"271\" class=\"alignright size-full wp-image-937\" srcset=\"https:\/\/nickm.com\/post\/wp-content\/stuff\/thread_screen.png 382w, https:\/\/nickm.com\/post\/wp-content\/stuff\/thread_screen-300x212.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/a><\/p>\n<p>Working with two others and using the moniker &#8220;nom de nom,&#8221; I completed my first demoscene production: <i>thread,<\/i> a Commodore 64 demo that has fewer than 32 bytes of code. (There are no C64 demos this size or smaller on pouet.net, as far as I can tell.) This demo is a tribute to a BASIC program that generates random mazes, one that exists in one form in the <i>C64 User&#8217;s Guide<\/i> but has also circulated as a one-liner. Here&#8217;s a version of the program:<\/p>\n<p><code>10 PRINT CHR$(205.5+RND(1)); : GOTO 10<\/code><\/p>\n<p>I developed thread working in person first with Le Colonial of Atlanta, a sometime co-author of mine who also writes Atari VCS games. (He&#8217;s also known as Ian Bogost.) At the party itself, I was fortunate to encounter C64 expert rv6502 of Montr\u00e9al, who joined me and did the heavy lifting in the second phase of this project.<\/p>\n<p>After working one evening with Le Colonial in Cambridge, we had a 32 byte program that wasn&#8217;t exactly like the original, but did something pretty cool. When I checked it out on my actual C64 right before I left for the party, however, it didn&#8217;t work. The SID was initialized differently in the emulators I&#8217;d used than it was on the box itself &#8211; as it happened &#8211; and there was something odd happening with my video display as well.<\/p>\n<p>I brought my C64 to the event rather half-heartedly, without any way of getting programs onto it other than typing them in and without a display. Alas, I wasn&#8217;t going to get away from the program that easily: Dr. Claw brought me a monitor to use and NO CARRIER loaned me a flash cart &#8211; and, later, a physical copy of the <i>Commodore 64 Programmer&#8217;s Guide.<\/i> rv6502 and I sat down to work further on the program. It turned out my C64&#8217;s video was different that of the emulators I used, but <i>also<\/i> different from Ferris&#8217;s actual C64 (which matched the behavior of the emulators I tried). So it wasn&#8217;t just an emulator failing to match the metal; the two different C64s apparently have different KERNAL code in ROM. Dumping my machine&#8217;s ROM and used that with my emulator would have solved that part of the mismatch.<\/p>\n<p>I won&#8217;t try to go into all the details of developing this demo, but there were two particularly great things about the process at a high level. First, I got to collaborate with and learn from two others at different points. Second, I got to learn a lot more about the C64, including many things I wouldn&#8217;t have run up against if I hadn&#8217;t been working on something like this. I&#8217;m not talking about small differences between emulation and the hardware, which were a minor part of this experience, in the end. I mean finding excellent facilities of the 6502 and the C64 to work around those which weren&#8217;t doing what we wanted.<\/p>\n<p>We&#8217;ve released thread in three versions: The canonical one, which has 31 bytes of code but is in a 33-byte PRG file, because the beginning memory location is stored in the first two bytes of PRG files. If this bothers you, there is a 28-byte version which fits into a 30-byte PRG file and has all the same colors, but displayed in a way that we think is not as pretty. We also include a simple, straightforward reimplementation of the BASIC program above: A 20-byte program in a 22-byte PRG file. I&#8217;d love to get this uploaded to pouet.net at some point, but I don&#8217;t know how. For now, <a href=\"\/if\/thread.zip\">here&#8217;s a zipfile with source and PRGs.<\/a><\/p>\n<p>thread got 4th place in the Oldschool category at @party. After you load a PRG file in your emulator (or on your C64), you can run it by typing &#8220;SYS 4096&#8221;.<\/p>\n<p>Finally, these are the 31 bytes of thread:<\/p>\n<p><code>A9 80 8D 0F D4 8D 12 D4 A8 B1 F9 8D 86 02 AD 1B D4 29 01 69 6D 20 D2 FF E8 D0 ED E6 F9 50 E9<\/code><\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>I spent this weekend at @party 2010, the first (and hopefully not last) demoparty of this name. The event was in the Town of Harvard, Massachusetts &#8211; a bit outside of Boston. I heard four live music performances, saw an early cut of Jason Scott&#8217;s almost-finished Get Lamp documentary, and saw and heard grafix, music, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/nickm.com\/post\/2010\/06\/party-weaving-thread\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;@party: Weaving thread&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[117,38,44,66,17,24,23,10,39,15],"class_list":["post-938","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-10-print","tag-collaboration","tag-competitions","tag-demoscene","tag-digital","tag-gatherings","tag-hardware","tag-platforms","tag-playing","tag-programming"],"_links":{"self":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts\/938","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":13,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts\/938\/revisions"}],"predecessor-version":[{"id":2811,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/posts\/938\/revisions\/2811"}],"wp:attachment":[{"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/media?parent=938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/categories?post=938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nickm.com\/post\/wp-json\/wp\/v2\/tags?post=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}