<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=Earx_fast_line_algorithm</id>
	<title>Earx fast line algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=Earx_fast_line_algorithm"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;action=history"/>
	<updated>2026-07-26T06:01:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;diff=12978&amp;oldid=prev</id>
		<title>&gt;Silver Surfer: Added category</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;diff=12978&amp;oldid=prev"/>
		<updated>2009-05-02T17:06:37Z</updated>

		<summary type="html">&lt;p&gt;Added category&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:06, 2 May 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l194&quot;&gt;Line 194:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 194:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-------------------------------------==================== EarX/fUn =========&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;-------------------------------------==================== EarX/fUn =========&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Programming]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>&gt;Silver Surfer</name></author>
	</entry>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;diff=12977&amp;oldid=prev</id>
		<title>&gt;Simonsunnyboy at 09:13, 26 July 2008</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;diff=12977&amp;oldid=prev"/>
		<updated>2008-07-26T09:13:20Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:13, 26 July 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l73&quot;&gt;Line 73:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 73:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the initializing part.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the initializing part.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The big  difference  with bresenham  algo is  that this  uses  floating-point&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;The big  difference  with bresenham  algo is  that this  uses  floating-point&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;numbers whereas bresenham only uses integers....&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;numbers whereas bresenham only uses integers....&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;...What's that??......I hear a voice screaming from far away....&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;...What's that??......I hear a voice screaming from far away....&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l85&quot;&gt;Line 85:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 85:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;cheap fixed point numbers! HARHAR!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;cheap fixed point numbers! HARHAR!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½&lt;/del&gt;&amp;lt; Trunc(d) &amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½ &lt;/del&gt;statement from  the Pascal-source  can easily be  translated&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;lt; Trunc(d) &amp;gt; statement from  the Pascal-source  can easily be  translated&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;into: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½&lt;/del&gt;&amp;lt; swap d0 &amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½ &lt;/del&gt;on the 68000 :-) Comprendez? Non? Well.. Let's say you have&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;into: &amp;lt; swap d0 &amp;gt; on the 68000 :-) Comprendez? Non? Well.. Let's say you have&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a 68000  register like d0. This  contains 32 bits. Now you can divide this up&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a 68000  register like d0. This  contains 32 bits. Now you can divide this up&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;into two spaces: the upper 16 bits for the integer part and the lower 16 bits&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;into two spaces: the upper 16 bits for the integer part and the lower 16 bits&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;for  the fractational  part. What  the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½&lt;/del&gt;&amp;lt; swap &amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½ &lt;/del&gt;instruction does is only swap&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;for  the fractational  part. What  the &amp;lt; swap &amp;gt; instruction does is only swap&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the upper part with lower part so you can use the integer part of the number!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;the upper part with lower part so you can use the integer part of the number!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l95&quot;&gt;Line 95:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 95:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;technique  as the Pascal  algorithm, but  only now with  a bit of fixed point&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;technique  as the Pascal  algorithm, but  only now with  a bit of fixed point&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;techniques  and  further optimisations. Ofcourse  we can't  get  rid  of  the&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;techniques  and  further optimisations. Ofcourse  we can't  get  rid  of  the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;division  instruction, but  we  can  make a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½&lt;/del&gt;&amp;lt; divu.w &amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ï¿½ &lt;/del&gt;out of  this with some&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;division  instruction, but  we  can  make a &amp;lt; divu.w &amp;gt; out of  this with some&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;effort.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;effort.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l188&quot;&gt;Line 188:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 188:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The  future: This  routine  is almost  as fast  as it gets. There is only two&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The  future: This  routine  is almost  as fast  as it gets. There is only two&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;things you could do to make it even faster:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;things you could do to make it even faster:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;1) Code specific main loops for special steepnesses. ( steepness&amp;lt;1/8 , steepness&amp;lt;1/4, etc..) I really want to do this. This could boost the speed by 20-30% (!)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;1) Code specific main loops for special steepnesses. ( steepness&amp;lt;1/8 , steepness&amp;lt;1/4, etc..) I really want to do this. This could boost the speed by 20-30% (!)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>&gt;Simonsunnyboy</name></author>
	</entry>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;diff=12976&amp;oldid=prev</id>
		<title>&gt;Simonsunnyboy at 09:12, 26 July 2008</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=Earx_fast_line_algorithm&amp;diff=12976&amp;oldid=prev"/>
		<updated>2008-07-26T09:12:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Wikified by Simon Sunnyboy / Paradize                   &lt;br /&gt;
