8-Bit Software Online Conversion
3D Demo (B) - Listing
10REM >3DMonDemS
20:
30MODE 129
40VDU23;8202;0;0;0;
50PROCdis
60PROCinit
70PROCpage1
80PROCpage2
90PROCpage3
100MODE 7
110PROCenab
120END
130:
140DEF PROCtitle
150COLOUR 129:CLS
160PROC3dbx(160,940,1120,1008,TRUE,FAL
SE)
170PROC3dcent(160,940,1120,1008,TRUE,"
Monochrome 3D demonstration",3)
180ENDPROC
190:
200DEF PROCpage1
210PROCtitle
220PROCotlnbx(16,732,1260,892,TRUE,"In
troduction")
230VDU5
240GCOL0,3
250MOVE32,844
260PRINT"This program is intended to s
how the"
270MOVE32,812
280PRINT"monochrome 3D effect which ca
n be"
290MOVE32,780
300PRINT"produced on non-colour displa
ys."
310PROCotlnbx(16,268,1260,684,TRUE,"Ou
tline boxes")
320VDU5
330GCOL0,3
340MOVE32,636
350PRINT"Outline boxes are used extens
ively"
360MOVE32,604
370PRINT"on this screen. They can be u
sed to"
380MOVE32,572
390PRINT"surround areas of text or rel
ated"
400MOVE32,540
410PRINT"information. Most have titles
, as this"
420MOVE32,508
430PRINT"one does, but it is not neces
sary to"
440MOVE32,476
450PRINT"have a title."
460MOVE32,412
470PRINT"For example, a wordprocessor
using"
480MOVE32,380
490PRINT"this style of screen layout m
ight have"
500MOVE32,348
510PRINT"the text in one outline box a
nd the"
520MOVE32,316
530PRINT"status information in another
."
540VDU4
550PROCspc
560ENDPROC
570:
580DEF PROCpage2
590PROCtitle
600PROCotlnbx(16,540,1260,892,TRUE,"3D
boxes")
610VDU5
620GCOL0,3
630MOVE32,844
640PRINT"3D boxes are 'slabs' which ap
pear"
650MOVE32,812
660PRINT"raised or recessed. They are
used"
670MOVE32,780
680PRINT"for the title at the top of t
his"
690MOVE32,748
700PRINT"screen, and as the titles of
outline"
710MOVE32,716
720PRINT"boxes."
730MOVE32,652
740PRINT"They can also be used, as in
the"
750MOVE32,620
760PRINT"example below, to highlight d
ata in an"
770MOVE32,588
780PRINT"outline box."
790PROCotlnbx(16,284,1260,492,TRUE,"St
atus")
800VDU5
810GCOL0,3
820MOVE32,428
830PRINT"Word count"
840PROC3dbx(420,384,160,56,FALSE,TRUE)
850PROC3dcent(420,384,160,56,FALSE,"31
0",3)
860VDU5
870GCOL0,3
880MOVE32,348
890PRINT"RAM free"
900PROC3dbx(420,304,160,56,FALSE,TRUE)
910PROC3dcent(420,304,160,56,FALSE,"8K
",3)
920VDU5
930GCOL0,3
940MOVE640,348
950PRINT"RAM used"
960PROC3dbx(1028,304,160,56,FALSE,TRUE
)
970PROC3dcent(1028,304,160,56,FALSE,"3
K",3)
980VDU4
990PROCspc
1000ENDPROC
1010:
1020DEF PROCpage3
1030PROCtitle
1040PROCotlnbx(16,572,1260,892,TRUE,"3D
boxes")
1050VDU5
1060GCOL0,3
1070MOVE32,844
1080PRINT"An alternative form of 3D box
is"
1090MOVE32,812
1100PRINT"available, which has a white
centre."
1110MOVE32,780
1120PRINT"You could use the two styles
to"
1130MOVE32,748
1140PRINT"signify something, or just us
e"
1150MOVE32,716
1160PRINT"whichever you prefer."
1170MOVE32,652
1180PRINT"The previous example is repro
duced"
1190MOVE32,620
1200PRINT"below in the alternative styl
e."
1210PROCotlnbx(16,316,1260,524,TRUE,"St
atus")
1220VDU5
1230GCOL0,3
1240MOVE32,460
1250PRINT"Word count"
1260PROC3dbxcent(420,416,160,56,FALSE,T
RUE)
1270PROC3dcent(420,416,160,56,FALSE,"31
0",3)
1280VDU5
1290GCOL0,3
1300MOVE32,380
1310PRINT"RAM free"
1320PROC3dbxcent(420,336,160,56,FALSE,T
RUE)
1330PROC3dcent(420,336,160,56,FALSE,"8K
",3)
1340VDU5
1350GCOL0,3
1360MOVE640,380
1370PRINT"RAM used"
1380PROC3dbxcent(1028,336,160,56,FALSE,
TRUE)
1390PROC3dcent(1028,336,160,56,FALSE,"3
K",3)
1400VDU4
1410PROCspc
1420ENDPROC
1430:
1440DEF PROCspc
1450PROCotlnbx(16,16,1260,96,TRUE,"")
1460VDU5
1470GCOL0,3
1480MOVE224,68
1490PRINT"Press SPACE to continue..."
1500VDU4
1510*FX21
1520REPEAT UNTIL GET=32
1530ENDPROC
1540:
1550DEF PROCinit
1560gxr%=FNgxr
1570:
1580REM COLOUR 0,255,255,255
1590REM COLOUR 1,170,170,170
1600REM COLOUR 2,85,85,85
1610REM COLOUR 3,0,0,0
1620:
1630VDU19,0,7,0,0,0
1640VDU19,1,6,0,0,0
1650VDU19,2,1,0,0,0
1660VDU19,3,0,0,0,0
1670ENDPROC
1680:
1690DEF PROCotlnbx(bx%,by%,tx%,ty%,abs%
,title$)
1700LOCAL len%
1710IF NOT abs% THEN tx%=bx%+tx%:ty%=by
%+ty%
1720GCOL0,2
1730PROCrect(bx%,by%,tx%,ty%)
1740GCOL0,0
1750MOVEbx%,by%
1760DRAW bx%,ty%
1770DRAW tx%-4,ty%
1780DRAW tx%-4,by%+4
1790DRAW bx%,by%+4
1800GCOL0,1
1810PROCrect(bx%+8,by%+8,tx%-8,ty%-8)
1820IF title$="" THEN ENDPROC
1830len%=LEN(title$)*32
1840PROC3dbx(bx%+32,ty%-24,bx%+64+len%,
ty%+24,TRUE,FALSE)
1850GCOL0,2
1860PLOT69,bx%+32,ty%-4
1870GCOL0,0
1880PLOT69,bx%+64+len%,ty%
1890VDU5
1900GCOL0,3
1910MOVEbx%+48,ty%+12
1920PRINT title$
1930VDU4
1940ENDPROC
1950:
1960DEF PROC3dbx(bx%,by%,tx%,ty%,abs%,i
n%)
1970LOCAL c1%,c2%
1980IF NOT abs% THEN tx%=bx%+tx%:ty%=by
%+ty%
1990IF in% THEN c1%=2:c2%=0 ELSE c1%=0:
c2%=2
2000GCOL0,1
2010PROCrect(bx%,by%,tx%,ty%)
2020GCOL0,c1%
2030MOVEbx%,by%
2040DRAW bx%,ty%
2050DRAW tx%,ty%
2060GCOL0,c2%
2070MOVEbx%+4,by%
2080DRAW tx%,by%
2090DRAW tx%,ty%-4
2100ENDPROC
2110:
2120DEF PROC3dbxcent(bx%,by%,tx%,ty%,ab
s%,in%)
2130IF NOT abs% THEN tx%=bx%+tx%:ty%=by
%+ty%
2140PROC3dbx(bx%,by%,tx%,ty%,TRUE,in%)
2150GCOL0,0
2160PROCrect(bx%+8,by%+8,tx%-8,ty%-8)
2170GCOL0,3
2180PROCoutlinerect(bx%+8,by%+8,tx%-8,t
y%-8)
2190ENDPROC
2200:
2210DEF PROC3dcent(bx%,by%,tx%,ty%,abs%
,text$,c%)
2220IF NOT abs% THEN tx%=bx%+tx%:ty%=by
%+ty%
2230VDU5
2240GCOL0,c%
2250MOVEbx%+((tx%-bx%)/2)-LEN(text$)*16
,by%+((ty%-by%)/2)+12
2260PRINT text$
2270VDU4
2280ENDPROC
2290:
2300DEF FNgxr
2310GCOL0,7
2320MOVE640,512
2330PLOT&99,32,0
2340=(POINT(640,512)>0)
2350:
2360DEF PROCrect(bx%,by%,tx%,ty%)
2370IF gxr% THEN PROCrectgxr(bx%,by%,tx
%,ty%) ELSE PROCrectnogxr(bx%,by%,tx%,ty
%)
2380ENDPROC
2390:
2400DEF PROCrectgxr(bx%,by%,tx%,ty%)
2410MOVEbx%,by%
2420PLOT&65,tx%,ty%
2430ENDPROC
2440:
2450DEF PROCrectnogxr(bx%,by%,tx%,ty%)
2460MOVEbx%,by%
2470MOVEtx%,by%
2480PLOT85,tx%,ty%
2490MOVEbx%,ty%
2500PLOT85,bx%,by%
2510ENDPROC
2520:
2530DEF PROCoutlinerect(bx%,by%,tx%,ty%
)
2540MOVEbx%,by%
2550DRAW tx%,by%
2560DRAW tx%,ty%
2570DRAW bx%,ty%
2580DRAW bx%,by%
2590ENDPROC
2600:
2610DEF PROCdis
2620*FX229,1
2630*FX4,2
2640ENDPROC
2650:
2660DEF PROCenab
2670*FX229
2680*FX4
2690ENDPROC