<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.c256foenix.com/index.php?action=history&amp;feed=atom&amp;title=System_and_Video_RAM_DMA</id>
	<title>System and Video RAM DMA - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.c256foenix.com/index.php?action=history&amp;feed=atom&amp;title=System_and_Video_RAM_DMA"/>
	<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;action=history"/>
	<updated>2026-05-17T18:08:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;diff=500&amp;oldid=prev</id>
		<title>PJW: /* Proper Sequencing */</title>
		<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;diff=500&amp;oldid=prev"/>
		<updated>2021-01-19T21:12:46Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Proper Sequencing&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:12, 19 January 2021&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-l7&quot; &gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;There are a couple of details to keep in mind with sequencing these sorts of DMA transfers.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;There are a couple of details to keep in mind with sequencing these sorts of DMA transfers.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;First, although VDMA will not stop the processor, SDMA will. You &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;therefor &lt;/del&gt;cannot trigger the VDMA after the SDMA has been triggered, because you will not be able to trigger the VDMA before the SDMA block stops the CPU.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;First, although VDMA will not stop the processor, SDMA will. You &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;therefore &lt;/ins&gt;cannot trigger the VDMA after the SDMA has been triggered, because you will not be able to trigger the VDMA before the SDMA block stops the CPU.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;Second, when transferring from system RAM to video RAM, the VDMA is not necessarily finished when the SDMA is done. Writes can still be pending. This is important to keep in mind because you cannot access video RAM while a VDMA is going on, and you cannot start another VDMA operation while another is still going. So it is recommended that you make sure your VDMA is finished before continuing with your program.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;Second, when transferring from system RAM to video RAM, the VDMA is not necessarily finished when the SDMA is done. Writes can still be pending. This is important to keep in mind because you cannot access video RAM while a VDMA is going on, and you cannot start another VDMA operation while another is still going. So it is recommended that you make sure your VDMA is finished before continuing with your program.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PJW</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;diff=499&amp;oldid=prev</id>
		<title>PJW at 21:11, 19 January 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;diff=499&amp;oldid=prev"/>
		<updated>2021-01-19T21:11:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 21:11, 19 January 2021&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='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;NOTE: this section to be fleshed out later.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;NOTE: this section to be fleshed out later.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Okay&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;this is important message for anybody who has been using &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;SDMA -&amp;gt; VDMA transfer&lt;/del&gt;. For &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;some reasons&lt;/del&gt;, the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;problem comes up on &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;U but never did on &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;FMX&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Anyway, &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;deal is when you &lt;/del&gt;are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;doing &lt;/del&gt;a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;SDMA &lt;/del&gt;to VDMA, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;because &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;CPU takes 100% of &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;bandwidth&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;when &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;transfer takes place, &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;CPU is halted. The &lt;/del&gt;SDMA &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;goes and fetch the data and then when all the data is fetched, &lt;/del&gt;the CPU &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is released&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;This part works fine&lt;/del&gt;, the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;part that I have been having issues on the U, &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the fact that &lt;/del&gt;when the SDMA &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;part &lt;/del&gt;is done&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, it doesn't necessarily means that the &lt;/del&gt;VDMA &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;part &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;done. Since they are very much asynchronous &lt;/del&gt;and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the fact that remainder of the DATA in the FIFO might linger on till the time &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;right to go write that Data and that can take a little of time before it happens&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;When using DMA to transfer data between system and video RAM&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;both the [[System DMA Block]] and &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[Video DMA Block]] have to be configured and used together&lt;/ins&gt;. For &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;example&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;if a program needs to copy data from system RAM into video RAM (e.g. bitmap data) it needs to configure the system DMA block to grab the needed block of system RAM as &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;source, and it needs to configure &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;video DMA block to store that block in &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;correct area of video RAM&lt;/ins&gt;. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;The two DMA blocks will cooperate to do &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;actual transfer.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;So&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, bottom line, that means &lt;/del&gt;that &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;before you can begin a new transfer, &lt;/del&gt;you &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;need to &lt;/del&gt;make sure &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the old one &lt;/del&gt;is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;done&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;So, either you poll the Status Register bit 7 &lt;/del&gt;of the VDMA &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;or you wait for an Interrupt to happen to let you know that &lt;/del&gt;it &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;is finished&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Like I said, I am talking about this now because I never really had any issues like this before&lt;/del&gt;... &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;So, &lt;/del&gt;for the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;concept of having a Kosher way of doing things and also for &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;sake of compatibility with &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;U in &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;future&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Always make sure that when you are doing a SDMA to &lt;/del&gt;VDMA &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Flag is reseted before beginning a new one. Cheers!&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;= Proper Sequencing =&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;There &lt;/ins&gt;are a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;couple of details &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;keep in mind with sequencing these sorts of DMA transfers.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;First, although &lt;/ins&gt;VDMA &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;will not stop the processor&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SDMA will. You therefor cannot trigger &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;VDMA after &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SDMA has been triggered&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;because you will not be able to trigger &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;VDMA before &lt;/ins&gt;the SDMA &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;block stops &lt;/ins&gt;the CPU.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;Second, when transferring from system RAM to video RAM&lt;/ins&gt;, the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;VDMA &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;not necessarily finished &lt;/ins&gt;when the SDMA is done&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. Writes can still be pending. This is important to keep in mind because you cannot access video RAM while a &lt;/ins&gt;VDMA is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;going on, &lt;/ins&gt;and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;you cannot start another VDMA operation while another &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;still going&lt;/ins&gt;. So &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;it is recommended &lt;/ins&gt;that you make sure &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;your VDMA &lt;/ins&gt;is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;finished before continuing with your program&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;The recommended sequence &lt;/ins&gt;of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;actions in setting up system and video DMA operations is:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Enable and configure &lt;/ins&gt;the VDMA &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;but do not trigger &lt;/ins&gt;it.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Enable and configure the SDMA but do not trigger it&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Trigger the VDMA&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Trigger the SDMA&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Execute several NOP instructions to wait &lt;/ins&gt;for the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SDMA controller to halt &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;CPU.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Turn off &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SDMA controller&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Wait for &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;VDMA controller to finish&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;# Turn off the &lt;/ins&gt;VDMA &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;controller&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;The following example illustrates &lt;/ins&gt;the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;correct triggering, wait, and shutdown sequence:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;Below and example of how it should be done:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;  &amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;  &amp;lt;nowiki&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;; Begin Transfer&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;; Begin Transfer&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PJW</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;diff=481&amp;oldid=prev</id>
		<title>PJW: Created page with &quot;NOTE: this section to be fleshed out later.  Okay, this is important message for anybody who has been using the SDMA -&gt; VDMA transfer. For some reasons, the problem comes up o...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.c256foenix.com/index.php?title=System_and_Video_RAM_DMA&amp;diff=481&amp;oldid=prev"/>
		<updated>2021-01-18T21:42:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;NOTE: this section to be fleshed out later.  Okay, this is important message for anybody who has been using the SDMA -&amp;gt; VDMA transfer. For some reasons, the problem comes up o...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;NOTE: this section to be fleshed out later.&lt;br /&gt;
