<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=Z80%3AEdit_Buffers</id>
	<title>Z80:Edit Buffers - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=Z80%3AEdit_Buffers"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;action=history"/>
	<updated>2026-05-13T11:56:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;diff=414&amp;oldid=prev</id>
		<title>KermMartian at 08:22, 6 February 2016</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;diff=414&amp;oldid=prev"/>
		<updated>2016-02-06T08:22:32Z</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 08:22, 6 February 2016&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-l43&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&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;So now that we have a block of memory defined for our buffer, we need someway for user input to be stored. Since most buffers hold text inputted from users, we&amp;#039;ll create code that allows users to press buttons corresponding with the letter. To do this, we&amp;#039;ll use a table of values (for size and speed).&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;So now that we have a block of memory defined for our buffer, we need someway for user input to be stored. Since most buffers hold text inputted from users, we&amp;#039;ll create code that allows users to press buttons corresponding with the letter. To do this, we&amp;#039;ll use a table of values (for size and speed).&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;(copied parts from [[Z80:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;buffer-tables&lt;/del&gt;|buffer tables]])&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;(copied parts from [[Z80:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Buffer Tables&lt;/ins&gt;|buffer tables]])&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;     Table:&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;     Table:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KermMartian</name></author>
	</entry>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;diff=80&amp;oldid=prev</id>
		<title>KermMartian: Adjusted lowercase z80</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;diff=80&amp;oldid=prev"/>
		<updated>2016-02-03T21:04:36Z</updated>

		<summary type="html">&lt;p&gt;Adjusted lowercase z80&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 21:04, 3 February 2016&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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Introduction =&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;An edit buffer is a place where user input is stored. It can be added to, have something inserted in the middle, have something deleted, and a whole lot more. An example of a text edit buffer would be Notepad. The data being manipulated may be very different, but the general idea is usually close to this.&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;An edit buffer is a place where user input is stored. It can be added to, have something inserted in the middle, have something deleted, and a whole lot more. An example of a text edit buffer would be Notepad. The data being manipulated may be very different, but the general idea is usually close to this.&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-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&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;So now that we have a block of memory defined for our buffer, we need someway for user input to be stored. Since most buffers hold text inputted from users, we&amp;#039;ll create code that allows users to press buttons corresponding with the letter. To do this, we&amp;#039;ll use a table of values (for size and speed).&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;So now that we have a block of memory defined for our buffer, we need someway for user input to be stored. Since most buffers hold text inputted from users, we&amp;#039;ll create code that allows users to press buttons corresponding with the letter. To do this, we&amp;#039;ll use a table of values (for size and speed).&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;(copied parts from [[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;z80&lt;/del&gt;:buffer-tables|buffer tables]])&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;(copied parts from [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Z80&lt;/ins&gt;:buffer-tables|buffer tables]])&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;     Table:&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;     Table:&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-l216&quot;&gt;Line 216:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 212:&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;{{lowercase}}&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;{{lowercase}}&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;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;z80 &lt;/del&gt;Assembly]]&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;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Z80 &lt;/ins&gt;Assembly]]&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;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;z80 &lt;/del&gt;Heaven]]&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;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Z80 &lt;/ins&gt;Heaven]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KermMartian</name></author>
	</entry>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;diff=46&amp;oldid=prev</id>
		<title>KermMartian: Created page with &quot;  = Introduction =  An edit buffer is a place where user input is stored. It can be added to, have something inserted in the middle, have something deleted, and a whole lot mo...&quot;</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=Z80:Edit_Buffers&amp;diff=46&amp;oldid=prev"/>
		<updated>2016-02-03T17:15:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;  = Introduction =  An edit buffer is a place where user input is stored. It can be added to, have something inserted in the middle, have something deleted, and a whole lot mo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