&lt;br /&gt;
== Fast line drawing algorithm ==&lt;br /&gt;
by Earx/Lienout&lt;br /&gt;
&lt;br /&gt;
'''FUCK BRESENHAM!'''&lt;br /&gt;
&lt;br /&gt;
After that powerful title that could start world war III, you probably expect&lt;br /&gt;
something mindboggling... something cunning.... something like:&lt;br /&gt;
&lt;br /&gt;
''A replacement for the bresenham algorithm?!?!''&lt;br /&gt;
&lt;br /&gt;
For those  of you that don't  know what the  hell that is, I should say: &amp;quot;And&lt;br /&gt;
you call yourself a coder!&amp;quot; ;-)&lt;br /&gt;
The bresenham algo relies on first calculating a few simple discriminants. In&lt;br /&gt;
the main loop these discriminants added to/subtracted from eachother. This is&lt;br /&gt;
quite  effecient, because  the loop  only consists  of some  simple  and fast&lt;br /&gt;
instructions.&lt;br /&gt;
&lt;br /&gt;
Let's cut  the crap and  get to it. I found out a quite simple algorithm that&lt;br /&gt;
beats the old bresenham to it. It is based on the following incredibly simple&lt;br /&gt;
math &amp;gt;&amp;gt;&amp;gt;&amp;gt; steepness = dX/dY &amp;gt;&amp;gt;&amp;gt;&amp;gt; Where  dX  is  the  difference  between  the&lt;br /&gt;
x-coordinate  of point  1 and point  2 of the line and dY is the same for the&lt;br /&gt;
y-coordinate.&lt;br /&gt;
&lt;br /&gt;
OK, let's  get to the code then, shall we? Here is it in dumb Pascal. And all&lt;br /&gt;
you  speedfreaks: don't  worry, I know  this  isn't neccessarily  faster than&lt;br /&gt;
Bresenham, but the assembler version is!!&lt;br /&gt;
&lt;br /&gt;
===sourcecode 1===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Procedure DrawLine(integer: X1, X2, Y1, Y2)&lt;br /&gt;
var&lt;br /&gt;
  X, Y, dX, dY: integer;&lt;br /&gt;
  steepness, d: real;&lt;br /&gt;
begin&lt;br /&gt;
  dX:=X2-X1;&lt;br /&gt;
  dY:=Y2-Y1;&lt;br /&gt;
  if dX &amp;gt; dY then&lt;br /&gt;
{The loop for the situation where dX &amp;gt; dY}&lt;br /&gt;
  begin&lt;br /&gt;
    steepness:=dY/dX&lt;br /&gt;
    d:=Y1;&lt;br /&gt;
    for X:=X1 to X2 do&lt;br /&gt;
    begin&lt;br /&gt;
      PutPixel(X, Trunc(d), 1);  {plot the pixel by using the integer part}&lt;br /&gt;
      d:=d+steepness;            {add steepness to get the new Y}&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
  else&lt;br /&gt;
{The same loop for the situation where dX =&amp;lt; DY}&lt;br /&gt;
  begin&lt;br /&gt;
    steepness:=dX/dY;&lt;br /&gt;
    d:=X1;&lt;br /&gt;
    for Y:=Y1 to Y2 do&lt;br /&gt;
    begin&lt;br /&gt;
      PutPixel(Trunc(d), Y, 1)  {plot the pixel by using the integer part}&lt;br /&gt;
      d:=d+steepness;           {add steepness to get the new X}&lt;br /&gt;
    end;&lt;br /&gt;
  end;&lt;br /&gt;
