home *** CD-ROM | disk | FTP | other *** search
/ APDL DTP 3 / APDL_DTP3.iso / _cdview / cdview (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1996-10-08  |  16.7 KB  |  560 lines

  1.  --> CD Catalogue
  2.  This program and all documentation 
  3.  David Holden 1995
  4. A_$="1.30":
  5. 262343,D_%,E_%
  6. G_%:A%=1:B%=E_%:G%=H_%:H%=I_%:
  7. 262341,,E_%
  8. 262351,,L_%+100:
  9. L_%?108=4
  10. :E_%!100=K_%:
  11. 262342,,E_%+100:M_%=N_%:O_%=P_%:Q_$=$R_%
  12. 262342,,E_%:I%=
  13. T_(0)
  14. 262342,,E_%:E_%!4=0:
  15. 262340,,E_%:I%=
  16. T_(0)
  17. 262342,,E_%
  18. W_(X_%,Y_%)
  19. 262364,E_%!24
  20. 17,18:
  21. E_%!16
  22. 262351,,E_%+&C0:c_%=E_%!&C8:d_%=E_%!&C4:
  23. E_%!4=-1
  24. 0:!E_%=G_%:
  25. 262342,,E_%:!E_%=U_%:
  26. 262342,,E_%:$e_%="CDview Help":
  27. f_(g_$+".!Help")
  28. c_%=1
  29. 262356,,h_%,i_%,j_%
  30. k_%,l_%:i_%=!E_%:d_%=E_%!4:c_%=E_%!8:l_%=E_%!12:k_%=E_%!16:
  31. k_%=m_%
  32. 1:P_%=O_%:N_%=M_%:$R_%=Q_$:
  33. n_(P_%)
  34. 2:j_%=228:
  35. 262356,,h_%,i_%-60,j_%
  36. 4:P_%=o_%+1:N_%=48:
  37. $(o_%+4)=".^" $R_%=g_$+".^"
  38. $R_%=$(o_%+4)
  39. n_(P_%)
  40. 263872:
  41. p_(k_%)
  42. 64,16:J%=
  43. q_(k_%,P_%):I%=J%+2:
  44. ?I%<33:I%+=1:
  45. :r_$=$R_%+"."+$I%:
  46. s_(K_%,k_%,J%)
  47. &416,&404:I%=
  48. q_(k_%,P_%)+2:
  49. ?I%<33:I%+=1:
  50. :r_$=$R_%+"."+$I%
  51. 263873
  52. N_%=48
  53. 263872:A%=4:B%=P_%:C%=N_%:P_%=
  54. (J_%):N_%=P_%?1:I%=R_%+
  55. ($R_%):
  56. ?I%<>46:I%-=1:
  57. :?I%=13:
  58. n_(P_%):
  59. 263873:
  60. q_(i%,p%):
  61. t_%:t_%=i%:p%=
  62. u_(p%):
  63. t_%>0:
  64. ?p%<>N_%:p%=
  65. u_(p%):
  66. u_(p%)
  67. u_(p%)
  68. :t_%-=1:
  69. p_(i%):
  70. v_%,t_%,x%,y%,w_%:
  71. q_(i%,P_%):
  72. ">":P_%=v_%:N_%+=1:v_%+=3:
  73. ?v_%<32:v_%+=1:
  74. :$R_%=$R_%+"."+$v_%:
  75. n_(P_%)
  76. x_(K_%,i%,0):I%=v_%+2:
  77. ?I%<33:I%+=1:
  78. :$e_%=$I%:r_$=$R_%+"."+$e_%:!E_%=G_%:
  79. 262342,,E_%:!E_%=U_%:
  80. 262342,,E_%:I%=
  81. T_(0):
  82. ?v_%<>
  83. !y_%=U_%:
  84. 262348,,y_%:$(y_%!76)=$e_%:
  85. 53,-1,11
  86. ,,x%:
  87. 53,-1,4
  88. ,,w_%:x%=x%<<w_%:
  89. 53,-1,12
  90. ,,y%:
  91. 53,-1,5
  92. ,,w_%:y%=y%<<w_%:!E_%=0:E_%!4=-(y%-40):E_%!8=x%-32:E_%!12=0:
  93. 262359,U_%,E_%
  94. z_(&D94,r_$)
  95. f_(r_$)
  96. z_(&AFF,r_$)
  97. z_(&FF9,r_$)
  98. n_(p%):
  99. __%,`_%,a$:__%=-20:`_%=0:
  100. p%?2=
  101. "x" A`%=
  102. 263872:!y_%=K_%:
  103. 262348,,y_%:I%=y_%!88:
  104. I%>=0:!L_%=K_%:L_%!4=I%-1:
  105. 262340,,L_%:I%-=1:
  106. :I%=R_%+
  107. ($R_%):
  108. ?I%<>46:I%-=1:
  109. :I%+=1:a$=$I%:
  110. a$="^" a$="$"
  111. U$(y_%!76)=a$:p%=
  112. u_(p%):
  113. 4:L_%!(I%+4)=B`%!I%:
  114. :!L_%=K_%:
  115. ?p%>=N_%:
  116. p%?1=N_%+1
  117. C`(D`%,p%+2)
  118. :A%=3:B%=p%:C%=N_%:p%=
  119. (J_%)
  120. C`(D`%+64,p%+1):p%=
  121. u_(p%)
  122. C`(D`%+16,p%+1):p%=
  123. u_(p%)
  124. C`(D`%+32,p%+1):p%=
  125. u_(p%)
  126. C`(D`%+48,p%+1):p%=
  127. u_(p%)
  128. u_(p%)
  129. :__%=-(`_%
  130. 2+`_%
  131. 2)*40-20:
  132. __%>E`% __%=E`%
  133. !L_%=0:L_%!4=__%:L_%!8=274:L_%!12=0:
  134. 262359,K_%,L_%:!y_%=K_%:
  135. 262348,,y_%+1:y_%!24=0:y_%!28=-1:
  136. 262341,,y_%:
  137. 262353,-1,y_%!4,y_%!8,y_%!12,y_%!16+40:
  138. 263873:
  139. C`(i%,p%):
  140. ?p%<32
  141. ?p%=120:p%+=1:
  142. :L_%!24=p%:L_%!28=i%:
  143. 262338,,L_%:
  144. L_%!4>200
  145. >L_%!8=L_%!8-40:L_%!16=L_%!16-40:L_%!4=8:L_%!12=272:__%-=40
  146. :L_%!4=276:L_%!12=542
  147. :`_%+=1:
  148. 8,17,g_$+".Cat_File"
  149. F%,,,,I_%:
  150. 1)<>1 I%=
  151. G`(1,"No catalogue data found - unable to continue"):
  152. H`% I_%+&20:
  153. 8,16,g_$+".Cat_File",H`%,0:A%=0:B%=H`%:C%=I_%:
  154. J_%:I`$=$H`%:o_%=
  155. u_(H`%):P_%=o_%+1:O_%=P_%:N_%=48:M_%=N_%:A`%=
  156. $(o_%+4)=".^" $R_%=g_$+".^"
  157. $R_%=$(o_%+4)
  158. MQ_$=$R_%:!E_%=K_%:
  159. 262347,,E_%:E`%=E_%!8-E_%!16:
  160. n_(P_%):
  161. 262341,,E_%:
  162. s_(w%,i%,p%):
  163. x%,y%:X_%=w%:Y_%=i%:
  164. 262351,,L_%:x%=!L_%-18:y%=L_%!4-9:!L_%=w%:L_%!4=i%:
  165. 262350,,L_%:!L_%=x%:L_%!4=y%:L_%!8=x%+36:L_%!12=y%+18:
  166. 271360,%11000101,1,"file_d94",L_%
  167. 271360,%11000101,1,"file_aff",L_%
  168. 271360,%11000101,1,"file_ff8",L_%
  169. 271360,%11000101,1,"file_fff",L_%
  170. 271360,%11000101,1,"directory",L_%
  171. s_(w%,i%):X_%=w%:Y_%=i%:!L_%=w%:
  172. 262347,,L_%:X%=L_%!4-L_%!20:Y%=L_%!16-L_%!24:L_%!4=i%:
  173. 262350,,L_%:!L_%=L_%!8+X%:L_%!4=L_%!12+Y%:L_%!8=L_%!16+X%:L_%!12=L_%!20+Y%:
  174. 271360,%11000101,1,(L_%!32)+1,L_%:
  175. W_(w%,i%):
  176. 271361:J`%=0:L_%!&80=w%:L_%!&84=i%:
  177. 262350,,L_%+&80:I%=(L_%!&9C):
  178. $(I%),"."):I%+=1:
  179. :e_$=$(I%):
  180. 262351,,L_%:L_%!20=L_%!12:L_%!24=L_%!16:L_%!28=!L_%:L_%!32=L_%!4:L_%!16=1:$(L_%+44)=e_$
  181. @!L_%=(
  182. (e_$)+49)
  183. 3:L_%!12=0:
  184. 262375,17,L_%,L_%!20,L_%!24:
  185. f$,d$,i$,i%,K`%:
  186. "Closearchive cd_dir_arc":
  187. :i%=E_%+44:
  188. ?i%>31:i%+=1:
  189. ?i%<>46:i%-=1:
  190. :?i%=13:d$=$(E_%+44):$L_%=r_$:i%=L_%+
  191. ?i%<>46:i%-=1:
  192. :?i%=13:f$=$L_%:!y_%=K_%:
  193. 262348,,y_%:i%=y_%!88:
  194. i%>=0:
  195. M`(K_%,i%)=
  196. i$="."+
  197. N`(K_%,i%):
  198. 5,"openarchive "+$R_%+" cd_dir_arc":f$="arcfs#cd_dir_arc:$":L`%=
  199. 8,5,f$+i$
  200. ,,K`%,,I_%:K`%=(K`%>>8)
  201. &FFF:
  202. K`%=&3FB
  203. I_%<&C000
  204. 5,"openarchive "+f$+i$+" cd_dir_arc":f$="arcfs#cd_dir_arc:$":L`%=
  205. "copy "+f$+i$+" "+d$+i$+" RQ~V~C":
  206. "Closearchive cd_dir_arc":L`%=
  207. x_(K_%,i%,0)
  208. :i%-=1:
  209. x_(w%,i%,s%):!L_%=w%:L_%!4=i%:L_%!8=s%<<21:L_%!12=1<<21:
  210. 262349,,L_%:
  211. N`(w%,i%):!L_%=w%:L_%!4=i%:
  212. 262350,,L_%:I%=(L_%!28):
  213. ?I%>31:I%+=1:
  214. :?I%=13:=$(L_%!28)
  215. M`(w%,i%):!L_%=w%:L_%!4=i%:
  216. 262350,,L_%:
  217. (L_%!24
  218. 1<<21):=
  219. T_(O`%):
  220. 262380,P`%+O`%,-1
  221. e%>=(P`%+O`%):=
  222. 262380,P`%,-1:=
  223. R`,S`,T`,U`,m%:S`=1:R`=2:U`=4:T`=&80:
  224. V`%&200:m%=V`%:h_%=
  225. W`(m%,"CDview",180):m%=
  226. X`("Help",0,0):m%=
  227. X`("Info",0,Y`%):m%=
  228. X`("Quit",T`,0):
  229. W` (a%,Z`$,a`%):$a%=Z`$:a%!12=&70207:a%!16=a`%:a%!20=40:a%!24=0:m%=a%+28:=a%
  230. X` (b`$,c`%,d`%):!m%=c`%:m%!4=d`%:m%!8=&7000001:$(m%+12)=b`$:=m%+24
  231. e` (f`$,g`%,h`$):
  232. i`% 24:$i`%="s!"+f`$:$(i`%+16)=h`$:!E_%=g`%:E_%!4=0:E_%!8=-24:E_%!12=80:E_%!16=80:E_%!20=&1700210B:E_%!28=i`%:E_%!24=i`%+16:E_%!32=8:
  233. 262338,,E_%
  234. I%:=I%
  235. u_(p%):
  236. :p%+=1:
  237. ?p%=10
  238. ?p%=13:=p%+1
  239. C_(j`$,k`%):
  240. 263874:D_%=&C31:!L_%=
  241. :$(L_%+4)="Error "+
  242. )+": "+j`$++
  243. 262367,L_%,1,l`%:
  244. 262365,m`%,&4B534154:
  245. G`(n`%,a$):L_%!&80=0:$(L_%+&84)=a$+
  246. 262367,L_%+&80,16
  247. n`%,l`%
  248. ,I%:=I%
  249. J_%&500:
  250. 2:P%=J_%:[OPT p`:adr r8,q`:mov r0,r0,lsl#2:ldr pc,[r8,r0]:.r` equd 0:equd 0
  251. /.q` equd s`:equd t`:equd u`:equd v`:equd S_
  252. .v`:mov r0,r1:.w` ldrb r1,[r0],#1:cmp r1,#13:cmpne r1,#10:bne w`:ldrb r1,[r0]:cmp r1,r2:bne w`:.w` ldrb r1,[r0],#1:cmp r1,#13:cmpne r1,#10:bne w`:mov pc,r14
  253. .S_ mov r0,r1:.w` ldrb r1,[r0,#-1]!:cmp r1,#13:bne w`:ldrb r1,[r0,#1]:cmp r1,#62:bne w`:ldrb r1,[r0,#2]:cmp r1,r2:bge w`:add r0,r0,#1:mov pc,r14
  254. .u` add r2,r1,r2:mov r0,#32:.w` ldrb r3,[r1],#1:cmp r1,r2:movgt pc,r14:cmp r3,#10:cmpne r3,#13:bne w`:ldrb r11,[r1]:add r11,r11,r3:cmp r11,#23:addeq r1,r1,#1:add r0,r0,#32:bal w`
  255. o.s` add r2,r1,r2:.w` ldrb r0,[r1],#1:cmp r0,#10:moveq r0,#13:streqb r0,[r1,#-1]:cmp r1,r2:blt w`:mov pc,r14
  256. .t` stmfd r13!,{r14}:add r7,r7,r6:ldr r2,x`:str r2,[r1]:swi "Wimp_RedrawWindow":.y` cmp r0,#0:ldmeqfd r13!,{pc}:ldr r0,[r1,#4]:ldr r2,[r1,#20]:sub r8,r0,r2:add r8,r8,#16:ldr r0,[r1,#16]:ldr r2,[r1,#24]:sub r9,r0,r2
  257. ldr r3,[r1,#40]:sub r3,r9,r3:mov r3,r3,lsr#5:mov r2,r3,lsl#5:sub r9,r9,r2:mov r2,r6:subs r3,r3,#1:bmi z`:._` ldrb r0,[r2],#1:cmp r0,#13:cmpne r0,#10:bne _`:ldrb r11,[r2]:add r11,r11,r0:cmp r11,#23:addeq r2,r2,#1:subs r3,r3,#1
  258. bpl _`
  259. d.z` ldr r4,[r1,#40]:ldr r3,[r1,#32]:sub r5,r4,r3:mov r5,r5,lsr#5:add r5,r5,#1:sub r9,r9,#4:bl ``
  260. k.Aa cmp r2,r7:bgt Ba:ldrb r0,[r2],#1:cmp r0,#31:swigt "OS_WriteC":bgt Aa:cmp r0,#10:cmpne r0,#13:beq Ca
  261. bal Aa
  262. .Ca ldr r11,[r2]:add r11,r11,r0:cmp r11,#23:addeq r2,r2,#1:subs r5,r5,#1:bmi Ba:sub r9,r9,#32:bl ``:bal Aa:.Ba swi "Wimp_GetRectangle":bal y`
  263. .`` swi 256+25:swi 256+4:mov r0,r8:swi "OS_WriteC":mov r0,r0,lsr#8:swi "OS_WriteC":mov r0,r9:swi "OS_WriteC":mov r0,r0,lsr#8:swi "OS_WriteC":movs pc,r14
  264. .x` equd G_%
  265. .Da% equd 0:.Ea% equd 0:.Fa% equd 0:.Ga% equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:.Ha% equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:.Ia% equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0
  266. equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:equd 0:.Ja% equd 0:.Ka% equd 0:.La% equd 0:.Ma% equd-1:.Na% equd 0:.Oa% equd 0:.Pa% equd 0:.Qa% equd 0:.Ra% equd 0:.Sa% equd 255
  267. G<equs "Unable to resize block for ArtWorks!":equb 0:align
  268. .Ta cmp r11,#0:stmfd r13!,{r4-r8,r14}:andne r5,r15,#(%1101<<28):teqnep r15,r5:ldmnefd r13!,{r4-r8,pc}:mov r1,#0:sub r1,r1,#1:cmp r0,r1:beq Ua:ldmltfd r13!,{r4-r8,pc}:.Va str r0,Da%:ldr r3,Ka%:sub r3,r3,#&8000:add r3,r3,r0
  269. mov r0,r3:swi "Wimp_SlotSize":cmp r3,r0:bgt Wa:ldr r0,Ka%:ldr r1,Da%:str r1,La%:ldr r2,Ma%:ldr r3,Na%:and r5,r15,#(%111<<29):
  270.  make sure V is clear
  271. teqp r15,r5:ldmfd r13!,{r4-r8,pc}:.Wa:adr r0,Sa%:orr r5,r15,#1<<28:teqp r15,r5:ldmfd r13!,{r4-r8,pc}:.Ua:ldr r0,Ka%:ldr r1,La%:ldr r2,Ma%:ldr r3,Na%:ldmfd r13!,{r4-r8,pc}:.Ea stmfd r13!,{r14}:swi "XAWRender_FileInitAddress"
  272. str r0,Ea%:ldr r0,Ka%:mov r12,r1:adr r1,Ta:ldr r2,La%:adr r14,Xa:ldr pc,Ea%:.Xa swivs "OS_GenerateError":str r0,La%:ldmfd r13!,{pc}:.Fa stmfd r13!,{r14}:swi "XAWRender_RenderAddress":str r0,Fa%:ldr r0,Ma%:mov r12,r1
  273. adr r1,Ga%:adr r2,Ha%:adr r3,Ia%:ldr r4,Ka%:adr r5,Ta:ldr r6,Ja%:mov r7,#0:adr r14,Ya:ldr pc,Fa%:.Ya swivs "OS_GenerateError":ldmfd r13!,{pc}:.Za stmfd r13!,{r14}:ldr r0,Ma%:swi "XAWRender_DocBounds":str r2,Oa%:str r3,Pa%
  274. /str r4,Qa%:str r5,Ra%:ldmfd r13!,{pc}:]:
  275. aa (ba%):
  276. ca% ba%,da%&100:E%=ca%+ba%:
  277. 262361,,g_$+".templates":
  278. 262363,,H_%,ca%,E%,-1,"info",0
  279. ,,R%:
  280. 262337,,H_%
  281. 262363,,H_%,R%,E%,-1,"file",0
  282. ,,R%:
  283. 262337,,H_%
  284. 262363,,H_%,R%,E%,-1,"text",0
  285. 262337,,H_%
  286. 262363,,H_%,R%,E%,-1,"pic",0
  287. ,,R%:
  288. 262337,,H_%
  289. 262362:!E_%=Y`%:E_%!4=1:
  290. 262350,,E_%:$(E_%!28)=ea$:!E_%=Y`%:E_%!4=2:
  291. 262350,,E_%:$(E_%!28)=fa$:!E_%=Y`%:E_%!4=3:
  292. 262350,,E_%:$(E_%!28)=ga$
  293. E!E_%=K_%:E_%!4=0:
  294. 262350,,E_%:J%=E_%+8:
  295. 32:B`%!I%=J%!I%:
  296. 262336,200,&4B534154,"CDview"
  297. ha%,m`%:
  298. ha%<300
  299. 0,"This program requires RISC-OS 3 or better":
  300. E_%&180,L_%&100,l`% 24,R_%&100,e_% 15:
  301. B`%&28,D`%&60,y_%&B000:$l`%="CDview":
  302. $+" During initialisation",
  303. -&8000:H_%=
  304. 35,"CDview$Dir",E_%,256,0,3
  305. ,,I%:E_%?I%=13:g_$=$E_%:
  306. T_(&1000)=
  307. G`(1,"Not enough memory available to run !CDview"):
  308. aa(&400):
  309. F`:m_%=
  310. e`("CDview",-1,I`$):
  311. Q`:I%=
  312. T_(0):
  313. 35,"ArcFS$check",E_%,256,0,3
  314. ,,I%:E_%?I%=13:
  315. $E_%="No"
  316. ,$E_%="Run "+g_$+".^.!ArcFS":
  317. 262366,E_%
  318. :*unset ArcFS$check
  319. ia:$D`%="Ssmall_dir":$(D`%+16)="Ssmall_FFF":$(D`%+32)="Ssmall_FF9":$(D`%+48)="Ssmall_AFF":$(D`%+64)="Ssmall_D94":$(D`%+80)="Ssmall_FF9":ea$="CDview v0.13":fa$="David Holden":ga$="
  320.  A.P.D.L. 1995":D_%=%110000110001:E`%=-550
  321. ja%&300,ka 24,la% 13,ma% 15,na% 255:
  322. oa:pa%=
  323. f_(qa$):
  324. "Closearchive cd_dir_arc":
  325. 5,"openarchive "+$R_%+" cd_dir_arc":qa$="arcfs#cd_dir_arc:$."+$e_%:L`%=
  326. 8,17,qa$
  327. F%,,,,I_%:
  328. 1)<>1
  329. 100,"File not found.":
  330. T_(I_%+20)=
  331. G`(1,"Not enough memory available to load this file"):
  332. "Closearchive cd_dir_arc":L`%=
  333. :!y_%=G_%:
  334. 262348,,y_%:$(y_%!76)=$e_%:
  335. 8,16,qa$,H_%,0:
  336. "Closearchive cd_dir_arc":L`%=
  337. H_%!I_%=&0A0A0A0A:A%=2:B%=H_%:C%=I_%:ra%=
  338. (J_%):!E_%=0:E_%!4=-ra%:E_%!8=1232:E_%!12=0:
  339. 262359,G_%,E_%:!E_%=G_%:
  340. 262347,,E_%:E_%!20=0:E_%!24=0:E_%!28=-1:
  341. 262341,,E_%:
  342. z_(sa%,ta$):
  343. ua%,va%,wa%,K`%:
  344. xa%,f`%,ya%:
  345. "Closearchive cd_dir_arc":
  346.  Get file length
  347. 5,"openarchive "+$R_%+" cd_dir_arc":ta$="arcfs#cd_dir_arc:$."+$e_%:L`%=
  348. 8,5,ta$
  349. ,,K`%,,I_%:K`%=(K`%>>8)
  350. &FFF:
  351. K`%=&3FB
  352. 5,"openarchive "+ta$+" cd_dir_arc":ta$="arcfs#cd_dir_arc:$."+$e_%:L`%=
  353. 8,5,ta$
  354. ,,,,I_%
  355. :!y_%=U_%:
  356. 262348,,y_%:
  357.  If window has an icon, delete it
  358. y_%!88>0
  359. ,!E_%=U_%:E_%!4=0:
  360. 262340,,E_%:I%=
  361. T_(0)
  362.  Get size of window
  363. Iua%=y_%!12-y_%!4:va%=y_%!16-y_%!8:
  364.  Calculate space needed for sprite
  365. Lwa%=
  366. za(ua%,
  367. ,xa%):
  368.  Grab space, initialise sprite area(s) and load file
  369. T_(xa%+I_%+8)=0 I%=
  370. G`(1,"Not enough memory available to load this file"):
  371. /f`%=H_%:ya%=f`%+xa%:
  372. _a(f`%,xa%):
  373. sa%=&FF9
  374. _a(ya%,I_%+8):
  375. 46,10+256,ya%,ta$
  376. 8,255,ta$,ya%
  377. "Closearchive cd_dir_arc":L`%=
  378.  Make the sprite
  379. `a(sa%,ya%,I_%,$e_%,f`%,wa%,
  380. Ab(f`%,
  381.  Add the sprite to the window
  382. !E_%=U_%:E_%!4=0:E_%!12=ua%:E_%!8=-ua%:E_%!16=0:E_%!20=&0700A11A:E_%!24=e_%:E_%!28=f`%:E_%!32=
  383. ($e_%):
  384. 262338,,E_%:
  385.  Open the window
  386. +c!E_%=U_%:
  387. 262347,,E_%:E_%!28=-1:
  388. 262341,,E_%:
  389. 262353,-1,E_%!4,E_%!8,E_%!4+ua%,E_%!8+ua%+40:
  390. `a(sa%,Bb%,Cb%,Db$,Eb%,Fb%,Gb%):
  391. r0%,r1%,r2%,r3%:
  392. Hb%,Ib%,I%:
  393. Jb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%:
  394. Qb(Gb%,Jb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%):
  395. Jb%>=63 Hb%=0
  396. Hb%=1
  397.  Create a sprite
  398. 131118,15+256,Eb%,Db$,Hb%,Fb%
  399. Lb%,Fb%
  400. Nb%,Gb%:
  401.  Divert output to it
  402. :g!ja%=0:
  403. 131118,60+256,Eb%,Db$,ja%
  404. r0%,r1%,r2%,r3%:
  405. 46,r0%,r1%,r2%,r3%:I%=
  406. T_(0):
  407.  Give the sprite a palette (if less than 63 colours)
  408. 131118,24+256,Eb%,Db$
  409. ,,Ib%:
  410. 4:Ib%!(44+I%*2)=Rb%!I%:Ib%!(44+I%*2+4)=Rb%!I%:
  411. 4:Ib%!(44+I%*2)=Sb%!I%:Ib%!(44+I%*2+4)=Sb%!I%:
  412. 4:Ib%!(44+I%*2)=Tb%!I%:Ib%!(44+I%*2+4)=Tb%!I%:
  413. 264016:
  414.  Make white background
  415. Ub(&FFFFFF00):
  416. 0,0,Fb%:
  417.  Call appropriate sub-routine
  418. &FF9:
  419. Vb(Bb%,1,Gb%,0,0,Fb%,Fb%)
  420. &AFF,&CC3:
  421. Wb(Bb%,Fb%,Cb%)
  422. &D94:
  423. Xb(Bb%,Fb%,Cb%)
  424.  Restore output back to screen
  425. 46,r0%,r1%,r2%,r3%:
  426. 264016:
  427. G`(1,"Unable to display this Artworks file."):pa%=
  428. Vb(Yb%,Zb%,Gb%,ab%,bb%,cb%,db%):
  429. eb%,fb%,gb%,Jb%,Kb%,hb%,Mb%,ib%,Ob%,Pb%,Lb%,Nb%:
  430. jb,kb,lb,mb,nb,ob,pb%:
  431. qb%,rb%,sb%,tb%,ub%:
  432. 46,13+256,Yb%,la%,13,Zb%:
  433. 131118,40+256,Yb%,la%
  434. ,,,eb%,fb%,,gb%
  435. Qb(gb%,sb%,Kb%,hb%,Mb%,ib%,Ob%,Pb%):jb=eb%*hb%:ma%!0=hb%*256:kb=fb%*ib%:ma%!4=ib%*256:
  436. jb<>0
  437. kb<>0
  438. h*lb=cb%/jb:mb=db%/kb:
  439. lb<mb mb=lb
  440. lb=mb
  441. Qb(Gb%,tb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%):
  442. lb<>0 ma%!8=Lb%*256/lb
  443. mb<>0 ma%!12=Nb%*256/mb
  444. 46,24+256,Yb%,la%
  445. ,,pb%:
  446. pb%!32<>44
  447. pb%!32-52
  448. 8:vb%!(I%/2)=pb%!(I%+44):
  449. :qb%=vb%
  450. 15:qb%=Rb%
  451. 3:qb%=Sb%
  452. 1:qb%=Tb%
  453. :qb%=0
  454. 15:rb%=Rb%
  455. 3:rb%=Sb%
  456. 1:rb%=Tb%
  457. :rb%=0
  458. sb%>255
  459.     ub%=0
  460. :ub%=na%:
  461. pb%!32<>44+2048
  462. 264000,gb%,qb%,Gb%,rb%,na%
  463. 264006,qb%!(Q%<<2),Gb%,rb%
  464. na%?Q%:
  465. :nb=(cb%-lb*jb)/2+ab%:ob=(db%-mb*kb)/2+bb%:
  466. 46,52+256,Yb%,la%,nb,ob,8,ma%,ub%
  467. Wb(Bb%,Fb%,Cb%):
  468. jb,kb,lb,mb,nb,ob:
  469.  not Points%
  470. jwb=Bb%!24:xb=Bb%!28:yb=Bb%!32:zb=Bb%!36:jb=(yb-wb)
  471. 256:kb=(zb-xb)
  472. 256:_b%=wb
  473. 256:`b%=xb
  474. jb=0 jb=1
  475. kb=0 kb=1
  476. *lb=Fb%/jb:mb=Fb%/kb:
  477. lb<mb mb=lb
  478. lb=mb
  479. Ac=lb:nb=(Fb%-lb*jb)/2:ob=(Fb%-mb*kb)/2:Bc=&10000*Ac:Cc=Bc/&10000:ka!0=Bc:ka!4=0:ka!8=0:ka!12=Bc:ka!16=nb*&100-wb*Cc:ka!20=ob*&100-xb*Cc:
  480. 415040,0,Bb%,Cb%,ka,0:
  481. Xb(Dc%,Fb%,I_%):
  482. Dc%!4>10
  483. !Ka%=Dc%:!La%=I_%:!Ma%=-1:!Na%=I_%:
  484. Ea:!Ma%=!Ka%:!Na%=!La%:!Ka%=!Ma%+!Na%:!La%=0:
  485. Za:!Ga%=0:Ga%!4=0:Ga%!8=!Oa%:Ga%!12=!Pa%:Ga%!16=!Qa%:Ga%!20=!Ra%:jb=!Qa%-!Oa%:kb=!Ra%-!Pa%:
  486. jb=0 jb=1
  487. kb=0 kb=1
  488. %lb=Fb%*256/jb:
  489. lb>=&7FFF
  490. lb=&7FFF
  491. %mb=Fb%*256/kb:
  492. mb>=&7FFF
  493. mb=&7FFF
  494. lb<mb mb=lb
  495. lb=mb
  496. !Ha%=&10000*lb:Ha%!4=0:Ha%!8=0:Ha%!12=&10000*lb:Ha%!16=(Fb%*256-jb*lb)/2-!Oa%*lb:Ha%!20=(Fb%*256-kb*lb)/2-!Pa%*lb:
  497. ,Jb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%):!Ia%=Kb%:Ia%!4=Mb%:Ia%!8=Ob%:
  498. 1:Ec%=Fc%
  499. 3:Ec%=Gc%
  500. 15:Ec%=Hc%
  501. :Ec%=Ic%
  502. 4:!(Ia%+12+I%)=Ec%!I%:
  503. :!Ja%=110:
  504. 263872:
  505. 263874:
  506. za(Jc%,Kc%,
  507. Lc%):
  508. Jb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%:
  509.  X OS Units Per Word
  510. Qb(Kc%,Jb%,Kb%,Lb%,Mb%,Nb%,Ob%,Pb%):Mc%=Lb%*8/Pb%*4:
  511. Mc%<>0
  512. Jc%=((Jc%
  513. Mc%)+1)*Mc%
  514. :Lc%=((Jc%/Lb%*Jc%/Nb%)*Pb%/8-(Pb%=8)*512+256):
  515. Kc%=2
  516. Kc%=4
  517. Kc%=5
  518. Kc%=10
  519. Lc%=Lc%*2
  520. Ab(Nc%,Kc%):
  521. Bb%,J%,I%:
  522. 53,Kc%,3
  523. ,,Jb%:Bb%=Nc%+Nc%!8:
  524. Nc%!4:
  525. 4:Bb%!(44+I%*2)=Rb%!I%:Bb%!(44+I%*2+4)=Rb%!I%:
  526. 4:Bb%!(44+I%*2)=Sb%!I%:Bb%!(44+I%*2+4)=Sb%!I%:
  527. 4:Bb%!(44+I%*2)=Tb%!I%:Bb%!(44+I%*2+4)=Tb%!I%:
  528. :Bb%+=!Bb%:
  529. _a(S%,Cb%):!S%=Cb%:S%!8=16:
  530. 46,9+256,S%:
  531. Qb(Kc%,
  532. Pb%):
  533. 53,Kc%,3
  534. ,,Oc%:
  535. 53,Kc%,4
  536. ,,Kb%:Lb%=1<<Kb%:
  537. 53,Kc%,5
  538. ,,Mb%:Nb%=1<<Mb%:
  539. 53,Kc%,9
  540. ,,Ob%:Pb%=1<<Ob%:
  541. Ub(Qc):
  542. 264005,Qc,
  543. 3)<<6
  544. Sc(Tc%):
  545. c%,p%:
  546. 53,Tc%,3
  547. ,,c%:
  548. 15:p%=Rb%
  549. 3:p%=Sb%
  550. 1:p%=Tb%
  551. :p%=0
  552. 256(m%):
  553. 53,m%,3
  554. ,,c%:=(c%>=63)
  555. Rb% 80,Sb% 80,Tb% 80,Uc% 320,vb% 1023:
  556. 8,255,g_$+".Pal16",Rb%:
  557. 8,255,g_$+".WimpPals",Uc%:Fc%=Uc%:Gc%=Fc%+80:Hc%=Gc%+80:Ic%=Hc%+80:
  558. 1:Tb%!(4*(1-I%))=(&FFFFFF*I%)<<8:
  559. 3:Sb%!(4*(3-I%))=(&555555*I%)<<8:
  560.