Dixel Scrolling (2 pixel at a time scroll)

This is not my routine. I just saw this on the https://spectrumcomputing.co.uk/ forums and thought I should place it here for further study.

YOUR SINCLAIR
July 1987
page 74

Richard Alexander
sent in a bit of code that will do a Dixel Scroll
scrolling two pixels at a time to the whole screen.
This makes for faster movement with a little loss
of smoothness.


; Your Sinclair issue 19 page 74
; it still needs a full loop

org 32000
        di
        ld bc,6144
        ld hl,22527
loop:   srl (hl)
        call c,sub1
        srl (hl)
        call c,sub2
        dec hl
        dec bc
        ld a,b
        or c
        jr nz,loop
        ei
        ret
sub1    inc hl
        set 6,(hl)
        dec hl
        ret
sub2    inc hl
        set 7,(hl)
        dec hl
        ret
10	ORG 32000
20	DI
30	LD BC,6144
40	LD HL,22527
50	LOOP SRL (HL)
60	CALL C,SUB1
70	SRL (HL)
80	CALL C,SUB2
90	DEC HL
100	DEC BC
110	LD A,B
120	OR C
130	JR NZ,LOOP
140	RI
150	RET
160	SUB 1	INC HL
170	SET 6,(HL)
180	DEC HL
190	RET
200	SUB 2	INC HL
210	SET 7,(HL)
220	DEC HL
230	RET
240	END

I’m going to have to explore this at some point. Could make for an interesting add to a game engine at some point.

Advertisements

Author: andydansby

I'm a hobbyist coder working with the ZX Spectrum. Living in New York state near the Syracuse area. I grew up in Virgina. The first computer my parents bought for me was a Timex Sinclair 2068.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s