end;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There  it was  in Pascal. Ofcourse  this still  is slow. And  I'm not talking&lt;br /&gt;
about the  normal Pascal compilers that  are crap, but about the instructions&lt;br /&gt;
used. There  is a floating-point  division at  the initilializing part of the&lt;br /&gt;
procedure, so this is quite slow when the line we want to draw is short (i.e.&lt;br /&gt;
the main loop is done only a few times).&lt;br /&gt;
&lt;br /&gt;
The good thing however, is that only very simple instructions are used in the&lt;br /&gt;
main  loop (for..do  statement). And  ofcourse  the  main  loop  is  executed&lt;br /&gt;
everytime  a pixel is  drawn so that mostly  outweights the executing time of&lt;br /&gt;
the initializing part.&lt;br /&gt;
&lt;br /&gt;
The big  difference  with bresenham  algo is  that this  uses  floating-point&lt;br /&gt;
numbers whereas bresenham only uses integers....&lt;br /&gt;
&lt;br /&gt;
...What's that??......I hear a voice screaming from far away....&lt;br /&gt;
&lt;br /&gt;
Y0u  S0d!!  th@t'5  th3  wh0le  p0inT:  N0t  us1nG  3xpeNs1vE  floating-point&lt;br /&gt;
op3raTi0n5!&lt;br /&gt;
&lt;br /&gt;
Now that might  be true, but in the assembler version for the beautiful 680x0&lt;br /&gt;
series  of processors, we  don't need  that  shit!! We  can do it with fairly&lt;br /&gt;
cheap fixed point numbers! HARHAR!&lt;br /&gt;
&lt;br /&gt;
The ï¿½&amp;lt; Trunc(d) &amp;gt;ï¿½ statement from  the Pascal-source  can easily be  translated&lt;br /&gt;
into: ï¿½&amp;lt; swap d0 &amp;gt;ï¿½ on the 68000 :-) Comprendez? Non? Well.. Let's say you have&lt;br /&gt;
a 68000  register like d0. This  contains 32 bits. Now you can divide this up&lt;br /&gt;
into two spaces: the upper 16 bits for the integer part and the lower 16 bits&lt;br /&gt;
for  the fractational  part. What  the ï¿½&amp;lt; swap &amp;gt;ï¿½ instruction does is only swap&lt;br /&gt;
the upper part with lower part so you can use the integer part of the number!&lt;br /&gt;
&lt;br /&gt;
This is more or less the principle my new routine relies on. It uses the same&lt;br /&gt;
technique  as the Pascal  algorithm, but  only now with  a bit of fixed point&lt;br /&gt;
techniques  and  further optimisations. Ofcourse  we can't  get  rid  of  the&lt;br /&gt;
division  instruction, but  we  can  make a ï¿½&amp;lt; divu.w &amp;gt;ï¿½ out of  this with some&lt;br /&gt;
effort.&lt;br /&gt;
&lt;br /&gt;
The routine I'm about to show here has NO CLIPPING so don't do anything weird&lt;br /&gt;
with it and uses Falcon truecolor mode. (320 pixels wide!) It is a subroutine&lt;br /&gt;
that is called by putting some values in the data-/address-registers.&lt;br /&gt;
&lt;br /&gt;
===Sourcecode 2===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* INPUT: d0.w: X1&lt;br /&gt;
*        d1.w: Y1&lt;br /&gt;
*        d2.w: X2&lt;br /&gt;
*        d3.w: Y2&lt;br /&gt;
*        d6.w: highcolor word (color of line)&lt;br /&gt;
*        a0: start of screenaddress&lt;br /&gt;
DRAW_TRUELINE&lt;br /&gt;
        move.l  d2,d4&lt;br /&gt;
        move.l  d3,d5&lt;br /&gt;
        sub.w   d0,d2                   ; / calculate the absolute&lt;br /&gt;
        bpl.s   .ok                     ; | value of the difference&lt;br /&gt;
        neg.w   d2                      ; \ between X1 and X2&lt;br /&gt;
.ok     sub.w   d1,d3                   ; / calculate the absolute&lt;br /&gt;
        bpl.s   .ok2                    ; | value of the difference&lt;br /&gt;
        neg.w   d3                      ; \ between Y1 and Y2&lt;br /&gt;
.ok2    cmp.w   d2,d3&lt;br /&gt;
        bhi.s   .ver&lt;br /&gt;
* Part for dX &amp;gt; dY&lt;br /&gt;
        cmp.w   d0,d4                   ; / Get the&lt;br /&gt;
        bhs.s   .do2                    ; | heighest&lt;br /&gt;
        exg     d0,d4                   ; | X and Y&lt;br /&gt;
        exg     d1,d5                   ; \ in d4.w and d5.w&lt;br /&gt;
