File tree Expand file tree Collapse file tree
src/arch/zx48k/library-asm Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include <input.bas>
2-
2+ border 1 : cls
33print at 10 , 5 ; "Type something: " ;
44a$ = input( 20 )
55print
66print "You typed: " ; a$
7-
Original file line number Diff line number Diff line change 11;; Clears the user screen (24 rows)
22
3- #include once <sposn.asm>
43#include once <sysvars.asm>
54
65 push namespace core
109
1110 ld hl , 0
1211 ld (COORDS) , hl
13- ld hl , 1821h
12+ ld hl , SCR_SIZE
1413 ld (S_POSN) , hl
1514 ld hl , (SCREEN_ADDR)
15+ ld (DFCC) , hl
1616 ld (hl) , 0
1717 ld d , h
1818 ld e , l
1919 inc de
20- ld bc , 6144
20+ ld bc , 6143
2121 ldir
2222
2323 ; Now clear attributes
2424
2525 ld hl , (SCREEN_ATTR_ADDR)
26+ ld (DFCCL) , hl
2627 ld d , h
2728 ld e , l
2829 inc de
3536 ENDP
3637
3738 pop namespace
38-
Original file line number Diff line number Diff line change 55
66__IN_SCREEN:
77 ; Returns NO carry if current coords (D, E)
8- ; are OUT of the screen limits (MAXX, MAXY)
8+ ; are OUT of the screen limits
99
1010 PROC
1111 LOCAL __IN_SCREEN_ERR
1212
13- ld hl , MAXX
13+ ld hl , SCR_SIZE
1414 ld a , e
15- cp (hl)
15+ cp l
1616 jr nc , __IN_SCREEN_ERR ; Do nothing and return if out of range
1717
1818 ld a , d
19- inc hl
20- cp (hl)
19+ cp h
2120 ret c ; Return if carry (OK)
2221
2322__IN_SCREEN_ERR:
You can’t perform that action at this time.
0 commit comments