<?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>Figment Games &#187; GID</title>
	<atom:link href="http://blog.figmentgames.com/category/gamedev/gid/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.figmentgames.com</link>
	<description>The thoughts of a software developer.</description>
	<lastBuildDate>Fri, 11 Jun 2010 11:35:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GID 23 &#8211; Brew Isles</title>
		<link>http://blog.figmentgames.com/2007/09/01/gid-23-brew-isles/</link>
		<comments>http://blog.figmentgames.com/2007/09/01/gid-23-brew-isles/#comments</comments>
		<pubDate>Sat, 01 Sep 2007 20:54:45 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[GID]]></category>

		<guid isPermaLink="false">http://blog.figmentgames.com/2007/09/01/gid-23-brew-isles/</guid>
		<description><![CDATA[GID 23 took place a few weeks ago on the 11th/12th of August. 
It all began at approximately 11:01.34pm Saturday night, with nearly half of GID#23 already gone and yet I still had no idea what to do. Tom suggested I team up with him to do something similar to the original Teaminator.
We had no [...]]]></description>
			<content:encoded><![CDATA[<p>GID 23 took place a few weeks ago on the 11th/12th of August. </p>
<p>It all began at approximately 11:01.34pm Saturday night, with nearly half of GID#23 already gone and yet I still had no idea what to do. Tom suggested I team up with him to do something similar to the original <a href="http://www.greatgamesexperiment.com/game/teaminator">Teaminator</a>.</p>
<p>We had no idea what the game was going to be about only that it had to involve Tea. A large part of the core code was already in place from previous GID&#8217;s Tom had done, which left us free to concentrate on more game specific issues. </p>
<p>The result by the end of Sunday was larger than expected and shows clear signs of the games and tv show we drew inspiration from; Monkey Island, Dizzy and Open All Hours. </p>
<p><img class="alignright" src='http://blog.figmentgames.com/wp-content/uploads/2007/09/openallhours.jpg' alt='Open All Hours' /></p>
<p><a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/dizzy.png' title='Treasure Island Dizzy'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/dizzy.thumbnail.png' alt='Treasure Island Dizzy' /></a> <a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/dizzy-2.png' title='Dizzy Island Screenshot'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/dizzy-2.thumbnail.png' alt='Dizzy Island Screenshot' /></a></p>
<p><a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/screen01.gif' title='Blind Lookout Monkey Island'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/screen01.thumbnail.gif' alt='Blind Lookout Monkey Island' /></a> <a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/screen05.gif' title='Pirate Scum Bar'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/screen05.thumbnail.gif' alt='Pirate Scum Bar' /></a></p>
<p>I finally got around to playing Treasure Island Dizzy the other night, which I used to have for the C128 (or was it the Amiga, I forget which). It&#8217;s strange going back and playing games which I played many years ago. Some games I remember as amazing, and yet on playing them again all the fond memories of how good the game was, which you&#8217;ve over the years raised onto a pedestal of &#8220;how games should be&#8221;, comes crashing down as you suddenly realize you&#8217;ve built the game up to be more than it really was.  Fortunately that isn&#8217;t the case with Dizzy nor Monkey Island (which I&#8217;m also part way through replaying) </p>
<p>I had forgotten just how <a href="http://www.gamasutra.com/view/feature/1640/game_design_essentials_20_.php">HARD older games really are</a>. Most games these days you can pickup and play for some time before you die, try playing Dizzy for more than a minute without dieing several times!</p>
<p><a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/brew-isles-02.png' title='BrewIsles Overview'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/brew-isles-02.thumbnail.png' alt='BrewIsles Overview' /></a> <a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/screenshot_001-00003.jpg' title='Penguin Quest'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/screenshot_001-00003.thumbnail.jpg' alt='Penguin Quest' /></a> <a href='http://blog.figmentgames.com/wp-content/uploads/2007/09/screenshot_001-00002.jpg' title='Arkwright'><img src='http://blog.figmentgames.com/wp-content/uploads/2007/09/screenshot_001-00002.thumbnail.jpg' alt='Arkwright' /></a></p>
<p>The GID did highlight a few areas of the Engine which could do with improvements, which has resulted in a complete overhaul of the dialogue system to now use a node based tree structure. This enables dialogue to be constructed through a parent/child relationship of dialogue and dialogueItem nodes. </p>
<p>Special purpose nodes can also be inserted into the tree allowing actions to be performed on the display of specific dialogue or the selection of a dialogue option. New node types will be added in the future to support a variety of actions, for example, enabling a quest, playing an animation or transitioning the camera. A general purpose callback node functions as a stop gap until new node types are available.</p>
<p>The Quest system has also seen a significant improvement along with the addition of an <a href="http://www.garagegames.com/blogs/22864/13423">NPC Editor</a></p>
<p><a href="http://www.greatgamesexperiment.com/game/brewisles">Brew Isles</a> can be download via the <a href="http://www.greatgamesexperiment.com/game/brewisles">GreatGamesExperiment</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.figmentgames.com/2007/09/01/gid-23-brew-isles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GID j &#8211; Mission Accomplished</title>
		<link>http://blog.figmentgames.com/2006/04/09/gid-j-mission-accomplished/</link>
		<comments>http://blog.figmentgames.com/2006/04/09/gid-j-mission-accomplished/#comments</comments>
		<pubDate>Sun, 09 Apr 2006 23:17:38 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[GID]]></category>
		<category><![CDATA[XGS]]></category>

		<guid isPermaLink="false">http://00101010.figmentgames.com/2006/04/09/gid-j-mission-accomplished/</guid>
		<description><![CDATA[Having only had a few hours Sunday night to work on the last part of the code I wasn't expecting to actually reach my goal of a pixel on the screen. In the end though, I managed to get a square block drawn in the center of the screen synced well enough to show flicker [...]]]></description>
			<content:encoded><![CDATA[<p>Having only had a few hours Sunday night to work on the last part of the code I wasn't expecting to actually reach my goal of a pixel on the screen. In the end though, I managed to get a square block drawn in the center of the screen synced well enough to show flicker free on both my TV and Digital TV card in the PC.</p>
<p>The actual TV picture is a nice vibrant yellow, the screen capture doesn't do it justice looking a little washed out. Oh, that reminds me, the colour burst wasn't that hard afterall, just a case of making sure the colour is set in the upper 4 bits and the luma in the lower 4 <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://00101010.figmentgames.com/wp-content/images/xgs/big-pixel.jpg" alt="big pixel" /></p>
<p>Adding in the VSync and overscan code wasn't that difficult, the hard part was counting all the clock cycles to make sure they met the timing requirements. In fact the most trouble was with the comparison loop where I check whether the scanline is within the block and needs to be drawn in colour. This results in 3 possible code paths all of which had to have exactly the same number of cycles before reaching the final DEALY(174-3) instruction. A little fudging goes a long way though <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The theme for this GID was "Extreme Forces" well the forces exerted on my TV by all the badly formed signals I sent throughout Saturday were pretty extreme, does that count?</p>
<p>For those that care the source code is rar'd up and <a href="http://00101010.figmentgames.com/wp-content/uploads/2006/04/GID-j-asm-code.rar">available for download</a>. Although it works fine on my TV that doesn't mean the code is correct so I'd love to hear back from any of the more experienced XGS users if you can see any obvious flaws. The final code weighed in at roughly 374 bytes (don't quote me on that <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) After looking at a few other peoples delay macros I can see a saving of several bytes there alone, so I'm sure this code can be optimised significantly, maybe another day <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Check out the rest of this entry if you want to see the final code</p>
<p><span id="more-52"></span></p>
<p>Be aware the tab settings are a little messed up </p>
<div class="igBar"><span id="lasm-2"><a href="#" onclick="javascript:showCodeTxt('asm-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASM:</span>
<div id="asm-2">
<div class="asm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; GID j - Pixel in a day entry</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Gary Preston 8th April 2006</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">include <span style="color:#EE0000;">"Setup52.inc"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">include <span style="color:#EE0000;">"macros.inc"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Consts</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">BLACK_LEVEL EQU <span style="color:#55AAFF;color:#800000;">6</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">WHITE_LEVEL&nbsp;EQU <span style="color:#55AAFF;color:#800000;">15</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Colors</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VID_SYNC&nbsp; &nbsp;&nbsp; &nbsp;EQU %<span style="color:#55AAFF;color:#800000;">11110000</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; No color + 0v</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VID_BLACK &nbsp; EQU <span style="color:#91FF91; font-weight:bold;">&#40;</span>%<span style="color:#55AAFF;color:#800000;">11110000</span> + BLACK_LEVEL<span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; 0.25-0.3V</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VID_WHITE &nbsp; EQU <span style="color:#91FF91; font-weight:bold;">&#40;</span>%<span style="color:#55AAFF;color:#800000;">11110000</span> + WHITE_LEVEL<span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#999999; font-style:italic;">; 1.0V</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">TEMP_COLOUR EQU %<span style="color:#55AAFF;color:#800000;">00011111</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; yellow</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Color Burst signal</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VID_COLORBURST_OFF EQU <span style="color:#91FF91; font-weight:bold;">&#40;</span>%<span style="color:#55AAFF;color:#800000;">11110000</span> + BLACK_LEVEL<span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">VID_COLORBURST_ON EQU&nbsp; <span style="color:#91FF91; font-weight:bold;">&#40;</span>%<span style="color:#55AAFF;color:#800000;">00000000</span> + BLACK_LEVEL<span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Variables</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">;----------------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; $00 - 09 - registers (05-09 = ports RA-RE)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; 0A - 0F - globals</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Banks (00-0F, 10-1F, 20-2F ... F0-FF) bank 0 via semi-direct only</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">;----------------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; GLOBALS (Not available using semi-direct!)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ORG&nbsp;$0A&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; skip past global registers and banks 1-F</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">counter&nbsp;DS&nbsp; &nbsp;<span style="color:#55AAFF;color:#800000;">1</span>&nbsp; <span style="color:#999999; font-style:italic;">; counter required by delay macro</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">;----------------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; defines for TV Signal generation using Bank 1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ORG $<span style="color:#55AAFF;color:#800000;">10</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">BANK_VIDEO EQU $</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pixels &nbsp;&nbsp;&nbsp;DS <span style="color:#55AAFF;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">scanline &nbsp; &nbsp;&nbsp; &nbsp;DS <span style="color:#55AAFF;color:#800000;">1</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; Program start</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; //////////////////////////////////////////////////////////////////////</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">main</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; Initialise ports for video (RE port tied to video hardware)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #%<span style="color:#55AAFF;color:#800000;">00000000</span>&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; clear port</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;!RE, #%<span style="color:#55AAFF;color:#800000;">00000000</span>&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; set all pins to output</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; --------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; Video Kernel (Colour upper nibble, Luma lower nibble)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; VID_CSEL3 (b7) - VID_CSEL0 (b4) </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; VID_ISEL3 (b3) - VID_ISEL0 (b0)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; Tied to port RE0-7</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; PAL 5Mhz </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">;&nbsp; &nbsp;312 scan lines</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">;&nbsp; &nbsp;pixel every 181.81ns approx 292 pixels per line (53.1us / 181.81ns) </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; set bank</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; _bank&nbsp; &nbsp;BANK_VIDEO</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">vidloop&nbsp;&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; we have 312 lines potentially with pal but will use only 192 active</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov scanline, #206&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:scanline_loop</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">;--------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; Horizontal signal component 274 active lines </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; blanking voltage 0.3V for 1.5us (front porch)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #VID_BLACK&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">120</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; horizontal sync 0V delay 4.7us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_SYNC&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">376</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; pre burst breezeway 0.6us voltage 0.3V</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">48</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; color burst 9-10cycles 0.3V for 2.5us (skipping data just delay for now)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #VID_COLORBURST_ON&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">200</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 200-2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; post burst blanking 0.3V 1.6us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov pixels, #255&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2&nbsp; &nbsp;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">128</span>-<span style="color:#55AAFF;color:#800000;">4</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; All the 3 branches following MUST have the same execution time, thus</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#999999; font-style:italic;">; the extra jumps that don't go anywhere</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; black for 141 pixels (2037 cycles) and color for 12 (174 cycles)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; color for 12 pixels (174 cycles)&nbsp; &nbsp; </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cjb scanline, #97, :skipcolor1&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 4/6</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; cja scanline, #109, :skipcolor2&nbsp;&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; 4/6</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span><span style="color:#55AAFF;color:#800000;">2037</span>-<span style="color:#55AAFF;color:#800000;">10</span><span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #TEMP_COLOUR&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2 setup pixel colour&nbsp; </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; jmp :color&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 3</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:skipcolor2</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span><span style="color:#55AAFF;color:#800000;">2037</span>-<span style="color:#55AAFF;color:#800000;">12</span><span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; nop&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; nop</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; jmp :color&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 3</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:skipcolor1</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span><span style="color:#55AAFF;color:#800000;">2037</span>-<span style="color:#55AAFF;color:#800000;">6</span><span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; nop&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; nop</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; jmp :color&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 3</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:color</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">174</span>-<span style="color:#55AAFF;color:#800000;">5</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; black for 141 pixels (2037 cycles)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2 setup pixel colour&nbsp; </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span><span style="color:#55AAFF;color:#800000;">2037</span>-<span style="color:#55AAFF;color:#800000;">6</span><span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; inc following jump</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; djnz scanline, :scanline_loop&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2/4 (extra 2 from 4 is unaccounted for!)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#999999; font-style:italic;">; END of Horizontal Component (total scanline = 64us)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#999999; font-style:italic;">; we're 2 clock cycles over!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; ---------------------------------------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; OVERSCAN BOTTOM</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; ---------------------------------------------------------------------------------------------&nbsp;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov scanline, #50&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> verscan_bottom</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">;--------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; Horizontal signal component 274 active lines </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; blanking voltage 0.3V for 1.5us (front porch)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #VID_BLACK&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">120</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; horizontal sync 0V delay 4.7us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_SYNC&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">376</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; pre burst breezeway 0.6us voltage 0.3V</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">48</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; color burst 9-10cycles 0.3V for 2.5us (skipping data just delay for now)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #VID_COLORBURST_ON&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">200</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 200-2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; post burst blanking 0.3V 1.6us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov pixels, #255&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2&nbsp; &nbsp;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">128</span>-<span style="color:#55AAFF;color:#800000;">4</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; draw full scanline (53.1us = 4248 cycles)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">2124</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; 4248 is one full scanline, delay function would overflow with that amount</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">2124</span>-<span style="color:#55AAFF;color:#800000;">4</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; Really need to build a better delay function that supports longer delays</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; djnz scanline, <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> verscan_bottom&nbsp;<span style="color:#999999; font-style:italic;">; 2/4</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; full scanlein = 64us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; ---------------------------------------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; VSYNC LINES</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; ---------------------------------------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov scanline, #5&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:vsync</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 4 sync lines</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_SYNC&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">2560</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; 4248 is one full scanline, delay function would overflow with that amount</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">2560</span>-<span style="color:#55AAFF;color:#800000;">4</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; Really need to build a better delay function that supports longer delays</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; djnz scanline, :vsync&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2/4</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; ---------------------------------------------------------------------------------------------</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; OVERSCAN TOP</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; ---------------------------------------------------------------------------------------------&nbsp;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov scanline, #50&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"> <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> verscan_top</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">;--------------------------------------------------------------</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; Horizontal signal component 274 active lines </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; blanking voltage 0.3V for 1.5us (front porch)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #VID_BLACK&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">120</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; horizontal sync 0V delay 4.7us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_SYNC&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">376</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; pre burst breezeway 0.6us voltage 0.3V</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">48</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; color burst 9-10cycles 0.3V for 2.5us (skipping data just delay for now)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;RE, #VID_COLORBURST_ON&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">200</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 200-2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; post burst blanking 0.3V 1.6us</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov pixels, #255&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2&nbsp; &nbsp;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">128</span>-<span style="color:#55AAFF;color:#800000;">4</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; draw full scanline (53.1us = 4248 cycles)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov RE, #VID_BLACK&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">2124</span>-<span style="color:#55AAFF;color:#800000;">2</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; 4248 is one full scanline, delay function would overflow with that amount</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#55AAFF;color:#800000;">2124</span>-<span style="color:#55AAFF;color:#800000;">4</span> <span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; Really need to build a better delay function that supports longer delays</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; djnz scanline, <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> verscan_top&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2/4</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; jmp &nbsp; &nbsp; vidloop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#999999; font-style:italic;">; 3 </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.figmentgames.com/2006/04/09/gid-j-mission-accomplished/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GID j &#8211; signal generation</title>
		<link>http://blog.figmentgames.com/2006/04/09/gid-j-signal-generation/</link>
		<comments>http://blog.figmentgames.com/2006/04/09/gid-j-signal-generation/#comments</comments>
		<pubDate>Sun, 09 Apr 2006 19:58:52 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[GID]]></category>
		<category><![CDATA[XGS]]></category>

		<guid isPermaLink="false">http://00101010.figmentgames.com/2006/04/09/gid-j-signal-generation/</guid>
		<description><![CDATA[Having nailed the delay code I've spent most of the evening reading up on the SX52 memory architecture and the PAL timing signal. To start with I've created the signal needed for each scanline (see previous blog with timing diagram)
The first attempt didn't go too well

It was only a few minutes though before I realise [...]]]></description>
			<content:encoded><![CDATA[<p>Having nailed the delay code I've spent most of the evening reading up on the SX52 memory architecture and the PAL timing signal. To start with I've created the signal needed for each scanline (see previous blog with timing diagram)</p>
<p>The first attempt didn't go too well</p>
<p><img src="http://00101010.figmentgames.com/wp-content/images/xgs/signal-novsync1.jpg" alt="Out of sync" /></p>
<p>It was only a few minutes though before I realise my timing was out by a few clock cycles. The reason? Well in order to generate say the SYNC pulse 0.0V on RE port for 4.7µs we need to delay for 4.7µs*1000/12.5ns = 376 clock cycles, so I did the following </p>
<div class="igBar"><span id="lasm-5"><a href="#" onclick="javascript:showCodeTxt('asm-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASM:</span>
<div id="asm-5">
<div class="asm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mov RE, VID_SYNC</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span><span style="color:#55AAFF;color:#800000;">376</span><span style="color:#91FF91; font-weight:bold;">&#41;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The problem though is that really we've taken up 378 clock cycles and thus the code is executing for 25ns longer than we need it to. Couple this with all the other mov/delay statements for the other parts of the signal and we end up many cycles out of sync. The solution is simple, a mov takes 1 cycle or in the case of a compound mov (which this is) 2 cycles, so we just reduce the delay by 2 cycles to give</p>
<div class="igBar"><span id="lasm-6"><a href="#" onclick="javascript:showCodeTxt('asm-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASM:</span>
<div id="asm-6">
<div class="asm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mov RE, VID_SYNC&nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DELAY<span style="color:#91FF91; font-weight:bold;">&#40;</span><span style="color:#55AAFF;color:#800000;">376</span>-<span style="color:#55AAFF;color:#800000;">2</span><span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 376-2 </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The result is a lot more promising, using VID_WHITE (1.0v) for the output port RE gives us a nice white screen, however we're not finished yet, since there is no handling of the vertical sync yet.</p>
<p><img src="http://00101010.figmentgames.com/wp-content/images/xgs/signal-novsync2.jpg" alt="Out of sync" /></p>
<p>So thats as far as I managed to get by the end of Saturday. I expected to have a good few hours sunday to work on getting the vsync sorted and plotting a specific pixel, but plans change. If I'm lucky I'll squeeze in a few more hours tonight and hopefully finish things off.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.figmentgames.com/2006/04/09/gid-j-signal-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GID j &#8211; Delay Debugging</title>
		<link>http://blog.figmentgames.com/2006/04/08/gid-j-delay-debugging/</link>
		<comments>http://blog.figmentgames.com/2006/04/08/gid-j-delay-debugging/#comments</comments>
		<pubDate>Sat, 08 Apr 2006 18:16:28 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[GID]]></category>
		<category><![CDATA[XGS]]></category>

		<guid isPermaLink="false">http://00101010.figmentgames.com/2006/04/08/gid-j-delay-debugging/</guid>
		<description><![CDATA[GID j posts - first entry
As mentioned in the last blog entry, timing is cricical down to the cycle. In order to make sure all branches of code execute in the exact same amount of time I've created a delay macro. This isn't an optimal method, I'm sure there are ways to reduce the number [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://00101010.figmentgames.com/2006/04/07/gid-j-black-pixels/">GID j posts - first entry</a></p>
<p>As mentioned in the last blog entry, timing is cricical down to the cycle. In order to make sure all branches of code execute in the exact same amount of time I've created a delay macro. This isn't an optimal method, I'm sure there are ways to reduce the number of bytes this uses however it does the job.. at least it does after a little debugging.</p>
<p>After coding up the above I programmed it into the SX52 and put the SXkey into debug mode which allows you to single step the processor one instruction at a time and view the programs memory/registers  and flags. Using various delays of 1, 7, 10, 14 etc I noticed the NOP repeat was only generating a single nop rather than the expected number, this turned out to be because missed the ending ENDR directive</p>
<div class="igBar"><span id="lasm-8"><a href="#" onclick="javascript:showCodeTxt('asm-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ASM:</span>
<div id="asm-8">
<div class="asm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; DELAY for a specified number of clock cycles</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">; EXPECTS: </span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#999999; font-style:italic;">;&nbsp; &nbsp; &quot;counter&quot; 1 byte variable defined</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DELAY MACRO clocks</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#999999; font-style:italic;">; eat up clock cycles 10 at a time</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; IF <span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#91FF91; font-weight:bold;">&#40;</span>clocks / <span style="color:#55AAFF;color:#800000;">10</span><span style="color:#91FF91; font-weight:bold;">&#41;</span>&gt; <span style="color:#55AAFF;color:#800000;">0</span><span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; mov&nbsp;counter, #<span style="color:#91FF91; font-weight:bold;">&#40;</span>clocks / <span style="color:#55AAFF;color:#800000;">10</span><span style="color:#91FF91; font-weight:bold;">&#41;</span>&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 2</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">:loop</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; jmp $ + <span style="color:#55AAFF;color:#800000;">1</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 3 jmp to next instruction</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; jmp $ + <span style="color:#55AAFF;color:#800000;">1</span>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 3 jmp to next instruction</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; djnz counter, :loop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 2/4&nbsp; (4 if &lt;&gt; zero)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#999999; font-style:italic;">; 10 cycles per loop, 8 for last loop</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; ENDIF</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#999999; font-style:italic;">; handle remaining delay 1-9 using nops </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; IF <span style="color:#91FF91; font-weight:bold;">&#40;</span> <span style="color:#91FF91; font-weight:bold;">&#40;</span>clocks // <span style="color:#55AAFF;color:#800000;">10</span><span style="color:#91FF91; font-weight:bold;">&#41;</span>&gt; <span style="color:#55AAFF;color:#800000;">0</span><span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; REPT <span style="color:#91FF91; font-weight:bold;">&#40;</span>clocks // <span style="color:#55AAFF;color:#800000;">10</span><span style="color:#91FF91; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; NOP&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; <span style="color:#999999; font-style:italic;">; 1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ENDR</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#FFFFFF;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; ENDIF</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ENDM </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The following screenshot (click for a larger view) shows the debugger running the DELAY(14) code and circled in red the lone NOP instruction. A simple mistake putting an extra slash but one which would if not caught render the video output useless. Glad I caught it early, otherwise I might have wasted hours debugging my video code.</p>
<p><a title="delay debug full size" href="http://00101010.figmentgames.com/wp-content/images/xgs/delay-debug.jpg"><img alt="delay debug" title="delay debug" src="http://00101010.figmentgames.com/wp-content/images/xgs/thumb-delay-debug.jpg" /></a></p>
<p>With the delay loop out of the way, its time to final make a start on generating accurate h/v signals. Hopefully by the end of tonight <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.figmentgames.com/2006/04/08/gid-j-delay-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GID j &#8211; Attempt 1 snow</title>
		<link>http://blog.figmentgames.com/2006/04/08/gid-j-attempt-1-snow/</link>
		<comments>http://blog.figmentgames.com/2006/04/08/gid-j-attempt-1-snow/#comments</comments>
		<pubDate>Sat, 08 Apr 2006 14:01:30 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[GID]]></category>
		<category><![CDATA[XGS]]></category>

		<guid isPermaLink="false">http://00101010.figmentgames.com/2006/04/08/gid-j-attempt-1-snow/</guid>
		<description><![CDATA[GID j posts - first entry
Satuday 2pm and I'm a little closer to understanding how to plot a pixel, although only a little. The first attempt to generate a video signal resulted in, well see for yourself, detune a tv channel and look at the white snow, thats pretty close to what I'm looking at [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://00101010.figmentgames.com/2006/04/07/gid-j-black-pixels/">GID j posts - first entry</a></p>
<p>Satuday 2pm and I'm a little closer to understanding how to plot a pixel, although only a little. The first attempt to generate a video signal resulted in, well see for yourself, detune a tv channel and look at the white snow, thats pretty close to what I'm looking at right now <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The reason been, I've not setup any kind of timing for generating the video signal yet but I know that at least I'm outputting to the correct port to generate "a" signal. After a little digging through the XGS docs I've got the information on the PAL signal specs, the main bits of interest are:</p>
<ul>
<li>Front Porch 1.5µs</li>
<li>Active Video 53.1µs</li>
<li>Sync 0V</li>
<li>Black 0.3V</li>
<li>White 1.0V</li>
</ul>
<p>Based on this we can calculate the number of pixels a PAL tv can cope with (@5.5Mhz), we can change the signal at a rate of 1/5.5Mhz = 182ns which gives us 53.1µs / 182ns = 292 pixels per scanline (best case; although I think my tv will do 720 due to extra bandwidth, but we'll go for a conservative value)</p>
<p>So in order to get a pixel (assuming no colour) on the screen I need to generate a  video signal to display 312 scanlines each comprised of at most 292 pixels. Heres the full scanline signal needed for a PAL system. (I'm ignoring colour burst for now; image obtained from <a title="Haagans website" href="http://home6.inet.tele.dk/haagen/palref.htm">Haagans website</a>)</p>
<p><img alt="Pal Sync signal" title="Pal Sync signal" src="http://00101010.figmentgames.com/wp-content/images/xgs/palref.jpg" /></p>
<p>Once the horizontal signal is up and running the vertical signal should be a snap, its nothing more than another timing signal, so we'll be sending a H Sync signal for each line followed by 4-10 lines of vsync. I'm keeping this simple and going for 274 lines at 50Hz (50 frames per second) with 16 blank lines top/bottom to account for tv variations and the 6 lines of vsync giving a total of 312 lines.</p>
<p>The key to this is the timing, with the SX52 processor that the XGS uses running at 80Mhz, 1 clock cycle = 12.5ns we need to ensure that the number of cycles used to generate the signal matches the above timing diagram.</p>
<p>There is a whole lot more to the signal generation than the overview above, if you're really interested in the details either get the XGS and read the book (which in addition covers designing and building the actual video hardware) or google it.</p>
<p>So the plan for the larger part of today is to get a suitable delay macro up and running and outputting the appropriate voltages to generate a stable H/V signal. Initially using a fixed value for each pixel (we'll get to plotting a single specific pixel later.. for now its a screen fill) Fingers crossed that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.figmentgames.com/2006/04/08/gid-j-attempt-1-snow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GID j &#8211; Black Pixels</title>
		<link>http://blog.figmentgames.com/2006/04/07/gid-j-black-pixels/</link>
		<comments>http://blog.figmentgames.com/2006/04/07/gid-j-black-pixels/#comments</comments>
		<pubDate>Fri, 07 Apr 2006 22:50:45 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[GID]]></category>
		<category><![CDATA[XGS]]></category>

		<guid isPermaLink="false">http://00101010.figmentgames.com/2006/04/07/gid-j-black-pixels/</guid>
		<description><![CDATA[Its that time of the month again, we're now on GID j, for a change I thought I'd code something for the XGS. I sense this GID is going to be rather painful just setting things up ready for tomorrows start brought problems.
Lesson1: When routing the video/audio output through your digital tv card and you [...]]]></description>
			<content:encoded><![CDATA[<p>Its that time of the month again, we're now on GID j, for a change I thought I'd code something for the XGS. I sense this GID is going to be rather painful just setting things up ready for tomorrows start brought problems.</p>
<p>Lesson1: When routing the video/audio output through your digital tv card and you only get black and white check the Crystal. I'd forgot that the last time I used the XGS I'd hooked it up to my TV which supports PAL or NTSC and had been playing around with some of the NTSC only demos. I'd left the 3.57Mhz crystal in the XGS rather than the 4.43Mhz crystal needed for PAL output.</p>
<p>Lesson2: Prepare for things to only get worse from here on in. This little voice keeps telling me this is a bad idea. Trying to learn the details of programming a chip such as the SX52 and assosiated hardware is bad enough, but considering how rusty my asm skills are we're in for a bumpy ride.</p>
<p>The chances of a successful GID appear to be slim to say the least, so I'm lowering my expectation (and I mean reeeealy lowering) and instead doing a PID; pixel in a day (if you hadn't already guessed ). In other words, if I manage to get a pixel up on the screen within the time constraints of this GID I'll be happy, anything beyond that is a bonus. On a good note I've already written code to handle interfacing with the joystick port (see previous blog) so if we can get a pixel up, maybe we can get it moving, perhaps even a several pixels <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Hey with 4k of direct memory who knows we may even get as far as displaying a sprite, maybe two but lets not get too carried away.</p>
<p>Anyhow the XGS is rigged up with video/audio routed through my pc to make for easier screen grabs (erm that is assuming we get as far as displaying anything, otherwise you're in for some code dumps instead <img src='http://blog.figmentgames.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) so, for what remains of Friday night and a few hours of Saturday morning I'm going to hit the SX Programming manuals and read over the XGS hardware specs.</p>
<p>I think this first calls for a fresh cuppa.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.figmentgames.com/2006/04/07/gid-j-black-pixels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