An edit buffer is a place where user input is stored. It can be added to, have something inserted in the middle, have something deleted, and a whole lot more. An example of a text edit buffer would be Notepad. The data being manipulated may be very different, but the general idea is usually close to this.&lt;br /&gt;
&lt;br /&gt;
= Fixed-Length Buffers =&lt;br /&gt;
&lt;br /&gt;
Fixed length buffers are area in memory defined to hold the user input. Commonly, they are used for high score menus where users can input there name. They are fixed length because they have a defined beginning and ending point, and generally are continuous (no gaps between parts of the buffer). &lt;br /&gt;
&lt;br /&gt;
== Setting it up ==&lt;br /&gt;
&lt;br /&gt;
To set up a buffer, you need to define the beginning or end. Whether you do this in code or just in your head, it doesn&amp;#039;t really matter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ;start of our buffer is appbackupscreen, end is appbackupscreen+20&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    .define bufStart appbackupscreen&lt;br /&gt;
    .define bufEnd appbackupscreen+20&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    bufStart:&lt;br /&gt;
    .db 0,0,0,0,0,0,0,0,0,0&lt;br /&gt;
    .db 0,0,0,0,0,0,0,0,0,0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We&amp;#039;ll also need a buffer pointer. This is where the user input is being stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    .define bpoint appbackupscreen+21&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    bpoint:&lt;br /&gt;
    .db 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ld b,0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The Code ==&lt;br /&gt;
&lt;br /&gt;
=== Buffer Table ===&lt;br /&gt;
&lt;br /&gt;
So now that we have a block of memory defined for our buffer, we need someway for user input to be stored. Since most buffers hold text inputted from users, we&amp;#039;ll create code that allows users to press buttons corresponding with the letter. To do this, we&amp;#039;ll use a table of values (for size and speed).&lt;br /&gt;
&lt;br /&gt;
(copied parts from [[z80:buffer-tables|buffer tables]])&lt;br /&gt;
&lt;br /&gt;
    Table:&lt;br /&gt;
     .db &amp;#039;A&amp;#039;        ;9A        kCapA&lt;br /&gt;
     .db &amp;#039;B&amp;#039;        ;9B        kCapB&lt;br /&gt;
     .db &amp;#039;C&amp;#039;        ;9C        kCapC&lt;br /&gt;
     .db &amp;#039;D&amp;#039;        ;9D        kCapD&lt;br /&gt;
     .db &amp;#039;E&amp;#039;        ;9E        kCapE&lt;br /&gt;
     .db &amp;#039;F&amp;#039;        ;9F        kCapF&lt;br /&gt;
    &lt;br /&gt;
     .db &amp;#039;G&amp;#039;        ;A0        kCapG&lt;br /&gt;
     .db &amp;#039;H&amp;#039;        ;A1        kCapH&lt;br /&gt;
     .db &amp;#039;I&amp;#039;        ;A2        kCapI&lt;br /&gt;
     .db &amp;#039;J&amp;#039;        ;A3        kCapJ&lt;br /&gt;
     .db &amp;#039;K&amp;#039;        ;A4        kCapK&lt;br /&gt;
     .db &amp;#039;L&amp;#039;        ;A5        kCapL&lt;br /&gt;
     .db &amp;#039;M&amp;#039;        ;A6        kCapM&lt;br /&gt;
     .db &amp;#039;N&amp;#039;        ;A7        kCapN&lt;br /&gt;
     .db &amp;#039;O&amp;#039;        ;A8        kCapO&lt;br /&gt;
     .db &amp;#039;P&amp;#039;        ;A9        kCapP&lt;br /&gt;
     .db &amp;#039;Q&amp;#039;        ;AA        kCapQ&lt;br /&gt;
     .db &amp;#039;R&amp;#039;        ;AB        kCapR&lt;br /&gt;
     .db &amp;#039;S&amp;#039;        ;AC        kCapS&lt;br /&gt;
     .db &amp;#039;T&amp;#039;        ;AD        kCapT&lt;br /&gt;
     .db &amp;#039;U&amp;#039;        ;AE        kCapU&lt;br /&gt;
     .db &amp;#039;V&amp;#039;        ;AF        kCapV&lt;br /&gt;
    &lt;br /&gt;
     .db &amp;#039;W&amp;#039;        ;B0        kCapW&lt;br /&gt;
     .db &amp;#039;X&amp;#039;        ;B1        kCapX&lt;br /&gt;
     .db &amp;#039;Y&amp;#039;        ;B2        kCapY&lt;br /&gt;
     .db &amp;#039;Z&amp;#039;        ;B3        kCapZ&lt;br /&gt;
     .db &amp;#039;X&amp;#039;        ;B4        kVarX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Key presses and bound checking ===&lt;br /&gt;
