Changes

Jump to: navigation, search

Programming:CPC Plus Horizontal scroll

1,042 bytes added, 07:54, 27 January 2009
credit box
<div style="border: 1px solid rgb(228, 222, 222); margin: 0px 0px 5px; padding: 0.5em 1em; background-color: rgb(249, 249, 249);">
<center>
 
'''''This article originally came from Kevin Thackers' archive at [http://www.cpctech.org.uk http://www.cpctech.org.uk].''''' </center></div>
 
<pre>
;; This example shows how to scroll the screen horizonatally using the
defb &ff,&00,&ff,&77,&b3,&51,&a8,&d4,&62,&39,&9c,&46,&2b,&15,&8a,&cd,&ee
</pre>
 
User Fano has this to say:
There seems to have an error in "CPC Plus Horizontal scroll".It doesn't work properly on winape.Could you test it on a real CPC+ to be sure ?
 
I just wrote a little fix in case of (ln142-156)
 
<pre>
The horizontal pixel scroll offset is updated for every pixel.
;; The CRTC scroll offset is updated for every CRTC character (every 16 pixels in mode 2
;; OR every 8 pixels in mode 1 OR every 4 pixels in mode 0).
 
scroll_speed EQU 2 ;; increments for pixel scrolling:
;; 1 for mode 2
;; 2 for mode 1
;; 4 for mode 0
 
 
.scroll_right
;; get horizontal pixel scroll offset
ld a,(horz_pixel_offset)
sub scroll_speed
and &f
ld (horz_pixel_offset),a
cp 16-scroll_speed
ret nz</pre>
 
[[Category:CPC Plus]]
[[Category:Programming]]
1,963
edits