-
Notifications
You must be signed in to change notification settings - Fork 0
/
vscroll.asm
112 lines (92 loc) · 1.83 KB
/
vscroll.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
; ZX48K fill screen with preshifted values using stack
; To compile with zmac or pasmo:
; a) zmac vscroll.asm -o vscroll-zmac.tap
; b) pasmo --tapbas vscroll.asm vscroll-pasmo.tap
org 0x8000
screen_loop
ei
halt
di
ld a, 2
out (254), a
ld hl, 0
add hl, sp
ld (stack),hl
ld hl, 0x4000+6144
ld sp, hl
ld a,(src)
rla
ld ix,src
rl (ix+15)
rl (ix+14)
rl (ix+13)
rl (ix+12)
rl (ix+11)
rl (ix+10)
rl (ix+9)
rl (ix+8)
rl (ix+7)
rl (ix+6)
rl (ix+5)
rl (ix+4)
rl (ix+3)
rl (ix+2)
rl (ix+1)
rl (ix+0)
;exx
ld bc, (src+8)
ld de, (src+6)
ld hl, (src+4)
ld ix, (src+2)
ld iy, (src+0)
exx
ld bc, (src+14)
ld de, (src+12)
ld hl, (src+10)
push hl
pop af
ld a, 1
out (254), a
ld a,196
inner_loop
push bc
push de
push hl
exx
push bc
push de
push hl
push ix
push iy
exx
push bc
push de
push hl
exx
push bc
push de
push hl
push ix
push iy
exx
dec a
jp nz, inner_loop
ld hl,(stack)
ld sp,hl
ld a,0
out (254),a
jp screen_loop
src dw 0xaaaa
dw 0x0ff0
dw 0x7777
dw 0x0137
dw 0xf731
dw 0x0137
dw 0x7777
dw 0x0ff0
dw 0xaaaa
dw 0x0000
dw 0x0000
dw 0x0000
stack dw 0
end screen_loop ; entry point for zmac and pasmo