<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Programming%3ACPC_Plus_Vertical_scroll</id>
		<title>Programming:CPC Plus Vertical scroll - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://oldwiki.cpcwiki.eu/index.php?action=history&amp;feed=atom&amp;title=Programming%3ACPC_Plus_Vertical_scroll"/>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;action=history"/>
		<updated>2026-08-28T09:23:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=29311&amp;oldid=prev</id>
		<title>Gryzor: credit box</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=29311&amp;oldid=prev"/>
				<updated>2009-01-27T07:54:48Z</updated>
		
		<summary type="html">&lt;p&gt;credit box&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 07:54, 27 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;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;color:black; 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;From the &lt;/del&gt;'''&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The Unofficial Amstrad WWW Resource&lt;/del&gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;lt;div style=&amp;quot;border: 1px solid rgb(228, 222, 222); margin: 0px 0px 5px; padding: 0.5em 1em; background-color: rgb(249, 249, 249);&amp;quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;lt;center&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;This article originally came from Kevin Thackers&lt;/ins&gt;' &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;archive at [http://www.cpctech.org.uk http://www.cpctech.org.uk].''''' &amp;lt;/center&amp;gt;&amp;lt;/div&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:14877:newid:29311 --&gt;
&lt;/table&gt;</summary>
		<author><name>Gryzor</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=14877&amp;oldid=prev</id>
		<title>Octoate: added category</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=14877&amp;oldid=prev"/>
				<updated>2007-03-12T15:58:49Z</updated>
		
		<summary type="html">&lt;p&gt;added category&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:58, 12 March 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L190&quot; &gt;Line 190:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 190:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;defb &amp;amp;ff,&amp;amp;00,&amp;amp;ff,&amp;amp;77,&amp;amp;b3,&amp;amp;51,&amp;amp;a8,&amp;amp;d4,&amp;amp;62,&amp;amp;39,&amp;amp;9c,&amp;amp;46,&amp;amp;2b,&amp;amp;15,&amp;amp;8a,&amp;amp;cd,&amp;amp;ee&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;defb &amp;amp;ff,&amp;amp;00,&amp;amp;ff,&amp;amp;77,&amp;amp;b3,&amp;amp;51,&amp;amp;a8,&amp;amp;d4,&amp;amp;62,&amp;amp;39,&amp;amp;9c,&amp;amp;46,&amp;amp;2b,&amp;amp;15,&amp;amp;8a,&amp;amp;cd,&amp;amp;ee&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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 colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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:CPC Plus]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;!-- diff cache key wikidb:diff:version:1.11a:oldid:14875:newid:14877 --&gt;
&lt;/table&gt;</summary>
		<author><name>Octoate</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=14875&amp;oldid=prev</id>
		<title>CPCLER at 15:46, 12 March 2007</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=14875&amp;oldid=prev"/>
				<updated>2007-03-12T15:46:16Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:46, 12 March 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;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 colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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;From the '''The Unofficial Amstrad WWW Resource'''&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; 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='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;; This example shows how to scroll the screen vertically using the&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;; This example shows how to scroll the screen vertically using the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff:version:1.11a:oldid:14857:newid:14875 --&gt;
&lt;/table&gt;</summary>
		<author><name>CPCLER</name></author>	</entry>

	<entry>
		<id>https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=14857&amp;oldid=prev</id>
		<title>80.167.220.254 at 13:37, 12 March 2007</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.cpcwiki.eu/index.php?title=Programming:CPC_Plus_Vertical_scroll&amp;diff=14857&amp;oldid=prev"/>
				<updated>2007-03-12T13:37:34Z</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;&amp;lt;pre&amp;gt;&lt;br /&gt;
