-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfabgl.inc
146 lines (110 loc) · 3.65 KB
/
fabgl.inc
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{ FabGL Includes for Pascal }
{ Written BY Eightbitswide }
{ string define types }
type Workstring=string[255];
type filename=string[255];
var textTmp:string[255];
var myfile:Text;
var datn:string[255];
var xjx:integer;
{ procedures }
procedure SPRITECOUNT(gsprcnt:integer); begin
writeln (#27,'_GSPRITECOUNT',gsprcnt,'$');
end;
procedure SPRITEDEFRGB2(indxx,widt,heig:integer); begin
write (#27,'_GSPRITEDEF',indxx,';',widt,';',heig,';2;');
end;
procedure SPRITESET(xdix,visa,xsp,ysp:integer); begin
write (#27,'_GSPRITESET',xdix,';');
if visa = 0 then write('H;');
if visa = 1 then write('V;');
write('0;',xsp,';',ysp,'$');
end;
procedure SCREEN(resolut:Workstring); begin
write (#27,'_#',resolut,'$');
end;
procedure APPLY; begin
write (#27,'_#APPLYSETTINGS$');
delay(1200);
end;
procedure CLS; begin
write (#27,'[2J',#27,'[H')
;
end;
procedure HOME; begin
write (#27,'[H');
end;
procedure PEN(penrr,pengg,penbb:integer); begin
write (#27,'_GPEN',penrr,';',pengg,';',penbb,'$');
end;
procedure BRUSH(brurr,brugg,brubb:integer); begin
write (#27,'_GBRUSH',brurr,';',brugg,';',brubb,'$');
end;
procedure RECT(Rectx,recty,rectxx,rectyy:integer); begin
write (#27,'_GRECT',rectx,';',recty,';',rectxx,';',rectyy,'$');
end;
procedure FILLRECT(frx,fry,frxx,fryy:integer); begin
write (#27,'_GFILLRECT',frx,';',fry,';',frxx,';',fryy,'$');
end;
procedure LINE(gxx1,gyy1,gxx2,gyy2:integer); begin
write (#27,'_GLINE',gxx1,';',gyy1,';',gxx2,';',gyy2,'$');
end;
procedure CURSOR(blinkybox:integer); begin
write (#27,'_E',blinkybox,'$');
end;
procedure LOCATE(blinkyboxcol,blinkyboxrow:integer); begin
write (#27,'_F',blinkyboxcol,';',blinkyboxrow,'$');
end;
procedure CLEAR; begin
write (#27,'_GCLEAR$');
end;
procedure PLOT(pixelxx,pixelyy:integer); begin
write (#27,'_GPIXEL',pixelxx,';',pixelyy,'$');
end;
procedure SCROLL(offsetX,offsetY:integer); begin
write (#27,'_GSCROLL',offsetX,';',offsetY,'$');
end;
procedure ELLIPSE(ellx,elly,ellw,ellh:integer); begin
write (#27,'_GELLIPSE',ellx,';',elly,';',ellw,';',ellh,'$');
end;
procedure FILLELLIPSE(fellx,felly,fellw,fellh:integer); begin
write (#27,'_GFILLELLIPSE',fellx,';',felly,';',fellw,';',fellh,'$');
end;
procedure PLAY(waveform,freq,dur,vol:integer); begin
write (#27,'_S',waveform,';',freq,';',vol,';',vol,'$');
end;
procedure SPRITEDATA(sprdata:Workstring); begin
{Convert Single Character Sprite Data to
16 Color FabGL compatible Spirte Data.}
for xjx := 1 to length(sprdata) do
begin
datn:=Copy(sprdata,xjx,1);
if datn = '0' then write('00'); {Black}
if datn = '1' then write('D5'); {Grey}
if datn = '2' then write('AA'); {LGrey}
if datn = '3' then write('F3'); {Pink}
if datn = '4' then write('C3'); {Red}
if datn = '5' then write('46'); {Brown}
if datn = '6' then write('D7'); {Peach}
if datn = '7' then write('C7'); {Orange}
if datn = '8' then write('4F'); {Yellow}
if datn = '9' then write('CC'); {Green}
if datn = 'A' then write('BC'); {Cyan}
if datn = 'B' then write('B8'); {LBlue}
if datn = 'C' then write('B4'); {Blue}
if datn = 'D' then write('B2'); {Magenta}
if datn = 'E' then write('E1'); {Purple}
if datn = 'F' then write('FF'); {White}
if datn = '$' then write('$'); {EOS}
end;
end;
procedure SPRITEFILEDATA(getfile:filename); begin
Assign(myfile,getfile);
Reset(myfile);
repeat
readln(myfile,textTmp);
SPRITEDATA(textTmp);
Until Eof(myfile);
close(myfile);
writeln('$');
end;