<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Graphics Magician &#8211; Pages of Fun</title>
	<atom:link href="https://robertgomez.org/blog/tag/graphics-magician/feed/" rel="self" type="application/rss+xml" />
	<link>https://robertgomez.org</link>
	<description>Robert Wm. Gomez&#039;s Website</description>
	<lastBuildDate>Sun, 17 Apr 2022 14:36:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://robertgomez.org/wp-content/uploads/2020/10/cropped-garland_logo-32x32.png</url>
	<title>Graphics Magician &#8211; Pages of Fun</title>
	<link>https://robertgomez.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Apple ][ Graphic Adventure Part II</title>
		<link>https://robertgomez.org/blog/2018/03/18/apple-graphic-adventure-part-ii/</link>
		
		<dc:creator><![CDATA[Robert Gomez]]></dc:creator>
		<pubDate>Sun, 18 Mar 2018 20:51:06 +0000</pubDate>
				<category><![CDATA[Robert's Blog]]></category>
		<category><![CDATA[apple2]]></category>
		<category><![CDATA[applesoft]]></category>
		<category><![CDATA[Graphics Magician]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">https://robertgomez.org/?p=3001</guid>

					<description><![CDATA[In my&#160;previous post&#160;I wrote about the impetus behind this project. To start, I knew that my code was going to be structured around the&#160;Haunted House&#160;program&#160;in the excellent book&#160;Write your Own Adventure Programs for your Microcomputer. As I have&#160;written before, this book was crucial in my development as a programmer (I haven&#8217;t developed much beyond it). [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In my&nbsp;<a href="https://robertgomez.org/blog/2018/03/17/apple-graphic-adventure-part-i/" data-type="post" data-id="2995">previous post</a>&nbsp;I wrote about the impetus behind this project. To start, I knew that my code was going to be structured around the&nbsp;<a href="https://robertgomez.org/blog/2012/11/08/haunted-house-text-adventure/" data-type="post" data-id="2600"><em>Haunted House</em>&nbsp;program</a>&nbsp;in the excellent book&nbsp;<em>Write your Own Adventure Programs for your Microcomputer</em>. As I have&nbsp;<a href="https://robertgomez.org/blog/2009/07/14/my-apple-masterpiece-malfunction/" data-type="post" data-id="851">written before</a>, this book was crucial in my development as a programmer (I haven&#8217;t developed much beyond it). I would love to do this project in 6502 machine code and I have been trying very hard to learn 6502 assembly programming. But, although I&#8217;ve gotten a better understanding of machine code, there&#8217;s serious lack of noob-friendly practical learning exercises available out there. Sure I can draw pixels at lightning speed, but, after reading most of&nbsp;<a href="https://robertgomez.org/blog/2015/09/14/apple-assembly-language-programming/" data-type="post" data-id="2847"><em>Assembly Lines</em></a>, I still have no idea how to do a simple&nbsp;<code>INPUT</code>&nbsp;command or mimic an array.</p>



<p class="wp-block-paragraph">So, Applesoft&nbsp;<abbr title="Beginner's All-purpose Symbolic Instruction Code">BASIC</abbr>&nbsp;it is! With emulation and modern computing I have been able to develop my code on a Windows PC and then quickly run it in emulation. My workflow isn&#8217;t nearly as fancy as some other retro-programmers. I type my Applesoft in a text editor, then in AppleWin I paste the entire code listing into an emulated apple using&nbsp;<kbd>SHIFT+INSERT</kbd>. The benefit of using emulation as a development environment is that you can throttle the emulation to run hundreds of times faster (hit&nbsp;<kbd>ScrLK</kbd>) than real hardware. This makes testing small changes a breeze.</p>



<p class="wp-block-paragraph">My first task was to see if I could successfully load a&nbsp;<em>Graphics Magician</em>&nbsp;image into a program. The program itself is a bit of a UI nightmare. Without a&nbsp;<a href="ftp://ftp.apple.asimov.net/pub/apple_II/documentation/applications/misc/Graphics%20Magician%20Picture%20Painter.pdf">manual</a>&nbsp;or reference card, it&#8217;s nearly impossible to know what keys do what. On top of that, the program requires that you use a joystick to move the drawing cursor on the screen. Fortunately, the manual can be found online and you can use a PC mouse as a joystick within AppleWin. I managed to crank out a couple of silly images for testing and save them to my game disk.</p>



<p class="wp-block-paragraph">I then used to code provided in the manual to write a simple Applesoft program that displays the image:</p>



<pre class="wp-block-code"><code>1 PRINT CHR$ (4);"MAXFILES1"5 HIMEM: 32768
10 PRINT CHR$ (4);"BLOAD PICDRAWH"
20 PRINT CHR$ (4);"BLOAD ROOM1.SPC,A32768"
30 HGR
40 A = 32768:HI = INT (A / 256):LO = A - HI * 256: POKE 0,LO: POKE 1,HI50 CALL 36096</code></pre>



<p class="wp-block-paragraph">In order for this code to work, you are required to copy PICDRAWH from the&nbsp;<em>Graphics Magician</em>&nbsp;disk to your disk. This is the machine code rendering engine that is loaded into memory at the top of this program. The&nbsp;<code>MAXFILES1</code>&nbsp;DOS command apparently frees up some memory by limiting the amount of open files. This command needs to be the first one in your code, before any string assignments, etc. I think&nbsp;<code>HIMEM</code>&nbsp;does something similar with allocating memory locations. I have never written an Applesoft program so large that it required memory management so the purpose of these commands alludes me somewhat. As this project grows, I may have to familiarize myself with them.</p>



<p class="wp-block-paragraph">You will see&nbsp;<code>CHR$(4)</code>&nbsp;often in Applesoft programs.&nbsp;<code>CHR$()</code>&nbsp;is a function that retrieves the keyboard character in assigned to the numerical value in then parenthesis. For example,&nbsp;<code>PRINT CHR$(65)</code>&nbsp;prints the letter A. In this case, character number four is the equivalent of keying in&nbsp;<kbd>CTRL+D</kbd>. That instructs the computer that the next PRINTed string should be executed as a DOS command rather than PRINTed to the screen.</p>



<p class="wp-block-paragraph">The&nbsp;<em>Graphics Magician</em>&nbsp;file is ROOM1.SPC.&nbsp;<code>BLOAD ROOM1.SPC,A32768</code>&nbsp;loads the drawing code into memory location 32768. That seems like a crazy random number but it is actually $8000 in hexidecimal.&nbsp;<code>HGR</code>&nbsp;switches to high-resolution graphics mode and then line 40 stores the memory address of the picture into a location PICDRAWH will know to look. Finally, the&nbsp;<code>CALL 36096</code>&nbsp;triggers the PICDRAWH draw routines.</p>



<p class="wp-block-paragraph">There&#8217;s a lot of fancy stuff going on here, but it does the job as advertised.&nbsp;<em>The Graphics Magician</em>&nbsp;manual also goes deeper with more code that shows how to string multiple images into slide shows&nbsp;and how to overlay objects over backgrounds. More on that when I get to my object code. For now, this proof-of-concept was enough to get a simple working prototype up and running.</p>



<p class="wp-block-paragraph"><a href="https://robertgomez.org/blog/2018/03/19/apple-graphic-adventure-part-iii/" data-type="post" data-id="3003">Continued in Part III</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Apple ][ Graphic Adventure Part I</title>
		<link>https://robertgomez.org/blog/2018/03/17/apple-graphic-adventure-part-i/</link>
		
		<dc:creator><![CDATA[Robert Gomez]]></dc:creator>
		<pubDate>Sat, 17 Mar 2018 20:48:52 +0000</pubDate>
				<category><![CDATA[Robert's Blog]]></category>
		<category><![CDATA[adventure]]></category>
		<category><![CDATA[apple2]]></category>
		<category><![CDATA[applesoft]]></category>
		<category><![CDATA[Graphics Magician]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">https://robertgomez.org/?p=2995</guid>

					<description><![CDATA[Having recently played the Apple ][ game&#160;Transylvania&#160;and its&#160;sequel, I was inspired to&#160;mess with the art program which those games used.&#160;The Graphics Magician&#160;was a huge hit for Penguin Software, but I never actually had a chance to use it when we had an Apple ][. I just remember it being advertised in every computer magazine I [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Having recently played the Apple ][ game&nbsp;<a href="https://robertgomez.org/fun-stuff/games/transylvania/" data-type="game_review" data-id="2985"><em>Transylvania</em></a>&nbsp;and its&nbsp;<a href="https://robertgomez.org/fun-stuff/games/the-crimson-crown/" data-type="game_review" data-id="2990">sequel</a>, I was inspired to&nbsp;mess with the art program which those games used.&nbsp;<em>The Graphics Magician</em>&nbsp;was a huge hit for Penguin Software, but I never actually had a chance to use it when we had an Apple ][. I just remember it being advertised in every computer magazine I had.</p>



<p class="wp-block-paragraph">My go to art program back in the day was always&nbsp;<em>Alpha Plot</em>&nbsp;from Beagle Bros. It wasn&#8217;t the easiest software to use. In fact, it came bundled with a cardboard overlay for your keyboard so you had an immediate reference as to what the various keys did. Still, I managed to draw pixel by pixel and create masterpieces like this:</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="560" height="384" src="https://robertgomez.org/wp-content/uploads/2018/03/alpha-plot-gross.png" alt="" class="wp-image-2997" srcset="https://robertgomez.org/wp-content/uploads/2018/03/alpha-plot-gross.png 560w, https://robertgomez.org/wp-content/uploads/2018/03/alpha-plot-gross-300x206.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></figure>



<p class="wp-block-paragraph"><em>The Graphics Magician</em>&nbsp;is something altogether different though. Instead of meticulously drawing each point on the screen, you create images programatically using a language of lines, fills and brushes.&nbsp;The end product is what today we would call vector art.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="560" height="384" src="https://robertgomez.org/wp-content/uploads/2018/03/graphics-magician-weirdo.png" alt="" class="wp-image-2998" srcset="https://robertgomez.org/wp-content/uploads/2018/03/graphics-magician-weirdo.png 560w, https://robertgomez.org/wp-content/uploads/2018/03/graphics-magician-weirdo-300x206.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></figure>



<p class="wp-block-paragraph">The advantage of vector art is that file sizes are small. The other advantage is that these drawing routines can be used within one&#8217;s own Apple ][ programs.</p>



<p class="wp-block-paragraph">This gave me an idea for a project. Take the text-based&nbsp;<a href="https://robertgomez.org/node/467">adventure game</a>&nbsp;I had made years ago, and use these routines to add graphics to the game. As I type this, I am already pretty far along in the project, but I will be going back and documenting my progress.&nbsp;Hopefully someone might find this informative and, if I am able to follow through, maybe I will have a releasable game in the end. It&#8217;s doing more than I ever imagined already:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="700" height="462" src="https://robertgomez.org/wp-content/uploads/2018/03/parser-inprogress-01.jpg" alt="" class="wp-image-2999" srcset="https://robertgomez.org/wp-content/uploads/2018/03/parser-inprogress-01.jpg 700w, https://robertgomez.org/wp-content/uploads/2018/03/parser-inprogress-01-300x198.jpg 300w" sizes="(max-width: 700px) 100vw, 700px" /></figure>



<p class="wp-block-paragraph">Continue to <a href="https://robertgomez.org/blog/2018/03/18/apple-graphic-adventure-part-ii/" data-type="post" data-id="3001">Part II</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
