home *** CD-ROM | disk | FTP | other *** search
/ Walkthroughs & Flybys / WAITE_GROUP.bin / demos / sartists / 92col_so.grp next >
Text File  |  1993-05-16  |  18KB  |  1,001 lines

  1. ;    The '92 Collection Demo CD team
  2. ;
  3. ;        Produced by David Cook - Manager of Product Demonstrations
  4. ;        ICL Personal Systems 0483-486868
  5. ;
  6. ;        Directed by William Wisely - MD of Screen Artists Ltd 081-642-1370
  7. ;            Technical support              Phil Shatz
  8. ;             3D modeling and animation      Kenn Jordan and Michele Bousquet
  9. ;            Impressionist build            Andrew Clatcher
  10. ;            Typography and Adminstration   Lorna McNutt
  11. ;
  12. ;        Music by The Multimedia Music Company - 081-698-0534
  13. ;            Adrian Sutton, Anthony Aldridge & Peter Buick
  14. ;
  15. ;        Special thanks to Kevin Rayner for supplying an ICL DRS Model 75
  16. ;
  17. ;        The graphics in this presentation were created using the Autodesk
  18. ;            Multimedia Products: 3D Studio and Animator Pro.  What follows 
  19. ;            is the main GRASP program.  Grasp is available from Paul Mace 
  20. ;            Software in the USA on 503-488-0224
  21. ;
  22.  
  23. closegl
  24. merge text.dat
  25. opengl 92col
  26. init
  27.  
  28. top:
  29. databegin list
  30. t1:
  31.    if @=="end" 
  32.       goto t2
  33.    else
  34.       set ttl @ttl+1
  35.    endif
  36. goto t1
  37. t2:
  38.  
  39. mark @ttl
  40.    databegin list
  41.    dataskip @cnt
  42.    set rnt @
  43.    if @rnt=="end"
  44.       set cnt 0  
  45.       break t2   
  46.    endif
  47.    @rnt
  48.    set cnt @cnt+1
  49. loop
  50. goto t2
  51.  
  52. list:
  53. "ergo"
  54. "pcs"
  55. "meet"
  56. "cover"
  57. "csrange"
  58. "cxrange"
  59. "cxe"
  60. "fxrange"
  61. "mxrange"
  62. "meu"
  63. "no_note"
  64. "keyb"
  65. "workergo"
  66. "lock"
  67. "durange"
  68. "ergoarm"
  69. "secrts"
  70. "lcds"
  71. "hightec"
  72. "end"                             
  73.  
  74.  
  75. list_titles:
  76. "Ergonomic"
  77. "PCs"
  78. "Meeting"
  79. "Cover"
  80. "CS Range"
  81. "CX Range"
  82. "CXe Range"
  83. "FX Range"
  84. "MX Range"
  85. "MEU"
  86. "No Notebook"
  87. "Keyboards"
  88. "Workplace"
  89. "Security"
  90. "DU Monitors"
  91. "Ergo Arm"
  92. "SE Range"
  93. "Freestyle"
  94. "Human touch"
  95. "end"
  96.  
  97.  
  98. ;----------------------
  99. ergo:
  100. pload ns3.pic 1
  101. pload 256black.pal 2
  102. palette 2
  103. pfade 0,1
  104. spread 2 1 30            ;fade in opening picure
  105. pfree 1,2
  106. dload ns3.flc 2 1        ;opening flic
  107. dload fly92.cel 1 1        ;end with background flic
  108. putdff 2 6 0 98        ;first part of opening
  109. putdff 2 8 99    299        ;second part of opening (slower)
  110. putdff 1 6 0 300        ;flic to end with backgound
  111. dfree 1,2
  112. pload mixd.pal 1
  113. pload mixc.pal 2
  114. cload mixd.pic 1 1        ;first picture
  115. palette 1
  116. databegin ergo_dat
  117. headfull
  118. cfade 18,33,104,1
  119. spread 1,2,50
  120. pfree 1,2
  121. cfree 1
  122. texbox
  123. chktime 0 50 1
  124. return
  125.  
  126. ;----------------------
  127. pcs:
  128. pload syscomd1.pal 1
  129. pload syscom.pal 2
  130. pload mixc.pal 3
  131. cload syscomd1.pic 1 1
  132. spread 3,1,20
  133. cfade 18,33,104,1
  134. clrtop
  135. clrtext
  136. spread 1,2,40
  137. databegin pcs_dat
  138. headfull
  139. pfree 1,2,3
  140. cfree 1
  141. texbox
  142. chktime 0 59 2
  143. return
  144.  
  145.  
  146. ;----------------------
  147. meet:
  148. pload syscomt.pal 1
  149. pload syscom.pal 2
  150. pload andrewt.pal 3
  151. cload andrewd.pic 1 1
  152. dload andrewm.cel 1 1
  153. button
  154. clrtop
  155. clrtext
  156. spread 2,1,25            ;go cream
  157. cfade 18,33,104,1        ;fade andrew start
  158. cfree 1
  159. spread 1,3,2            ;go andrews colours
  160. pfree 1,2,3
  161. putdff 1 2 0 500 33 104        ;play andrew drawing
  162. dfree 1
  163. databegin meet_dat
  164. headfull
  165. cload people.pic 1
  166. cfade 5,33,104,1,15        ;fade actual people pic
  167. cfree 1
  168. pfree 1
  169. texbox
  170. chktime 1 13 3
  171. return
  172.  
  173. ;----------------------
  174. cover:
  175. button
  176. clrtop
  177. clrtext
  178. dload cover.cel 1 1
  179. putdff 1 5 0 100 33 104
  180. dfree 1
  181. databegin cover_dat
  182. texbox
  183. chktime 1 23 4
  184. return
  185.  
  186. ;----------------------
  187. csrange:
  188. button
  189. dload cs.cel 1 1
  190. putdff 1 10 0 100 0 74
  191. clrtext
  192. databegin cs_dat
  193. texbox
  194. chktime 1 33 5
  195. return
  196.  
  197. ;----------------------
  198. cxrange:
  199. button
  200. clrtext
  201. dload cx.cel 1 1
  202. putdff 1 10 0 100 0,84
  203. dfree 1
  204. databegin cx_dat
  205. texbox
  206. chktime 1 44 6
  207. return
  208.  
  209. ;----------------------
  210. cxe:
  211. button
  212. clrtext
  213. dload cxe.cel 1 1
  214. putdff 1 15 0 10 0,84
  215. dfree 1
  216. databegin nxe_dat
  217. texbox
  218. chktime 1 52 7
  219. return
  220.  
  221. ;----------------------
  222. fxrange:
  223. button
  224. clrtext
  225. dload fx.cel 1 1
  226. putdff 1 15 0 10 0,84
  227. dfree 1
  228. databegin fx_dat
  229. texbox
  230. chktime 2 02 8
  231. return
  232.  
  233. ;----------------------
  234. mxrange:
  235. button
  236. clrtext
  237. dload mx.cel 1 1
  238. putdff 1 15 0 10 0,84
  239. dfree 1
  240. databegin mx_dat
  241. texbox
  242. chktime 2 12 9
  243. clrtext
  244. texbox
  245. chktime 2 18 10
  246. return
  247.  
  248. ;----------------------
  249. meu:
  250. button
  251. clrtext
  252. dload meu.cel 1 1
  253. putdff 1 15 0 10 0,84
  254. dfree 1
  255. databegin meu_dat
  256. texbox
  257. chktime 2 26 11
  258. return
  259.              
  260. ;----------------------
  261. no_note:
  262. button
  263. dload close.cel 1 1        ;alternate section for no notebook
  264. putdff 1 6 0 10 0,69
  265. dfree 1
  266. clrtext
  267. databegin nonote_dat
  268. texbox
  269. dload nonote.flc 1 1
  270. putdff 1 2 0 500
  271. pfree 1
  272. dfree 1
  273. cload logol.pic 1 1
  274. pload logod.pal 1
  275. pload logol.pal 2
  276. chktime 2 42 12
  277.  
  278. cfade 5,33,104,1
  279. spread 2 1 25
  280. pload moncomd.pal 1
  281. palette 1
  282. cload moncomd.pic 1 1
  283. pload moncoml.pal 3
  284. button
  285. clrtext
  286. cfade 18,33,104,1
  287. spread 1 3 40
  288. cfree 1,2,3
  289. pfree 1
  290. databegin crts_dat
  291. texbox
  292. chktime 2 53 13
  293. return
  294.  
  295. ;----------------------
  296. nte:
  297. button
  298. dload close.cel 1 1
  299. putdff 1 5 0 10 0,69
  300. dfree 1
  301. clrtext
  302. dload notemorf.flc 1 1
  303. putdff 1 4 0 100
  304. dfree 1
  305. databegin note_dat
  306. texbox
  307. pload notel.pal 1
  308. pload noteclr.pal 2
  309. cload moncomd.pic 1 1
  310. pload moncoml.pal 3
  311. chktime 2 42 14
  312. button
  313. clrtext
  314. spread 1 2 25
  315. cfade 18,33,104,1
  316. spread 2 3 50
  317. cfree 1,2,3
  318. pfree 1
  319. databegin crts_dat
  320. texbox
  321. chktime 2 53 15
  322. return
  323.  
  324. ;----------------------
  325. keyb:
  326. pload moncoml.pal 1
  327. pload newkeyl.pal 2
  328. pload newkeyd.pal 3
  329. cload newkeyd.pic 1
  330. button
  331. clrtext
  332. spread 1 3 25
  333. cfade 18,33,104,1
  334. spread 3 2 50
  335. cfree 1
  336. pfree 1,2,3
  337. databegin keyb_dat
  338. texbox
  339. chktime 3 5 16
  340. return
  341.  
  342. ;----------------------
  343. workergo:
  344. pload newkeyl.pal 1
  345. pload    wired.pal 2
  346. pload wirel.pal 3
  347. cload wired.pic 1 1
  348. button
  349. clrtext
  350. spread 1 2 25
  351. color 0
  352. box 414,104,416,399
  353. cfade 18,33,104,1
  354. spread 2 3 50
  355. databegin wb_dat
  356. headfull
  357. pfree 1
  358. pfree 2
  359. pfree 3
  360. cfree 1
  361. texbox
  362. dload wirefix.cel 1 1
  363. dload wirefixa.cel 2 1
  364. chktime 3 10 17
  365. putdff 1 8 0 500 32 104
  366. mark 3
  367.     putdff 2 8 0 35 32 104    ;spin the world
  368. loop
  369. dfree 1 2
  370. chktime 3 40 18
  371. return
  372.  
  373. ;----------------------
  374. lock:
  375. cload lockd.pic 1 1
  376. pload lockd.pal 1
  377. pload lockl.pal 2
  378. button
  379. clrtext
  380. palette 1
  381. cfade 20 120 184 1 10
  382. spread 1 2 50
  383. cfree 1
  384. pfree 1,2
  385. databegin lock_dat
  386. texbox
  387. chktime 3 44 19
  388. dload keyturn.flc 1 1
  389. putdff 1 20 0 1 120 185        ;turn the key
  390. chktime 3 46 20
  391. putdff 1 20 1 2 120 185        ;turn it back
  392. chktime 3 48 21
  393. putdff 1 20 0 1 120 185
  394. chktime 3 50 22
  395. putdff 1 20 1 2 120 185
  396. dfree 1
  397. chktime 3 53 23
  398. return
  399.  
  400. ;----------------------
  401. durange:
  402. pload lockd.pal 1
  403. pload lockl.pal 3
  404. pload willl.pal 2
  405. cload willd.pic 1 1
  406. dload will.flc 1 1
  407. button
  408. clrtop
  409. spread 3 1 25
  410. cfade 18,120,188,1
  411. spread 1 2 50
  412. clrtext
  413. cfree 1
  414. pfree 1,2,3
  415. databegin du_dat
  416. texbox
  417. chktime 3 57 24
  418. putdff 1 5 0 50 32 104
  419. waitkey 10
  420. putdff 1 5 0 50 32 104
  421. return
  422.  
  423. ;----------------------
  424. ergoarm:
  425. pload willl.pal 1
  426. pload movemond.pal 2
  427. pload movemonl.pal 3
  428. cload movemond.pic 1 1
  429. dload movemon.cel 1 1
  430. spread 1 2 25
  431. button
  432. clrtext
  433. cfade 18,32,104,1
  434. spread 2 3 50
  435. cfree 1
  436. pfree 1,2,3 
  437.  
  438. databegin arm_dat
  439. texbox
  440. putdff 1 6 0 500 33 104
  441. dfree 1
  442. chktime 4 17 26
  443. return
  444.  
  445. ;----------------------
  446. secrts:
  447. pload movemonl.pal 1
  448. pload movemond.pal 4
  449. pload displ.pal 3
  450. cload dispd.pic 1 1
  451. spread 1 4 25
  452. button
  453. clrtext
  454. cfade 18,33,104,1
  455. spread 4,3,50
  456. cfree 1
  457. pfree 1,3,4
  458. databegin se_dat
  459. texbox
  460. chktime 4 26 27
  461. return
  462.  
  463. ;----------------------
  464. lcds:
  465. pload displ.pal 1
  466. pload fred.pal 2
  467. pload frel.pal 3
  468. cload fred.pic 1 1
  469. spread 1 2 25
  470. button
  471. clrtext
  472. cfade 18,33,104,1
  473. spread 2,3,50
  474. cfree 1
  475. pfree 1,2,3
  476.  
  477. databegin fre_dat
  478. texbox
  479. button
  480. chktime 4 34 28
  481. return
  482.  
  483. ;----------------------
  484. hightec:
  485. pload frel.pal 1
  486. pload find.pal 2
  487. pload finl.pal 3
  488. cload find.pic 1 1
  489. spread 1 2 25
  490. button
  491. clrtext
  492. cfade 18,33,104,1
  493. spread 2,3,50
  494. cfree 1
  495. pfree 1,2,3
  496. dload fin1.flc 1 1
  497. dload fin2.flc 2 1
  498. pload fixpal.pal 1
  499. palette 1
  500. putdff 1 6 1 100
  501. dfree 1
  502. putdff 2 6 0 500
  503. dfree 2
  504. pload last.pic 1
  505. pfade 5,1
  506. databegin ht_dat
  507. headfull
  508. chktime 5 19 29
  509. pload 256black.pal 2
  510. spread 1 2 100
  511. pfree 1,2
  512. color 0
  513. clearscr
  514. cdstop
  515. waitkey 1
  516. waitkey 1000
  517.  
  518. exec reset.exe    ;start cd again
  519. cdinit            ;check whether CD driver is loaded
  520. if !len(@drive)
  521.     setrbg 15 63 63 63
  522.     color 15
  523.     text "CD ROM Driver has failed"
  524.     waitkey
  525.     exit
  526. endif
  527. cdplay 2 325
  528. return
  529.  
  530.  
  531. ;-------------------------------------------------------------------------
  532. chktime:
  533. local min @1
  534. local sec @2
  535. exec findtime.exe @min @sec 
  536. return
  537.  
  538. ;-------------------------------------------------------------------------
  539. headfull:                ;centre heading over box or screen
  540. fon @
  541. if @=="centre"
  542.     window 8,460,632,0
  543.     set center on
  544. else
  545.     window 24,460,424,0
  546.     set center on
  547. endif    
  548. text @
  549. window
  550. ffree 1,2
  551. return
  552.  
  553. texbox:                    ;write text in the text area
  554. fon 2
  555. window 436,412,636,100
  556. text @ 
  557. window
  558. ffree 2
  559. return
  560.  
  561. button:                        ;push the button
  562. dload button.dff 10 1
  563. putdff 10 5 0 20 498 15
  564. dfree 10
  565. return
  566.  
  567. clrtext:                    ;clear the text area
  568. cload clrtext.pic 10 1
  569. cfade 5 431 92 10
  570. cfree 10
  571. return
  572.  
  573. clrtop:                    ;clear the title area
  574. cload clrtop.pic 10 1
  575. cfade 5 0 418 10
  576. cfree 10
  577. return
  578.  
  579. ;-------------------------------------------------------------------------
  580. boxx:                                  
  581. set m_call 1
  582. set mh 15                              
  583. set wide 136                           
  584. set hot 15
  585. set bck 6
  586. set txt 8
  587. set sha 0
  588. window
  589. cgetbuf 126 0 0 @wide+7 (@ttl*@mh)+10 1
  590. fon 3
  591. set left on
  592. color @bck                                
  593. rect 0 0 @wide (@ttl*@mh)+10           
  594. color @txt                               
  595. box 0 0 @wide (@ttl*@mh)+10            
  596. databegin list_titles                  
  597. set y @ttl*@mh                         
  598. mark @ttl                              
  599.     window 10 @y-@mh @wide @y           
  600.     text @                              
  601.     set y @y-@mh                        
  602. loop
  603. gosub display                          
  604. ask:                                   
  605. set z @cnt                             
  606. set pcnt @cnt                          
  607. waitkey 
  608. ifkey esc out
  609. ifkey down dnarrow 
  610. ifkey up uparrow
  611. getkey k                               
  612.    if peekw(adr(@k))==13               
  613.       fadein 12,126
  614.       cfree 126
  615.       window
  616.       return                           
  617.    endif
  618. goto ask                               
  619.  
  620. uparrow:                               
  621.     if @cnt==0                          
  622.         set cnt @ttl-1                   
  623.     else    
  624.         set cnt @cnt-1                   
  625.     endif
  626.     goto proc                           
  627. dnarrow:
  628.     if @cnt==@ttl-1                     
  629.         set cnt 0                        
  630.     else
  631.         set cnt @cnt+1                   
  632.     endif
  633. proc:
  634.     gosub display2                      
  635.     gosub display                       
  636.     goto ask                            
  637.  
  638. out:                                   
  639.    exit
  640.  
  641. display:                               
  642.     set t @cnt-@ttl                     
  643.     dataskip @t                         
  644.     set y ((@ttl*@mh)-(@mh*@cnt)        
  645.     window 10 @y-@mh @wide @y           
  646.     color @hot                           
  647.     text @                              
  648.     dataskip -1-@t                      
  649. return
  650.  
  651. display2:                              
  652.     set t @z-@ttl
  653.     dataskip @t
  654.     set y (@ttl*@mh)-(@mh*@z)
  655.     window 10 @y-@mh @wide @y
  656.     color @txt
  657.     text @
  658.     dataskip -1-@t
  659. return
  660.  
  661. menucheck2:
  662. if @m_call!=0
  663.     set m_call 0
  664.     pload @1 1
  665.     pfade 5,1
  666.     palette 1
  667.    setpage 0,1
  668.    pfade 0,1
  669.    setpage 0,0
  670.    pfree 1
  671. endif
  672. return
  673.  
  674. fadein:
  675. cfade @1 ("c"$@2)->xoff ("c"$@2)->yoff @2 @3 @4
  676. return
  677.  
  678. fon:
  679. if @1==1
  680.     fload berl24b.set 1
  681.    color 4,32
  682.    set center on
  683.    font 1
  684.    fstyle 8,4
  685.    fgaps 2,10,0
  686. endif
  687. if @1==2
  688.     fload berl18.set 2
  689.    color 4,31
  690.    set left on
  691.    font 2
  692.    fstyle 8,4
  693.    fgaps 1,7,-4
  694. endif
  695. if @1==3
  696.     font 3
  697.     color 15,0
  698.     set left on
  699.     fstyle 8,1
  700.    fgaps 1,3
  701. endif
  702. return
  703.  
  704. init:
  705. exec reset.exe
  706. cdinit            ;check whether CD driver is loaded
  707. if !len(@drive)
  708.   text "CD ROM Driver not loaded"
  709.   waitkey
  710.   exit
  711. endif
  712. cdstop
  713. cdplay 2 325
  714. timer
  715. video s
  716. color 0
  717. clearscr
  718. global mod_count 0         ;pointer to next module in data.dat
  719. global cnt 0               ;indice of current routine
  720. global pcnt 0              ;prior value of cnt
  721. global rnt ""              ;name of current routine
  722. global ttl 0               ;total number of routines
  723. global m_call 0       ;menu visited flag
  724. global skip 0           ;to be set to 1 if now wait needed in main loop
  725. global rm 24           ;default right margin
  726. fload normal.fnt 3
  727. return
  728.  
  729.  
  730. ;CDINIT
  731. ;
  732. ; Checks for CD driver software and sets drive name in global @drive.
  733. ;
  734. cdinit:
  735.   int 0x2f 0x1500,0
  736.   if @bx
  737.     global drive chr(@cx+asc("A")) ;set name of CD-ROM drive
  738.  
  739.   else
  740.     global drive ""
  741.   endif
  742.   return
  743.  
  744.  
  745. ; CDSTATUS
  746. ;
  747. ; Returns CD Drive status and sets global variables @first and @last.
  748. ;
  749. cdstatus:
  750.   local  buf ofs("123456")
  751.   local  bseg seg(@buf);
  752.   poke  @bseg @buf 10                   ;Audio Disk Info
  753.   cdcmd  3,@buf|(@bseg<<16),6           ;READ IOCTL Input
  754.   cdcheck  @0,cdstatus
  755.   global  first peek(@bseg,@buf+1)+0
  756.   global  last  peek(@bseg,@buf+2)+0
  757.   poke  @bseg @buf 6                    ;Device status
  758.   cdcmd  3,@buf|(@bseg<<16),5           ;READ IOCTL Input
  759.   cdcheck  @0,cdstatus
  760.   return  peekl(@bseg,@buf+1)
  761.  
  762.  
  763. ; PRTSTATUS
  764. ;
  765. ; Displays device characteristics and status.
  766. ;
  767. prtstatus:
  768.   if @1&1
  769.     text "Door Open"$chr(10)
  770.   else
  771.     text "Door Closed"$chr(10)
  772.   endif
  773.  
  774.   if @1&2
  775.     text "Door unlocked"$chr(10)
  776.   else
  777.     text "Door locked"$chr(10)
  778.   endif
  779.  
  780.   if @1&4
  781.     text "Supports cooked and raw reading"$chr(10)
  782.   else
  783.     text "Supports only cooked reading"$chr(10)
  784.   endif
  785.  
  786.   if @1&8
  787.     text "Read/write"$chr(10)
  788.   else
  789.     text "Read only"$chr(10)
  790.   endif
  791.  
  792.   if @1&16
  793.     text "Data read and plays audio/video tracks"$chr(10)
  794.   else
  795.     text "Data read only"$chr(10)
  796.   endif
  797.  
  798.   if @1&32
  799.     text "Supports ISO-9660 interleaving using interleave size and skip factor"$chr(10)
  800.   else
  801.     text "No interleaving"$chr(10)
  802.   endif
  803.  
  804.   if @1&128
  805.     text "Supports prefetching requests"$chr(10)
  806.   else
  807.     text "No Prefetching"$chr(10)
  808.   endif
  809.  
  810.   if @1&256
  811.     text "Supports audio channel manipulation"$chr(10)
  812.   else
  813.     text "No audio channel manipulation"$chr(10)
  814.   endif
  815.  
  816.   if @1&512
  817.     text "Supports HSG and Red Book addressing modes"$chr(10)
  818.   else
  819.     text "Supports HSG addressing mode"$chr(10)
  820.   endif
  821.  
  822.   if @1&2048
  823.     text "No disc is present in the drive"$chr(10)
  824.   else
  825.     text "Disc is present in the drive"$chr(10)
  826.   endif
  827.  
  828.   return
  829.  
  830.  
  831. ; CDPLAY TRACK NUM_SECONDS [MINUTES SECONDS FRAMES]
  832. ;
  833. ; Starts playing at TRACK for NUM_SECONDS duration.
  834. ; MINUTES, SECONDS, and FRAMES (which are a 1/75th of
  835. ; a second) are optional offsets into the specified track
  836. ; to begin playing.
  837. ;
  838. cdplay:
  839.   cdtrack  @1 @3 @4 @5
  840.   cdcmd  132,@0,@2*75
  841.   cdcheck  @0,cdplay
  842.   return
  843.  
  844.  
  845. ; CDPLAYTO TRACK MINUTES SECONDS FRAMES TRACK MINUTES SECONDS FRAMES
  846. ;
  847. ; Plays from one TRACK (at offset MINUTES SECONDS FRAMES into it)
  848. ; to the second TRACK (at the second offsets into it).
  849. ;
  850. cdplayto:
  851.   cdtrack  @1 @2 @3 @4
  852.   local  begin @0
  853.   cdtrack  @5 @6 @7 @8
  854.   local  end @0
  855.   cdcmd  132,@begin,@end-@begin
  856.   cdcheck  @0,cdplayto
  857.   return
  858.  
  859.  
  860. ; CDSTOP
  861. ;
  862. ; Stops playing immediately.
  863. ;
  864. cdstop:
  865.   cdcmd  133,0,0
  866.   cdcheck  @0,cdstop
  867.   return
  868.  
  869.  
  870. ; CDRESUME
  871. ;
  872. ; Resumes playing from the last CDSTOP.
  873. ;
  874. cdresume:
  875.   cdcmd  136,0,0
  876.   cdcheck  @0,cdresume
  877.   return
  878.  
  879.  
  880. ; CDSEEK TRACK [MINUTES SECONDS FRAMES]
  881. ;
  882. ; Moves the playing head to a given track to minimize startup time.
  883. ; Parameters are the same as CDPLAY.
  884. ;
  885. cdseek:
  886.   cdtrack @1 @2 @3 @4
  887.   cdcmd 131,@0,0
  888.   cdcheck  @0,cdseek
  889.   return
  890.  
  891.  
  892. ; CDTRACK TRACK MINUTES SECONDS FRAMES
  893. ;
  894. ; Returns the absolute sector number of a track.
  895. ;
  896. cdtrack:
  897.   local  buf ofs("1234567")
  898.   local  bseg seg(@buf);
  899.   poke  @bseg @buf 11                ;Get Audio Track Info
  900.   poke  @bseg @buf+1 @1              ;track number
  901.   cdcmd  3,@buf|(@bseg<<16),7        ;READ IOCTL Input
  902.   cdcheck  @0,cdtrack
  903.   return  peekl(@bseg,@buf+2)+(@2*60+@3)*75+@4  ;return track address
  904.  
  905.  
  906. ; CDEJECT
  907. ;
  908. ; Opens the CD drive's tray/door.
  909. ;
  910. cdeject:
  911.   local  buf ofs("1")
  912.   local  bseg seg(@buf);
  913.   poke  @bseg @buf 0                 ;Eject Disk
  914.   cdcmd  12,@buf|(@bseg<<16),1       ;WRITE IOCTL Output
  915.   cdcheck  @0,cdeject
  916.   return
  917.  
  918.  
  919. ; CDCLOSE
  920. ;
  921. ; Closes the CD's drive tray/door.
  922. ;
  923. cdclose:
  924.   local  buf ofs("1")
  925.   local  bseg seg(@buf);
  926.   poke  @bseg @buf 5                 ;Close Tray
  927.   cdcmd  12,@buf|(@bseg<<16),1       ;WRITE IOCTL Output
  928.   cdcheck  @0,cdclose
  929.   return
  930.  
  931.  
  932. ; CDCMD
  933. ;
  934. ; Sets up command data in memory and calls the CD player software.
  935. ;
  936. cdcmd:
  937.   local req ofs("12345678901234567890123456")
  938.   local rseg seg(@req)
  939.   poke  @rseg @req 13                ;param length
  940.   poke  @rseg @req+1 0               ;subunit
  941.   poke  @rseg @req+2 @1              ;command code
  942.   pokew @rseg @req+3 0               ;status
  943.   pokel @rseg @req+5 0 0             ;reserved
  944.   poke  @rseg @req+13 1              ;address mode
  945.   pokel @rseg @req+14 @2             ;begin
  946.   pokel @rseg @req+18 @3             ;length
  947.   pokel @rseg @req+22 0              ;reserved
  948.   int 0x2f 0x1510,@req,asc(@drive)-asc("A"),,,,,seg(@req)
  949.   if peek(@rseg,@req+4)&0x80
  950.     databegin
  951.       "Unknown Error"
  952.       "Write-protect violation"
  953.       "Unknown unit"
  954.       "Drive not Ready"
  955.       "Unknown command"
  956.       "CRC error"
  957.       "Bad drive request structure length"
  958.       "Seek Error"
  959.       "Unknown media"
  960.       "Sector not found"
  961.       "Printer out of paper"
  962.       "Write Fault"
  963.       "Read Fault"
  964.       "General failure"
  965.       "Reserved 1"
  966.       "Reserved 2"
  967.       "Invalid disk change"
  968.     dataend
  969.     if peek(@rseg,@req+3)<16
  970.       dataskip peek(@rseg,@req+3)+1
  971.     endif
  972.     return @
  973.   else
  974.     return ""
  975.   endif
  976.  
  977.  
  978. ; CDCHECK
  979. ;
  980. ; Reports any errors encountered by CDCMD.
  981. cdcheck:
  982.   if @1!=""
  983.     text chr(10)$@2$": "$@1$chr(10)
  984.   endif
  985.   return
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.