;; This example shows how to scroll the screen vertically using the&lt;br /&gt;
;; CPC+ &amp;quot;soft&amp;quot; hardware scroll. This scroll is smooth because it will scroll&lt;br /&gt;
;; a scanline at a time.&lt;br /&gt;
;;&lt;br /&gt;
;; This example will only work on the CPC+.&lt;br /&gt;
;;&lt;br /&gt;
;; The scroll is made by changing the start of the screen using the CRTC,&lt;br /&gt;
;; (which will scroll the screen vertically by the number of scanlines defined by register 9),&lt;br /&gt;
;; and a scan-line adjustment defined using the CPC+ &amp;quot;soft&amp;quot; hardware scroll register.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;; The location of this code is important. It must not be located&lt;br /&gt;
;; between &amp;amp;4000-&amp;amp;7fff.&lt;br /&gt;
org &amp;amp;8000&lt;br /&gt;
nolist&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; unlock asic to gain access to asic registers&lt;br /&gt;
di&lt;br /&gt;
ld b,&amp;amp;bc&lt;br /&gt;
ld hl,sequence&lt;br /&gt;
ld e,17&lt;br /&gt;
.seq &lt;br /&gt;
ld a,(hl)&lt;br /&gt;
out (c),a&lt;br /&gt;
inc hl&lt;br /&gt;
dec e&lt;br /&gt;
jr nz,seq&lt;br /&gt;
ei&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; install a interrupt handler&lt;br /&gt;
;;&lt;br /&gt;
;; We install our own interrupt handler for this reason:&lt;br /&gt;
;; - To stop the firmware interrupt from being executed, this will&lt;br /&gt;
;; ensure that our direct access to the hardware will not be interrupted&lt;br /&gt;
;; by the firmware, and that the values we write are not re-written by&lt;br /&gt;
;; the firmware.&lt;br /&gt;
&lt;br /&gt;
di								;; disable interrupts&lt;br /&gt;
im 1							;; set interrupt mode 1 (jump to &amp;amp;0038 when interrupt occurs)&lt;br /&gt;
ld hl,&amp;amp;c9fb						;; EI:RET&lt;br /&gt;
ld (&amp;amp;0038),hl					;; &amp;amp;0038 is executed&lt;br /&gt;
ei&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; main loop&lt;br /&gt;
&lt;br /&gt;
.main_loop&lt;br /&gt;
;; wait for start of vsync. This test assumes that the start of the vsync&lt;br /&gt;
;; has not yet happened.&lt;br /&gt;
&lt;br /&gt;
ld b,&amp;amp;f5&lt;br /&gt;
.ml2&lt;br /&gt;
in a,(c)&lt;br /&gt;
rra&lt;br /&gt;
jr nc,ml2&lt;br /&gt;
&lt;br /&gt;
;; The vsync has just started, we can safely setup the scroll&lt;br /&gt;
;; without the display being effected.&lt;br /&gt;
&lt;br /&gt;
;;-----------------------------------------------------------------------&lt;br /&gt;
;; update vertical scan-line scroll adjustment&lt;br /&gt;
&lt;br /&gt;
;; page in ASIC ram&lt;br /&gt;
;; ASIC registers will be paged into memory range &amp;amp;4000-&amp;amp;7fff&lt;br /&gt;
ld bc,&amp;amp;7fb8&lt;br /&gt;
out (c),c&lt;br /&gt;
&lt;br /&gt;
;; get scan-line scroll adjustment&lt;br /&gt;
ld a,(scanline_offset)&lt;br /&gt;
;; shift into bits required for writing to hardware&lt;br /&gt;
add a,a&lt;br /&gt;
add a,a&lt;br /&gt;
add a,a&lt;br /&gt;
add a,a&lt;br /&gt;
;; write to &amp;quot;soft&amp;quot; hardware scroll register of CPC+&lt;br /&gt;
ld (&amp;amp;6804),a&lt;br /&gt;
&lt;br /&gt;
;; page out ASIC ram&lt;br /&gt;
ld bc,&amp;amp;7fa0&lt;br /&gt;
out (c),c&lt;br /&gt;
&lt;br /&gt;
;;-----------------------------------------------------------------------&lt;br /&gt;
;; update CRTC with scroll offset&lt;br /&gt;
&lt;br /&gt;
ld hl,(scroll_offset)		;; get scroll offset&lt;br /&gt;
&lt;br /&gt;
ld a,h&lt;br /&gt;
or &amp;amp;30					;; This defines the &amp;quot;base&amp;quot; of the screen in 16k units.&lt;br /&gt;
						;; &amp;amp;00 -&amp;gt; screen uses &amp;amp;0000-&amp;amp;3fff&lt;br /&gt;
						;; &amp;amp;10 -&amp;gt; screen uses &amp;amp;4000-&amp;amp;7fff&lt;br /&gt;
						;; &amp;amp;20 -&amp;gt; screen uses &amp;amp;8000-&amp;amp;bfff&lt;br /&gt;
						;; &amp;amp;30 -&amp;gt; screen uses &amp;amp;c000-&amp;amp;ffff&lt;br /&gt;
