-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCROLLR.ASM
More file actions
97 lines (83 loc) · 1.66 KB
/
SCROLLR.ASM
File metadata and controls
97 lines (83 loc) · 1.66 KB
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
;Actually, I made one just a few hours ago, but it scrolls the pixels sideways. Scrolling up or
;down is EASY (just use ldir och lddr) but a horizontal scroll is much harder, so I made one...
;AND IT'S PRETTY FAST!!!!! RR (HL) and RL (HL) is just made for this routine...
;Here's the code: I hope someone (perhaps myself) will use it to make Super Mario Bros or
;something...
;Pressing left will scroll the screen one pixel to the left (surprising huh?) and pressing
;right... :) The pixel wrap around the screen also... that makes the program somewhat bigger.
; SCROLL-ROUTINE
;
; Made by Jimmy Mardell <mja@algonet.se>
;
#INCLUDE ti-85.h
.org 0
.db "Scroll",0
ROM_CALL(CLEARLCD)
; Filling the screen with garbage
ld de,$FC00
ld hl,GRAPH_MEM
ld bc,1024
ldir
WaitKey:
ld a,(KEY_1)
cp K_LEFT
jr z,ScrollLeft
cp K_RIGHT
jr z,ScrollRight
cp K_EXIT
jr nz,WaitKey
call GET_KEY ; Clearing buffer
ret
ScrollLeft:
ld hl,$FFFF
ld b,64
LNewRow:
ld d,h
ld e,l
push bc
xor a
ld b,16
LNewX:
rl (hl)
dec hl
djnz LNewX
ex de,hl
adc a,(hl)
ld (hl),a
ex de,hl
pop bc
djnz LNewRow
jr WaitKey
ScrollRight:
ld hl,$FC00
ld b,64
RNewRow:
ld d,h
ld e,l
push bc
xor a
ld b,16
RNewX:
rr (hl)
inc hl
djnz RNewX
ex de,hl
adc a,a
rrca
add a,(hl)
ld (hl),a
ex de,hl
pop bc
djnz RNewRow
jr WaitKey
.end
;--
;Real name: Jimmy Mardell
;Email: <mja@algonet.se>
;IRC-name: Yarin
;Home-page: *BLUSH* Doesn't exist yet...
;
;"The truth you here is not always the truth you think you here" - Robert Jordan
;
;"I'm the operator with my pocket calculator" - Kraftwerk
;