&lt;br /&gt;
Okay, this is important message for anybody who has been using the SDMA -&amp;gt; VDMA transfer. For some reasons, the problem comes up on the U but never did on the FMX. Anyway, the deal is when you are doing a SDMA to VDMA, because the CPU takes 100% of the bandwidth, when the transfer takes place, the CPU is halted. The SDMA goes and fetch the data and then when all the data is fetched, the CPU is released. This part works fine, the part that I have been having issues on the U, is the fact that when the SDMA part is done, it doesn't necessarily means that the VDMA part is done. Since they are very much asynchronous and the fact that remainder of the DATA in the FIFO might linger on till the time is right to go write that Data and that can take a little of time before it happens.&lt;br /&gt;
So, bottom line, that means that before you can begin a new transfer, you need to make sure the old one is done. So, either you poll the Status Register bit 7 of the VDMA or you wait for an Interrupt to happen to let you know that it is finished.&lt;br /&gt;
Like I said, I am talking about this now because I never really had any issues like this before... So, for the concept of having a Kosher way of doing things and also for the sake of compatibility with the U in the future. Always make sure that when you are doing a SDMA to VDMA that the Flag is reseted before beginning a new one. Cheers!&lt;br /&gt;
&lt;br /&gt;
Below and example of how it should be done:&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
; Begin Transfer&lt;br /&gt;
        ; Start the VDMA Controller First&lt;br /&gt;
        LDA VDMA_CONTROL_REG&lt;br /&gt;
        ORA #VDMA_CTRL_Start_TRF&lt;br /&gt;
        STA @l VDMA_CONTROL_REG&lt;br /&gt;
&lt;br /&gt;
        ; Then, Start the SDMA Controller&lt;br /&gt;
&lt;br /&gt;
        LDA SDMA_CTRL_REG0&lt;br /&gt;
        ORA #SDMA_CTRL0_Start_TRF&lt;br /&gt;
        STA @l SDMA_CTRL_REG0&lt;br /&gt;
        NOP ; When the transfer is started the CPU will be put on Hold (RDYn)...&lt;br /&gt;
        NOP ; Before it actually gets to stop it will execute a couple more instructions&lt;br /&gt;
        NOP ; From that point on, the CPU is halted (keep that in mind) No IRQ will be processed either during that time&lt;br /&gt;
        NOP&lt;br /&gt;
        NOP&lt;br /&gt;
        NOP&lt;br /&gt;
        NOP&lt;br /&gt;
        NOP&lt;br /&gt;
&lt;br /&gt;
        LDA #$00&lt;br /&gt;
        STA @l SDMA_CTRL_REG0&lt;br /&gt;
&lt;br /&gt;
NOTFINISHED:&lt;br /&gt;
        LDA @l VDMA_STATUS_REG&lt;br /&gt;
        AND #$80&lt;br /&gt;
        CMP #$80&lt;br /&gt;
        BEQ NOTFINISHED&lt;br /&gt;
        LDA #$00&lt;br /&gt;
        STA @l VDMA_CONTROL_REG&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>PJW</name></author>
		
	</entry>
</feed>