-
Notifications
You must be signed in to change notification settings - Fork 27
/
pic.zap
100 lines (85 loc) · 1.66 KB
/
pic.zap
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
.SEGMENT "STARTUP"
.FUNCT TITLE-SCREEN
CLEAR -1
PICINF P-TITLE,YX-TBL /?BOGUS1
?BOGUS1: SET 'CURRENT-SPLIT,TITLE-SCREEN-PICTURE
GET YX-TBL,0
SPLIT STACK
SCREEN 1
DISPLAY P-TITLE,1,1
SCREEN 0
RTRUE
.ENDSEG
.SEGMENT "0"
.FUNCT YCEILING,Y
SUB FONT-Y,1
ADD Y,STACK
DIV STACK,FONT-Y
MUL FONT-Y,STACK
RSTACK
.FUNCT XCEILING,X
SUB FONT-X,1
ADD X,STACK
DIV STACK,FONT-X
MUL FONT-X,STACK
RSTACK
.FUNCT MARGINAL-PIC,P,X,Y,YLEFT,HIGH,YLOC,WWIDTH,?TMP1,?TMP2
PICINF P,YX-TBL /?BOGUS1
?BOGUS1: GET YX-TBL,0
CALL2 YCEILING,STACK >Y
GET YX-TBL,1
CALL2 XCEILING,STACK >X
WINGET S-TEXT,WHIGH >HIGH
WINGET S-TEXT,WWIDE >WWIDTH
WINGET S-TEXT,WYPOS
SUB STACK,1 >YLEFT
SUB HIGH,YLEFT >YLEFT
GRTR? Y,YLEFT \?CND2
CURGET YX-TBL
GET YX-TBL,0 >YLOC
SUB Y,YLEFT
CALL2 YCEILING,STACK >YLEFT
SCROLL S-TEXT,YLEFT
SUB YLOC,YLEFT >YLOC
GRTR? YLOC,0 /?CND4
SET 'YLOC,1
?CND4: GET YX-TBL,1
CURSET YLOC,STACK
?CND2: WINGET S-TEXT,WYPOS
ADD Y,STACK >YLEFT
PICINF ICON-OFFSET,PICINF-TBL /?BOGUS6
?BOGUS6: WINGET S-TEXT,WYPOS >?TMP2
GET PICINF-TBL,0
ADD ?TMP2,STACK >?TMP1
GET PICINF-TBL,1
ADD 1,STACK
DISPLAY P,?TMP1,STACK
ADD X,FONT-X >X
LESS? X,WWIDTH /?CCL9
CURSET YLEFT,1
ZERO? DEMO-VERSION? /?CCL12
ICALL2 INPUT-DEMO,1
JUMP ?CND10
?CCL12: INPUT 1
?CND10: ICALL1 MOUSE-INPUT?
SUB HIGH,YLEFT
GRTR? STACK,FONT-Y /FALSE
SCROLL S-TEXT,FONT-Y
RTRUE
?CCL9: MARGIN X,0
DIV Y,FONT-Y >Y
SUB WWIDTH,X
DIV STACK,FONT-X >WWIDTH
GRTR? WWIDTH,INBUF-LENGTH \?CCL18
PUSH INBUF-LENGTH
JUMP ?CND16
?CCL18: PUSH WWIDTH
?CND16: PUTB P-INBUF,0,STACK
WINPUT 0,WCRCNT,Y
WINPUT 0,WCRFUNC,RESET-MARGIN
RTRUE
.FUNCT RESET-MARGIN
MARGIN 0,0
RTRUE
.ENDSEG
.ENDI