making_full_use_of_memory_ports
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
making_full_use_of_memory_ports [2020/10/11 23:57] – [Accessing ports from a display list] laubzega | making_full_use_of_memory_ports [2020/10/13 20:02] – [Accessing ports from a display list] laubzega | ||
---|---|---|---|
Line 13: | Line 13: | ||
==== REP0 and REP1 ==== | ==== REP0 and REP1 ==== | ||
- | As you remember from the introductory chapter, writing a value to register '' | + | As you remember from the introductory chapter, writing a value to register '' |
< | < | ||
Line 120: | Line 120: | ||
While this approach is faster than copying data in C64 base memory (you can use the simplest addressing modes, and don't have to worry about updating the source and destination addresses), it still is far below theoretical throughput of the ports - even with unrolled loops the best we can do is around 8 cycles per byte (< | While this approach is faster than copying data in C64 base memory (you can use the simplest addressing modes, and don't have to worry about updating the source and destination addresses), it still is far below theoretical throughput of the ports - even with unrolled loops the best we can do is around 8 cycles per byte (< | ||
- | As you might have already suspected, we can side-step the CPU entirely, and copy data directly using ports' DMA channels. This mode is activated by activating | + | As you might have already suspected, we can side-step the CPU entirely, and copy data directly using ports' DMA channels. This mode is activated by setting |
< | < | ||
Line 140: | Line 140: | ||
| | ||
LDA #0 ; As previously, " | LDA #0 ; As previously, " | ||
- | STA VREG_REP1 | + | STA VREG_REP1 |
</ | </ | ||
Line 161: | Line 161: | ||
Final two comments: | Final two comments: | ||
- Because of how DMA channels are allocated within a cycle, accelerated copying is only possible | - Because of how DMA channels are allocated within a cycle, accelerated copying is only possible | ||
- | - '' | + | - '' |
For comprehensive example demonstrating use of all these features, please see [[https:// | For comprehensive example demonstrating use of all these features, please see [[https:// | ||
Line 217: | Line 217: | ||
</ | </ | ||
- | Will read a value from PORT1, and store it in VIC border color register. Here is a more complete example using PORT0. | + | will read a value from PORT1, and store it in VIC border color register. Here is a more complete example using PORT0. |
<code vasyl> | <code vasyl> |
making_full_use_of_memory_ports.txt · Last modified: 2020/10/18 21:56 by laubzega