<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[ChipMusic.org - Wallflower - Visual/audio demo in 23 bytes.]]></title>
	<link rel="self" href="https://chipmusic.org:80/forums/feed/atom/topic/4147/"/>
	<updated>2011-05-09T16:43:42Z</updated>
	<generator>PunBB</generator>
	<id>https://chipmusic.org/forums/topic/4147/wallflower-visualaudio-demo-in-23-bytes/</id>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/66049/#p66049"/>
			<content type="html"><![CDATA[<p>this is really cool</p>]]></content>
			<author>
				<name><![CDATA[Battle Lava]]></name>
				<uri>https://chipmusic.org/Battle+Lava</uri>
			</author>
			<updated>2011-05-09T16:43:42Z</updated>
			<id>https://chipmusic.org/forums/post/66049/#p66049</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/66043/#p66043"/>
			<content type="html"><![CDATA[<p>I bet it gives interesting values after loading some software beforehand.</p>]]></content>
			<author>
				<name><![CDATA[akira^8GB]]></name>
				<uri>https://chipmusic.org/akira%5E8GB</uri>
			</author>
			<updated>2011-05-09T15:46:18Z</updated>
			<id>https://chipmusic.org/forums/post/66043/#p66043</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/66031/#p66031"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>akira^8GB wrote:</cite><blockquote><div class="quotebox"><cite>4mat wrote:</cite><blockquote><p>or type this into your hex editor:</p><div class="codebox"><pre><code>7C 00 05 A2 29 3F A8 E5 A1 45 A2 05 A2 29 7F 99 00 D4 99 D7 CF 50 EB</code></pre></div></blockquote></div><p>Can I type this straight into memory with a monitor? At which address? (I&#039;m a noob). There&#039;s a specific address where executables can be put, right? Or I can SYS it. Hmm..</p></blockquote></div><p>Yes, if you skip the first two bytes (which are the file header) and put it into memory at $7c , then jump to $7c (or SYS 124) and it&#039;ll run.&nbsp; Just tried that in Vice.&nbsp; (I can&#039;t figure out how to type a bunch of hex bytes into Vice&#039;s monitor so used fill for each address <img src="https://chipmusic.org/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /> )</p><p>If you type the whole thing into a hex editor and save that as a binary it&#039;ll autorun with LOAD &quot;FILENAME&quot;,8,1</p><p>One thing to note is while the structure of the demo remains intact the audio &amp; visuals change slightly depending on how long the c64 has been powered up before it&#039;s run.&nbsp; In the video it&#039;s within the first &#039;second&#039; of a boot-up, unfortunately this is beyond my control as there&#039;s no room to reset the timer values before the demo activates.&nbsp; (putting code at $7c only gives you about 23 bytes to play with)</p>]]></content>
			<author>
				<name><![CDATA[4mat]]></name>
				<uri>https://chipmusic.org/4mat</uri>
			</author>
			<updated>2011-05-09T15:15:36Z</updated>
			<id>https://chipmusic.org/forums/post/66031/#p66031</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/66023/#p66023"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>4mat wrote:</cite><blockquote><p>or type this into your hex editor:</p><div class="codebox"><pre><code>7C 00 05 A2 29 3F A8 E5 A1 45 A2 05 A2 29 7F 99 00 D4 99 D7 CF 50 EB</code></pre></div></blockquote></div><p>Can I type this straight into memory with a monitor? At which address? (I&#039;m a noob). There&#039;s a specific address where executables can be put, right? Or I can SYS it. Hmm..</p>]]></content>
			<author>
				<name><![CDATA[akira^8GB]]></name>
				<uri>https://chipmusic.org/akira%5E8GB</uri>
			</author>
			<updated>2011-05-09T14:46:58Z</updated>
			<id>https://chipmusic.org/forums/post/66023/#p66023</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65999/#p65999"/>
			<content type="html"><![CDATA[<p>Brings a tear to my eye, beautiful.</p><p>My girlfriend: &quot;how can you enjoy that? It&#039;s annoying.&quot;</p>]]></content>
			<author>
				<name><![CDATA[The Silph Scope]]></name>
				<uri>https://chipmusic.org/The+Silph+Scope</uri>
			</author>
			<updated>2011-05-09T12:43:28Z</updated>
			<id>https://chipmusic.org/forums/post/65999/#p65999</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65970/#p65970"/>
			<content type="html"><![CDATA[<p>23 bytes. Astounding as usual 4mat. Just awesome.</p>]]></content>
			<author>
				<name><![CDATA[arfink]]></name>
				<uri>https://chipmusic.org/arfink</uri>
			</author>
			<updated>2011-05-09T04:55:33Z</updated>
			<id>https://chipmusic.org/forums/post/65970/#p65970</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65959/#p65959"/>
			<content type="html"><![CDATA[<p>Like like!</p>]]></content>
			<author>
				<name><![CDATA[Party Time! Hexcellent!]]></name>
				<uri>https://chipmusic.org/Party+Time%21+Hexcellent%21</uri>
			</author>
			<updated>2011-05-09T03:55:04Z</updated>
			<id>https://chipmusic.org/forums/post/65959/#p65959</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65927/#p65927"/>
			<content type="html"><![CDATA[<p>That is indeed quite awesome</p>]]></content>
			<author>
				<name><![CDATA[chunter]]></name>
				<uri>https://chipmusic.org/chunter</uri>
			</author>
			<updated>2011-05-09T01:39:59Z</updated>
			<id>https://chipmusic.org/forums/post/65927/#p65927</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65923/#p65923"/>
			<content type="html"><![CDATA[<p>Thankyou.&nbsp; Going into a little more detail:&nbsp; With the kernal system running (the default on bootup) the c64 has a realtime clock<br />active.&nbsp; It uses the zeropage addresses $a0-$a2 for minutes, seconds, and... not quite milliseconds.&nbsp; They call it a &#039;jiffy clock&#039; which<br />translates to it being 50fps for PAL and 60fps for NTSC.&nbsp; &nbsp;Anyway, as the system is still enabled those addresses are counting up at a regular rate.&nbsp; My code then takes the values in $a1 and $a2, does some bit shifting and subtracting and then uses the results twice.&nbsp; Once for the Y index so I can offset to other parts of the VIC-II and SID chips, and then the second time for what value to put in the chips for that loop.&nbsp; &nbsp;There is no timing inside the demo itself so things are running as fast as the CPU can do them.&nbsp; (which is why the sound is quite &#039;bubbly&#039; sounding)</p><div class="codebox"><pre><code>; assembled to address $007c in the zeropage of memory.  This is a known trick to allow tiny programs to
; execute by loading them with LOAD&quot;FILENAME&quot;,device,1 

* = $7c

; OR accumulator with the millisecond register.
ora $a2
; AND it to be a value between 0 and 63, then tranfer to the Y index. 
; We don&#039;t want too much range for the SID/VIC addresses to write to.
and #$3f 
tay
; More messing with the accumulator value, limiting the range to 0-127.
; This will be the value that gets written to the other chips and gives us
; enough values to keep the display and audio interesting. (though no
; noise waveform as that would require $81)
sbc $a1
eor $a2
ora $a2
and #$7f
; Write to SID chip.
sta $d400,y
; Write to VIC chip.  By rights the address should be $d000 , however
; because some written values end up crashing the demo or freezing it
; I offset back to a reasonably &quot;safe&quot; area.  This overlaps from the end of the
; ram bank at $c000.
sta $cfd7,y 
; As the overflow flag is always clear I can use this to loop back.  The other
; branch types always resolve and a JMP command costs another byte.
bvc $7c</code></pre></div><p>I agree, the workflow for the demo was much more discovery than a direct creation.&nbsp; I <br />called the demo &#039;Wallflower&#039; because it&#039;s almost like a dance, the sprite blocks begin <br />clustered around the sides of the screen and then interact with each other as the<br />environment changes, with the ORA &amp; EOR sequences in the code forming and dissolving<br />relationships between the different blocks in turn.</p>]]></content>
			<author>
				<name><![CDATA[4mat]]></name>
				<uri>https://chipmusic.org/4mat</uri>
			</author>
			<updated>2011-05-09T00:20:42Z</updated>
			<id>https://chipmusic.org/forums/post/65923/#p65923</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65922/#p65922"/>
			<content type="html"><![CDATA[<p>Haha that is so cool. 23 BYTES. Awesome.</p>]]></content>
			<author>
				<name><![CDATA[Bit Shifter]]></name>
				<uri>https://chipmusic.org/Bit+Shifter</uri>
			</author>
			<updated>2011-05-09T00:20:36Z</updated>
			<id>https://chipmusic.org/forums/post/65922/#p65922</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65903/#p65903"/>
			<content type="html"><![CDATA[<p>Wow... the way this evolves is fascinating!</p><p>With such a small source code it seems like this is as much a discovery as a creation? (I don&#039;t mean that disparagingly!)&nbsp; Can you explain a bit about what is actually happening to produce this result?</p>]]></content>
			<author>
				<name><![CDATA[Trollcat]]></name>
				<uri>https://chipmusic.org/Trollcat</uri>
			</author>
			<updated>2011-05-08T20:50:54Z</updated>
			<id>https://chipmusic.org/forums/post/65903/#p65903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65890/#p65890"/>
			<content type="html"><![CDATA[<p>Bonus for posting the demo&#039;s code in its entirety.</p>]]></content>
			<author>
				<name><![CDATA[chunter]]></name>
				<uri>https://chipmusic.org/chunter</uri>
			</author>
			<updated>2011-05-08T17:00:08Z</updated>
			<id>https://chipmusic.org/forums/post/65890/#p65890</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65873/#p65873"/>
			<content type="html"><![CDATA[<p>inspiring!</p>]]></content>
			<author>
				<name><![CDATA[little-scale]]></name>
				<uri>https://chipmusic.org/little-scale</uri>
			</author>
			<updated>2011-05-08T13:33:19Z</updated>
			<id>https://chipmusic.org/forums/post/65873/#p65873</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65870/#p65870"/>
			<content type="html"><![CDATA[<p>Excellent!!!! Music sounds a bit skrju-ey. Would loading an image immediately before running this code be COOL or NOT COOL (broken)?</p>]]></content>
			<author>
				<name><![CDATA[ant1]]></name>
				<uri>https://chipmusic.org/ant1</uri>
			</author>
			<updated>2011-05-08T13:19:19Z</updated>
			<id>https://chipmusic.org/forums/post/65870/#p65870</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Wallflower - Visual/audio demo in 23 bytes.]]></title>
			<link rel="alternate" href="https://chipmusic.org/forums/post/65833/#p65833"/>
			<content type="html"><![CDATA[<p><div class="embed_video"><iframe width="560" height="340" src="https://www.youtube.com/embed/7lcQ-HDepqk" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></p><p>I&#039;d been trying some small music drivers that use the Commodore64&#039;s realtime clock to keep rhythm, rather than the<br />standard way of having an interrupt with a countdown for tempo.&nbsp; &nbsp;While the output isn&#039;t particularly pleasant here&#039;s<br />a little 23 byte demo that messes with those registers and then outputs the data to the VIC-II and SID to make a<br />little glitch fest.&nbsp; It ends after 9 minutes, I presume because the VIC-II eventually gets fed some bogus data.&nbsp; <br />(I had to keep moving the visuals offset around to stop it crashing much earlier in the run)</p><p><a href="http://atebit.org/downloads/atebit_wallflower.zip" target="_blank">Download the binary</a> or type this into your hex editor:</p><div class="codebox"><pre><code>7C 00 05 A2 29 3F A8 E5 A1 45 A2 05 A2 29 7F 99 00 D4 99 D7 CF 50 EB</code></pre></div>]]></content>
			<author>
				<name><![CDATA[4mat]]></name>
				<uri>https://chipmusic.org/4mat</uri>
			</author>
			<updated>2011-05-07T22:12:03Z</updated>
			<id>https://chipmusic.org/forums/post/65833/#p65833</id>
		</entry>
</feed>