ld h,a&lt;br /&gt;
&lt;br /&gt;
ld bc,&amp;amp;bc0c				;; select CRTC register 12&lt;br /&gt;
out (c),c&lt;br /&gt;
&lt;br /&gt;
inc b					;; B = &amp;amp;BD&lt;br /&gt;
out (c),h				;; write to CRTC register 12&lt;br /&gt;
&lt;br /&gt;
dec b&lt;br /&gt;
inc c					;; BC = &amp;amp;BC0D&lt;br /&gt;
out (c),c				;; select CRTC register 13&lt;br /&gt;
&lt;br /&gt;
inc b&lt;br /&gt;
out (c),l				;; write to CRTC register 13&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
;; we need to wait long enough for the VSYNC signal to finish, so that the&lt;br /&gt;
;; test at the beginning of this loop will synchronise with the *start* of the&lt;br /&gt;
;; vsync. &lt;br /&gt;
&lt;br /&gt;
;; this first HALT will catch the interrupt that occurs two scanlines from&lt;br /&gt;
;; the start of the VSYNC, the second will delay a furthur 52 scanlines. The maximum&lt;br /&gt;
;; duration for the VSYNC is 16 scanlines.&lt;br /&gt;
halt&lt;br /&gt;
&lt;br /&gt;
halt&lt;br /&gt;
&lt;br /&gt;
;; update the scroll ready for the next update of the display&lt;br /&gt;
call scroll_up&lt;br /&gt;
&lt;br /&gt;
;; loop&lt;br /&gt;
jp main_loop&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; adjust scroll parameters to scroll the screen up&lt;br /&gt;
;;&lt;br /&gt;
;; Each CRTC character is 8 scanlines tall, therefore the CRTC scroll offset &lt;br /&gt;
;; will scroll the screen up by 8 scanlines at a time.&lt;br /&gt;
;;&lt;br /&gt;
;; We use the CPC+ &amp;quot;soft&amp;quot; hardware scroll to set the scanline offset within&lt;br /&gt;
;; each CRTC character.&lt;br /&gt;
;;&lt;br /&gt;
;; The CPC+ &amp;quot;soft&amp;quot; hardware scroll is updated for every scanlines.&lt;br /&gt;
;; The CRTC scroll offset is only updated once for every 8 scanlines.&lt;br /&gt;
&lt;br /&gt;
.scroll_up&lt;br /&gt;
&lt;br /&gt;
;; get scanline offset&lt;br /&gt;
ld a,(scanline_offset)&lt;br /&gt;
inc a&lt;br /&gt;
;; ensure it is in range&lt;br /&gt;
and &amp;amp;7&lt;br /&gt;
;; store scanline offset&lt;br /&gt;
ld (scanline_offset),a&lt;br /&gt;
cp 0&lt;br /&gt;
ret nz&lt;br /&gt;
&lt;br /&gt;
;; by now we have scrolled through 8 scanlines using the CPC+ &amp;quot;soft&amp;quot; hardware&lt;br /&gt;
;; scroll, now we need to update the screen start address &lt;br /&gt;
&lt;br /&gt;
;; get the crtc scroll offset&lt;br /&gt;
ld hl,(scroll_offset)&lt;br /&gt;
&lt;br /&gt;
ld bc,40						;; this is the same as the value written to CRTC register 1&lt;br /&gt;
								;; and defines the width of the display in CRTC characters.&lt;br /&gt;
add hl,bc&lt;br /&gt;
&lt;br /&gt;
ld a,h							;; ensure the scroll offset is in the range &amp;amp;300-&amp;amp;3ff&lt;br /&gt;
and &amp;amp;3&lt;br /&gt;
ld h,a&lt;br /&gt;
&lt;br /&gt;
;; store the crtc scroll offset&lt;br /&gt;
ld (scroll_offset),hl&lt;br /&gt;
ret&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; scroll offset of the screen to be written to CRTC register 12 and 13&lt;br /&gt;
;; This value is defined in &amp;quot;CRTC&amp;quot; characters.&lt;br /&gt;
.scroll_offset&lt;br /&gt;
defw 0&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; holds a number between 0 and 7 which is the scanline adjustment&lt;br /&gt;
;; for the scroll&lt;br /&gt;
.scanline_offset&lt;br /&gt;
defb 0&lt;br /&gt;
&lt;br /&gt;
;;----------------------------------------------------------------------&lt;br /&gt;
;; this is the sequence to unlock the ASIC extra features&lt;br /&gt;
.sequence&lt;br /&gt;
defb &amp;amp;ff,&amp;amp;00,&amp;amp;ff,&amp;amp;77,&amp;amp;b3,&amp;amp;51,&amp;amp;a8,&amp;amp;d4,&amp;amp;62,&amp;amp;39,&amp;amp;9c,&amp;amp;46,&amp;amp;2b,&amp;amp;15,&amp;amp;8a,&amp;amp;cd,&amp;amp;ee&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>80.167.220.254</name></author>	</entry>

	</feed>