.do2    moveq   #10,d2                  ; \put #640&lt;br /&gt;
        lsl.l   #6,d2                   ; /in d2.l (bytes in scanline)&lt;br /&gt;
        sub.w   d0,d4&lt;br /&gt;
        sub.w   d1,d5&lt;br /&gt;
        add.l   d0,d0&lt;br /&gt;
        adda.l  d0,a0&lt;br /&gt;
        mulu.w  d2,d1&lt;br /&gt;
        adda.l  d1,a0&lt;br /&gt;
        tst.w   d5&lt;br /&gt;
        bpl.s   .shit&lt;br /&gt;
        neg.w   d5                      ; / make the&lt;br /&gt;
        neg.l   d2                      ; | dX absolute&lt;br /&gt;
.shit   swap    d5                      ; | and negate the scanline-&lt;br /&gt;
        addq.w  #1,d4                   ; \ offset if needed&lt;br /&gt;
        divu.w  d4,d5                   ; d5.w: steepness&lt;br /&gt;
        moveq   #0,d0&lt;br /&gt;
        subq.w  #1,d4                   ; d4.w: number of times to loop&lt;br /&gt;
&lt;br /&gt;
.lp2    add.w   d5,d0                   ; / check if you need to jump to&lt;br /&gt;
        bcc.s   .mov                    ; \ the next scanline&lt;br /&gt;
        adda.l  d2,a0                   ; jump to the next scanline&lt;br /&gt;
.mov    move.w  d6,(a0)+                ; plot and go to next pixel&lt;br /&gt;
        dbra    d4,.lp2&lt;br /&gt;
        rts&lt;br /&gt;
&lt;br /&gt;
* Part for dX =&amp;lt; dY&lt;br /&gt;
.ver    cmp.w   d0,d4&lt;br /&gt;
        bhs.s   .do&lt;br /&gt;
        exg     d0,d4&lt;br /&gt;
        exg     d1,d5&lt;br /&gt;
.do     moveq   #10,d2                  ; \put #640&lt;br /&gt;
        lsl.l   #6,d2                   ; /in d2.l (bytes in scanline)&lt;br /&gt;
        sub.w   d0,d4&lt;br /&gt;
        sub.w   d1,d5&lt;br /&gt;
        add.l   d0,d0&lt;br /&gt;
        adda.l  d0,a0&lt;br /&gt;
        mulu.w  d2,d1&lt;br /&gt;
        adda.l  d1,a0                   ; a0: address of first pixel&lt;br /&gt;
        tst.w   d5                      ; / make the&lt;br /&gt;
        bpl.s   .shitt                  ; | dY absolute&lt;br /&gt;
        neg.w   d5                      ; | and negate the scanline-&lt;br /&gt;
        neg.l   d2                      ; \ offset if needed&lt;br /&gt;
.shitt  swap    d4&lt;br /&gt;
        addq.w  #1,d5&lt;br /&gt;
        divu.w  d5,d4                   ; d4.w: steepness&lt;br /&gt;
        moveq   #0,d0&lt;br /&gt;
        subq.w  #1,d5                   ; d5.w: number of times to loop&lt;br /&gt;
&lt;br /&gt;
.lp     add.w   d4,d0                   ; / check if you need to jump to&lt;br /&gt;
        bcc.s   .movie                  ; \ the next pixel in the scanline&lt;br /&gt;
        addq.l  #2,a0                   ; go to next pixel in scanline&lt;br /&gt;
.movie  move.w  d6,(a0)                 ; plot the pixel&lt;br /&gt;
        adda.l  d2,a0                   ; go to next scanline&lt;br /&gt;
        dbra    d5,.lp&lt;br /&gt;
        rts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well.. There you have it then. I tried this and put it up against some of the&lt;br /&gt;
best versions of bresenham linerouts I had and it still came out victorious!&lt;br /&gt;
&lt;br /&gt;
The  future: This  routine  is almost  as fast  as it gets. There is only two&lt;br /&gt;
things you could do to make it even faster:&lt;br /&gt;
1) Code specific main loops for special steepnesses. ( steepness&amp;lt;1/8 , steepness&amp;lt;1/4, etc..) I really want to do this. This could boost the speed by 20-30% (!)&lt;br /&gt;
&lt;br /&gt;
2) Draw the line from both ends, so you decrease the number of loops by 50%! But this  looks a  bit awkward if you ask me: you get a little knot in the middle of the line. So this is fast, but not always pretty.&lt;br /&gt;
&lt;br /&gt;
-------------------------------------==================== EarX/fUn =========&lt;/div&gt;</summary>
		<author><name>&gt;Simonsunnyboy</name></author>
	</entry>
</feed>