&lt;br /&gt;
That table works well with the Getkey ROM call. We&amp;#039;ll also need a way to check for invalid keypresses. Since all the values greater than $B4 are invalid, and all the values less than $9A are also invalid, and everything else is valid, we&amp;#039;ll use these limits as our check. We also need a way to check for &amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;special keys&amp;lt;/span&amp;gt; (keys that when pressed perform a special action, such as pressing [ENTER] to finish editing, or [CLEAR] to empty the buffer, etc.), and a limit test so we don&amp;#039;t overwrite the buffer&amp;#039;s bounds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    Keyloop:&lt;br /&gt;
     bcall(_GetKey)&lt;br /&gt;
    &lt;br /&gt;
     cp kEnter&lt;br /&gt;
     jr z,editDone&lt;br /&gt;
    &lt;br /&gt;
     ld c,a&lt;br /&gt;
     ld a,b&lt;br /&gt;
     cp 20&lt;br /&gt;
     jr nc,Keyloop&lt;br /&gt;
     ld a,c&lt;br /&gt;
    &lt;br /&gt;
     cp $B5&lt;br /&gt;
     jr nc,Keyloop&lt;br /&gt;
     cp $9A&lt;br /&gt;
     jr c,keyloop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Data conversion and saving ===&lt;br /&gt;
&lt;br /&gt;
And now for a way to translate key pressed into the data we want.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ld hl,table&lt;br /&gt;
    ld e,a&lt;br /&gt;
    ld d,0&lt;br /&gt;
    add hl,de&lt;br /&gt;
    ld a,(hl)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To finish, we&amp;#039;ll store this value into the buffer, and advance the buffer counter, and repeat.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ld hl,bufStart&lt;br /&gt;
    ld e,b&lt;br /&gt;
    ld d,0&lt;br /&gt;
    add hl,de&lt;br /&gt;
    ld (hl),a&lt;br /&gt;
    jr keyloop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Working fixed-length buffer ===&lt;br /&gt;
&lt;br /&gt;
And the full code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    start:&lt;br /&gt;
     ld b,0						;buffer pointer&lt;br /&gt;
    Keyloop:&lt;br /&gt;
     bcall(_GetKey)&lt;br /&gt;
    &lt;br /&gt;
     cp kEnter						;special key enter&lt;br /&gt;
     jr z,editDone&lt;br /&gt;
    &lt;br /&gt;
     ld c,a						;check to see if buffer is full&lt;br /&gt;
     ld a,b&lt;br /&gt;
     cp 20&lt;br /&gt;
     jr nc,Keyloop&lt;br /&gt;
     ld a,c&lt;br /&gt;
    &lt;br /&gt;
     cp $B5						;check for valid input&lt;br /&gt;
     jr nc,Keyloop&lt;br /&gt;
     cp $9A&lt;br /&gt;
     jr c,keyloop&lt;br /&gt;
    &lt;br /&gt;
     ld hl,table						;get character&lt;br /&gt;
     ld e,a&lt;br /&gt;
     ld d,0&lt;br /&gt;
     add hl,de&lt;br /&gt;
     ld a,(hl)&lt;br /&gt;
    &lt;br /&gt;
     ld hl,bufStart					;save&lt;br /&gt;
     ld e,b&lt;br /&gt;
     ld d,0&lt;br /&gt;
     add hl,de&lt;br /&gt;
     ld (hl),a&lt;br /&gt;
    &lt;br /&gt;
     jr keyloop&lt;br /&gt;
    &lt;br /&gt;
    editDone:&lt;br /&gt;
     ret						;for now, just quit&lt;br /&gt;
    &lt;br /&gt;
    bufStart;&lt;br /&gt;
    .db 0,0,0,0,0,0,0,0,0,0&lt;br /&gt;
    .db 0,0,0,0,0,0,0,0,0,0&lt;br /&gt;
    Table:&lt;br /&gt;
     .db &amp;#039;A&amp;#039;        ;9A        kCapA&lt;br /&gt;
     .db &amp;#039;B&amp;#039;        ;9B        kCapB&lt;br /&gt;
     .db &amp;#039;C&amp;#039;        ;9C        kCapC&lt;br /&gt;
     .db &amp;#039;D&amp;#039;        ;9D        kCapD&lt;br /&gt;
     .db &amp;#039;E&amp;#039;        ;9E        kCapE&lt;br /&gt;
     .db &amp;#039;F&amp;#039;        ;9F        kCapF&lt;br /&gt;
    &lt;br /&gt;
     .db &amp;#039;G&amp;#039;        ;A0        kCapG&lt;br /&gt;
     .db &amp;#039;H&amp;#039;        ;A1        kCapH&lt;br /&gt;
     .db &amp;#039;I&amp;#039;        ;A2        kCapI&lt;br /&gt;
     .db &amp;#039;J&amp;#039;        ;A3        kCapJ&lt;br /&gt;
     .db &amp;#039;K&amp;#039;        ;A4        kCapK&lt;br /&gt;
     .db &amp;#039;L&amp;#039;        ;A5        kCapL&lt;br /&gt;
     .db &amp;#039;M&amp;#039;        ;A6        kCapM&lt;br /&gt;
     .db &amp;#039;N&amp;#039;        ;A7        kCapN&lt;br /&gt;
     .db &amp;#039;O&amp;#039;        ;A8        kCapO&lt;br /&gt;
     .db &amp;#039;P&amp;#039;        ;A9        kCapP&lt;br /&gt;
     .db &amp;#039;Q&amp;#039;        ;AA        kCapQ&lt;br /&gt;
     .db &amp;#039;R&amp;#039;        ;AB        kCapR&lt;br /&gt;
     .db &amp;#039;S&amp;#039;        ;AC        kCapS&lt;br /&gt;
     .db &amp;#039;T&amp;#039;        ;AD        kCapT&lt;br /&gt;
     .db &amp;#039;U&amp;#039;        ;AE        kCapU&lt;br /&gt;
     .db &amp;#039;V&amp;#039;        ;AF        kCapV&lt;br /&gt;
    &lt;br /&gt;
     .db &amp;#039;W&amp;#039;        ;B0        kCapW&lt;br /&gt;
     .db &amp;#039;X&amp;#039;        ;B1        kCapX&lt;br /&gt;
     .db &amp;#039;Y&amp;#039;        ;B2        kCapY&lt;br /&gt;
     .db &amp;#039;Z&amp;#039;        ;B3        kCapZ&lt;br /&gt;
     .db &amp;#039;X&amp;#039;        ;B4        kVarX&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Dynamic Buffers =&lt;br /&gt;
&lt;br /&gt;
== Opening the buffer ==&lt;br /&gt;
&lt;br /&gt;
== Writing to the buffer ==&lt;br /&gt;
&lt;br /&gt;
== Insertion/Deleting ==&lt;br /&gt;
&lt;br /&gt;
== Closing the buffer ==&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
{{lowercase}}&lt;br /&gt;
[[Category:z80 Assembly]]&lt;br /&gt;
[[Category:z80 Heaven]]&lt;/div&gt;</summary>
		<author><name>KermMartian</name></author>
	</entry>
</feed>