1 !    OUTPUT 2 USING "#,K";"<lf>INDENT<cr>REN 1,1<cr><lf>RE-STORE ""SPAM_GEN""<cr>"
2     Load_loader(1)
3     STOP
4     !
5 Load_gen_con:    !
6     Load_loader(0)
7     STOP
8     !
9 Load_delend:  !
10 !   OUTPUT 2 USING "#,K";"<lf>INDENT<cr>REN 1,1<cr><lf>RE-STORE ""SPAM""<cr>"
11    !
12    !                      SPAM file
13    !
14    !     This file contains the Signal Processing Application Manager.
15    !     It consists of a spreadsheet that is used to load and run the
16    !     various demo programs available.  The list of demo programs
17    !     available is read from the file SPAM_SETUP when this program
18    !     is first run.  The SPAM_SETUP file should be an ASCII type file
19    !     with the format shown below:
20    !
21    !     <first line>    10  !  <Description of first demo program>
22    !                     20  !  <Filename of first demo program>
23    !                     30  !  <Description of second demo program>
24    !                     40  !  <Filename of second demo program>
25    !                              .
26    !                              .
27    !                              .
28    !                     ??? !  <Description of last demo program>
29    !     <last line>     ??? !  <Filename of last demo program>
30    !
31    !
32    !     The above format is easily obtained by simply editing a file
33    !     with the BASIC editor, and 'SAVE'ing the result in SPAM_SETUP.
34    !
35    Main_main(0)
36    STOP
37    !
38    !  This entry point is used when loading a demo program.
39 Main_from_load:   !
40    Main_main(1)
41    STOP
42    !
43    END
44    !
45    ! PAGE -> 
46    !***********************************************************************
47 Main_main:SUB Main_main(From_load)
48      !
49      !  This is the subprogram that is first called after a run is given
50      !  for the Signal Processing Application Manager.  The From_load
51      !  parameter indicates the program is in the process of loading
52      !  a demo program.  This subprogram initializes the system based
53      !  on if its loading an application program, its the first time
54      !  this program was run after being loaded, or the program was
55      !  just loaded and run.  The later two cases are distinguished by
56      !  the Skip_init_flag that is kept in common.
57      !
58      COM /Main_spread/ Row,Col,Start_row
59      COM /Main_boxes/ Box$(1:2,1:18)[40]
60      COM /Main_title/ Title$(1:2,0:2)[40]
61      COM /Main_prompt/ Prompt$(1:2)[80]
62      COM /Main_width/ Col_width(1:2)
63      COM /Main_max/ Max_col,Max_row,Modify_col
64      COM /Main_file/ Appl_file$(1:18)[120],Appl_loaded
65      COM /Main_init/ Skip_init_flag
66      !
67      FOR Keynum=0 TO 9
68        ON KEY Keynum LABEL "" GOSUB Main_main_dum
69      NEXT Keynum
70      !
71      IF Skip_init_flag THEN 
72        !  Run at least once before since being loaded, only need to
73        !  initialize the Cnfg, Diag, and Appl files.
74        !
75        DISP "Initializing hardware configuration . . ."
76        Cnfg_init
77        Diag_init
78        IF (NOT From_load) AND (Appl_loaded<>0) THEN 
79          Main_appl_init
80        END IF
81      END IF
82      !
83      IF NOT Skip_init_flag THEN 
84        ! First time run after being loaded, initialize all files.
85        !
86        DISP "Initializing . . ."
87        Main_initall
88        DISP "Initializing hardware configuration . . ."
89        Cnfg_init
90        Diag_init
91        DISP "Initializing SPAM"
92        Main_init
93        Skip_init_flag=1
94      END IF
95      DISP ""
96      !
97      IF From_load THEN 
98        !  If in process of loading a demo program, call the loader.
99        !
100       IF NOT FNMain_load_appl("") THEN 
101         Appl_loaded=0
102       END IF
103     END IF
104     !
105     !  Startup the Signal Processing Application Manager spreadsheet.
106     !
107     Main_spread(From_load)
108     !
109     SUBEXIT
110     !
111 Main_main_dum:    !
112     BEEP 
113     RETURN 
114     !
115   SUBEND
116   ! PAGE -> 
117   !***********************************************************************
118 Load_loader:SUB Load_loader(Init)
119     !
120     !  This subprogram is used to generate the SPAM file.  It loads the
121     !  available files into memory, and then deletes itself and prompts
122     !  the user to save the resulting SPAM file.  This subprogram uses
123     !  the keyboard buffer to load the files because BASIC doesn't allow
124     !  loading subprograms with new common blocks into an already running
125     !  program.  The user should not touch the computer until the loading
126     !  of the various files is complete.  The Init flag indicates to
127     !  start the loading process from the beginning.
128     !
129     COM /Appl_loader/ Pass$[20],File_list$(0:49)[100],File_ptr,Save_file$[100]
130     DIM Temp$(1:1)[80],Filename$[100],Temp_file$[100]
131     !
132     IF Init THEN Pass$=""
133     !
134     REPEAT
135       SELECT Pass$
136       CASE ""
137         GOSUB Load_startup
138         Pass$="START LOADING"
139         OUTPUT KBD USING "#,K";"<cr>ÿ#DEL 1,LOAD_GEN_CON<cr>RUN<cr>"
140         STOP
141       CASE "START LOADING"
142         Init_flag=1
143         RESTORE Load_data
144         File_ptr=0
145         DISP "GETTING MODULES"
146         REPEAT
147           READ Temp_file$
148           File_list$(File_ptr)=Temp_file$
149           IF Temp_file$<>"*" THEN File_ptr=File_ptr+1
150           !
151         UNTIL Temp_file$="*"
152         File_ptr=0
153         Save_file$=""
154         Pass$="LOAD THEM"
155       CASE "LOAD THEM"
156         Init_flag=1
157         Must_have=1
158         !
159         IF Save_file$<>"" THEN 
160           Filename$=Save_file$
161           Save_file$=""
162         ELSE
163           Save_file$=""
164           Filename$=File_list$(File_ptr)
165           File_ptr=File_ptr+1
166           !
167           Pnd_pos=POS(Filename$,"#")
168           IF Pnd_pos<>0 THEN 
169             Save_file$=Filename$
170             Must_have=0
171             IF Pnd_pos=1 THEN 
172               Save_file$=Save_file$[2]
173               Filename$=SYSTEM$("VERSION:BASIC")&Save_file$
174             ELSE
175               Filename$=Save_file$[1;Pnd_pos-1]&SYSTEM$("VERSION:BASIC")&Save_file$[Pnd_pos+1]
176               Save_file$=Save_file$[1;Pnd_pos-1]&Save_file$[Pnd_pos+1]
177             END IF
178             Dot_posn=POS(Filename$,".")
179             IF Dot_posn<>0 THEN Filename$[Dot_posn;1]="_"
180           END IF
181         END IF
182         !
183         IF Filename$<>"*" THEN 
184           GOSUB Load_chk_file
185           IF File_ok THEN ! Skip if not found and not needed
186             DISP "LOADING FROM FILE "&Filename$
187             OUTPUT KBD USING "#,K";"ÿ#<cr><cr>REN 1,1<cr>LOADSUB ALL FROM """&Filename$&"""<cr>RUN<cr>"
188             STOP
189           END IF
190         ELSE
191           Pass$="LOADED"
192         END IF
193       CASE "LOADED"
194         OUTPUT CRT;CHR$(12)
195         OUTPUT CRT;RPT$(CHR$(10),5)
196         OUTPUT CRT;"     SPAM is finished being generated!!"
197         OUTPUT CRT
198         OUTPUT CRT;"     When the prompt appears, store this program for future use."
199         OUTPUT CRT;"     Also COPY the ""SPAM_SETUP"" and ""FFT_COEFS"" files to the same media."
200         DISP ""
201         OUTPUT KBD USING "#,K";"ÿ#<cr>DEL 1,LOAD_DELEND<cr>DELSUB LOAD_LOADER<cr>REN 1,1<cr><lf><cr>DISP""Modify this line and store program""<cr>RE-STORE ""SPAM""ÿ<"
202         STOP
203       END SELECT
204     UNTIL 1=0
205     DISP ""
206     SUBEXIT
207     !
208 Load_data:  !
209     DATA FILE,INPT,SRCE,DISP,DIAG,CNFG,PLOT#,USER,HW,ICODE,LIB,*
210       !
211       !
212 Load_startup:!
213     OUTPUT CRT;CHR$(12)
214     OUTPUT CRT;RPT$(CHR$(10),4)
215     OUTPUT CRT;"  Generating the Signal Processing Application Manger"
216     OUTPUT CRT
217     OUTPUT CRT;"     This will take a few minutes to complete"
218     OUTPUT CRT
219     OUTPUT CRT;"     DO NOT attempt to stop this loading process!!"
220     RETURN 
221       !
222       !
223 Load_chk_file:!
224     REPEAT
225       File_ok=1
226       ON ERROR GOTO Load_ignore
227       Temp$(1)=""
228       CAT Filename$ TO Temp$(*)
229 Load_ignore:    !
230       OFF ERROR 
231       IF Temp$(1)="" THEN 
232         File_ok=0
233         IF NOT Must_have THEN RETURN 
234         DISP "Can't find file "&Filename$&", place in default MSI and press <CONTINUE>"
235         BEEP 
236         PAUSE
237       END IF
238     UNTIL File_ok
239     RETURN 
240   SUBEND
241   !
242   ! PAGE -> 
243   !***********************************************************************
244 Main_initall:SUB Main_initall
245     !
246     !  This subprogram initializes all the files.
247     !
248     Lib_lib
249     Icode_icode
250     Hw_hw
251     User_user
252     Plot_plot
253     !
254     Main_marquee
255     Cnfg_cnfg
256     !
257     Disp_disp
258     Srce_srce
259     Inpt_inpt
260     !
261     Diag_diag
262     File_file
263     !
264   SUBEND
265   !
266   ! PAGE -> 
267   !***********************************************************************
268 Main_init:SUB Main_init
269     !
270     !  This subprogram initializes the SPAM spreadsheet.
271     !
272     COM /Main_spread/ Row,Col,Start_row
273     COM /Main_boxes/ Box$(*)
274     COM /Main_title/ Title$(*)
275     COM /Main_prompt/ Prompt$(*)
276     COM /Main_width/ Col_width(*)
277     COM /Main_max/ Max_col,Max_row,Modify_col
278     COM /Main_file/ Appl_file$(*),Appl_loaded
279     !
280     DIM New_line$[160]
281     !
282     Max_col=2
283     Modify_col=2
284     Row=1
285     Col=2
286     Start_row=1
287     Max_row=0
288     Title$(1,0)="Signal Processing Application Manager"
289     !
290     RESTORE Main_sprd_data
291     FOR Col=1 TO Max_col
292       READ Col_width(Col),Title$(Col,1),Title$(Col,2),Prompt$(Col)
293     NEXT Col
294     !
295     ON ERROR GOTO Main_bad_file
296     ASSIGN @Spam_file TO "SPAM_SETUP"
297     OFF ERROR 
298     Spam_linecnt=0
299     !
300     ON ERROR GOTO Main_spam_bad
301     LOOP
302       ON END @Spam_file GOTO Main_spam_eof
303       ENTER @Spam_file;New_line$
304       Spam_linecnt=Spam_linecnt+1
305       Box$(1,Max_row+1)=TRIM$(New_line$[POS(New_line$,"!")+1])
306       Box$(2,Max_row+1)=""
307       ON END @Spam_file GOTO Main_spam_bad
308       ENTER @Spam_file;New_line$
309       Spam_linecnt=Spam_linecnt+1
310       Appl_file$(Max_row+1)=TRIM$(New_line$[POS(New_line$,"!")+1])
311       Max_row=Max_row+1
312     END LOOP
313     !
314 Main_spam_eof:    !
315     ASSIGN @Spam_file TO *
316     OFF ERROR 
317     !
318     SUBEXIT
319     !
320 Main_spam_bad:    !
321     User_clr_scr
322     PRINT "Error in SPAM_SETUP file near line #"&VAL$(Spam_linecnt)
323     PRINT "Fix error and re-run"
324     STOP
325     !
326 Main_bad_file:    !
327     User_clr_scr
328     PRINT "Unable to open SPAM_SETUP file under default directory"
329     PRINT "Fix error and re-run"
330     STOP
331     !
332 Main_sprd_data:    !
333     DATA 40,  "Application",  "", ""
334     DATA 11,  "Currently",    "Loaded",       "Waiting for softkey"
335   SUBEND
336   ! PAGE -> 
337   !************************************************************************
338 Main_spread:SUB Main_spread(From_load)
339     !
340     !  This subprogram displays the SPAM spreadsheet, and allows the user
341     !  to load and run demo programs.
342     !
343     COM /Main_spread/ Row,Col,Start_row       !keep these in com for memory
344     COM /Main_boxes/ Box$(*)
345     COM /Main_title/ Title$(*)
346     COM /Main_prompt/ Prompt$(*)
347     COM /Main_width/ Col_width(*)
348     COM /Main_max/ Max_col,Max_row,Modify_col
349     COM /Main_file/ Appl_file$(*),Appl_loaded
350     DIM New_entry$[400]
351     !
352     REDIM Box$(1:2,1:(Max_row)),Appl_file$(1:(Max_row))
353     !
354     GOSUB Main_sprd_keys
355     !
356     User_clr_scr
357     Dummy=FNUser_get_key
358     !
359     !  Set loaded flag in spreadsheet if an application loaded
360     IF Appl_loaded=0 THEN 
361       FOR R=1 TO Max_row
362         Box$(2,R)=""
363       NEXT R
364     ELSE
365       Box$(2,Appl_loaded)="*"
366     END IF
367     !
368     !Now call spread sheet.  It returns with New_entry$ and Row and Col
369     Done=0
370     REPEAT
371       CALL User_spread(Box$(*),Title$(*),Prompt$(*),New_entry$,Col_width(*),Modify_col,Col,Row,Start_row)
372       !
373       SELECT FNUser_check_key
374       !
375       CASE 0   !no key pressed, must be a New_entry$ for Box
376         BEEP 
377         !
378       CASE 1 ! Load application
379         Dummy=FNUser_get_key  !to clear the key
380         IF Row<>Appl_loaded THEN 
381           GOSUB Main_clr_keys
382           User_clr_scr
383           IF Appl_loaded<>0 THEN Box$(2,Appl_loaded)=""
384           Appl_loaded=Row
385           IF FNMain_load_appl(Appl_file$(Row)) THEN 
386           END IF
387           ! Returns only if an error
388           GOSUB Main_sprd_keys
389           Appl_loaded=0
390         END IF
391         !
392       CASE 2 ! Start loaded
393         Dummy=FNUser_get_key
394         IF Appl_loaded<>0 THEN 
395           GOSUB Main_clr_keys
396           User_clr_scr
397           Appl_main(0)
398           User_clr_scr
399           GOSUB Main_sprd_keys
400         ELSE
401           BEEP 
402         END IF
403         !
404       CASE 3 ! Save configuration
405         Dummy=FNUser_get_key
406         IF Appl_loaded<>0 THEN 
407           Main_save(Appl_file$(Appl_loaded),Ok)
408         ELSE
409           BEEP 
410         END IF
411         !
412       CASE 4 ! Get configuration
413         Dummy=FNUser_get_key
414         IF Appl_loaded<>0 THEN 
415           Main_recall(Appl_file$(Appl_loaded),Ok)
416         ELSE
417           BEEP 
418         END IF
419         !
420       CASE 6 ! Configuration
421         Dummy=FNUser_get_key
422         GOSUB Main_clr_keys
423         User_clr_scr
424         Cnfg_spread(Changed)
425         User_clr_scr
426         Diag_init
427         IF Changed AND (Appl_loaded<>0) THEN 
428           Main_appl_init
429         END IF
430         GOSUB Main_sprd_keys
431         !
432       CASE 8 ! Diagnostics
433         Dummy=FNUser_get_key
434         GOSUB Main_clr_keys
435         User_clr_scr
436         Diag_main
437         !
438         Cnfg_init
439         Diag_init
440         IF Appl_loaded<>0 THEN 
441           Main_appl_init
442         END IF
443         User_clr_scr
444         GOSUB Main_sprd_keys
445         !
446       CASE ELSE   !a softkey but not one of mine, so exit
447         Dummy=FNUser_get_key
448         BEEP 
449       END SELECT
450     UNTIL 1=0
451     CALL User_clr_scr
452     SUBEXIT
453     !
454 Main_dummy:    !
455     BEEP 
456     RETURN 
457     !
458 Main_sprd_keys: !
459     !define softkeys
460     ON KEY 0 LABEL "" GOSUB Main_dummy
461     ON KEY 1 LABEL FNUser_keylabel$("LOAD APPL.") CALL User_key1isr
462     ON KEY 2 LABEL "" GOSUB Main_dummy
463     ON KEY 3 LABEL "" GOSUB Main_dummy
464     ON KEY 4 LABEL "" GOSUB Main_dummy
465     IF Appl_loaded<>0 THEN 
466       ON KEY 2 LABEL FNUser_keylabel$("RUN LOADED") CALL User_key2isr
467       ON KEY 3 LABEL FNUser_keylabel$("SAVE SETUP") CALL User_key3isr
468       ON KEY 4 LABEL FNUser_keylabel$("GET SETUP") CALL User_key4isr
469     END IF
470     ON KEY 5 LABEL "" GOSUB Main_dummy
471     ON KEY 6 LABEL FNUser_keylabel$("CONFIG") CALL User_key6isr
472     ON KEY 7 LABEL "" GOSUB Main_dummy
473     ON KEY 8 LABEL FNUser_keylabel$("HARDWARE DIAG") CALL User_key8isr
474     ON KEY 9 LABEL "" GOSUB Main_dummy
475     RETURN 
476     !
477 Main_clr_keys:    !
478     FOR Keynum=0 TO 9
479       ON KEY Keynum LABEL "" GOSUB Main_dummy
480     NEXT Keynum
481     RETURN 
482     !
483   SUBEND
484   ! PAGE -> 
485   !************************************************************************
486 Main_appl_init:SUB Main_appl_init
487     COM /Main_file/ Appl_file$(*),Appl_loaded
488     COM /Main_init/ Skip_init_flag
489   !
490     DISP "Initializing Application . . ."
491     ON ERROR GOTO Main_no_appl
492     Appl_init
493     OFF ERROR 
494     SUBEXIT
495     !
496 Main_no_appl: !
497     OFF ERROR 
498     Skip_init_flag=0
499     Appl_loaded=0
500   !
501   SUBEND
502   ! PAGE -> 
503   !************************************************************************
504 Main_load_appl:DEF FNMain_load_appl(Appl_filename$)
505     !
506     !  This subprogram loads a demo file.  It first looks for the demo
507     !  file to load.  If the demo file is found, it deletes any previously
508     !  loaded demo program, then stops the program and restarts it to
509     !  clear out any common blocks from a previously loaded program,
510     !  and then loads the selected demo program.  Appl_filename$ is the
511     !  filename for the selected demo program.
512     !
513     COM /Main_load_appl/ Loading_file$[120],Fileloaded
514     !
515     DIM Temp$(1)[80]
516     !
517     Deleted_subs=0
518     Do_quick_load=0
519     !
520     IF Appl_filename$<>"" THEN 
521       DISP "Looking for application . . ."
522       Loading_file$=FNLib_full_path$(Appl_filename$)
523       ON ERROR GOTO Main_err_ignore
524       CAT Loading_file$ TO Temp$(*)
525 Main_err_ignore:!
526       OFF ERROR 
527       !
528       IF Temp$(1)<>"" THEN 
529         ON ERROR GOTO Main_ignr_del
530         DELSUB Appl_appl TO END
531         Deleted_subs=1
532 Main_ignr_del:!
533         OFF ERROR 
534         Fileloaded=0
535         !
536         Do_quick_load=1
537         IF Deleted_subs THEN 
538           DISP "Loading application . . ."
539           OUTPUT KBD USING "#,K";"ÿ#<cr>RUN MAIN_FROM_LOAD<cr>"
540           STOP
541         END IF
542       END IF
543     END IF
544     !
545     IF (Appl_filename$="") OR Do_quick_load THEN 
546       IF NOT Fileloaded THEN 
547         Fileloaded=1
548         DISP "Loading application . . ."
549         OUTPUT KBD USING "#,K";"ÿ#<cr>LOADSUB ALL FROM """&Loading_file$&"""<cr>RUN MAIN_FROM_LOAD<cr>"
550         STOP
551       ELSE
552         Fileloaded=0
553         DISP "Initializing application . ."
554         ON ERROR GOTO Main_not_loaded
555         Meas_meas
556         Appl_appl
557         Main_appl_init
558         Fileloaded=1
559 Main_not_loaded:!
560         OFF ERROR 
561       END IF
562     END IF
563     !
564     IF NOT Fileloaded THEN 
565       User_error(Appl_filename$&" file not found.  Unable to load application")
566     END IF
567     !
568     RETURN Fileloaded
569   !
570   FNEND
571   !
572 Main_save:SUB Main_save(Current_appl$,Ok)
573     !
574     !  This subprogram saves the current state of the various spreadsheets
575     !  for the currently loaded application.
576     !
577     ON ERROR GOTO Main_sv_badfile
578     Ok=1
579     CALL File_save_open(@File,Ok)
580     IF NOT Ok THEN GOTO Main_sv_badfile
581     !
582     ON ERROR GOTO Main_sv_bad
583     !
584     OUTPUT @File;Current_appl$
585     !
586     IF Ok THEN 
587       DISP "Saving configuration setup"
588       CALL Cnfg_save(@File,Ok)
589     END IF
590     IF Ok THEN 
591       DISP "Saving input setup"
592       CALL Inpt_save(@File,Ok)
593     END IF
594     IF Ok THEN 
595       DISP "Saving source setup"
596       CALL Srce_save(@File,Ok)
597     END IF
598     IF Ok THEN 
599       DISP "Saving measurement setup"
600       CALL Meas_save(@File,Ok)
601     END IF
602     IF Ok THEN 
603       DISP "Saving display setup"
604       User_save_ok=0
606       ON ERROR GOTO Skip_user_save
607       CALL User_disp_save(@File,Ok)
608       User_save_ok=1
610 Skip_user_save:       OFF ERROR 
612       IF ERRN=7 AND User_save_ok=0 THEN 
613          ON ERROR GOTO Main_sv_bad
615          CALL Disp_save(@File,Ok)
616       END IF
617     END IF
618     ASSIGN @File TO *
619     OFF ERROR 
620     IF Ok THEN 
621       DISP "Save done."
622       WAIT .5
623     ELSE
624       User_error("Save failed.")
625     END IF
626     SUBEXIT
627 Main_sv_bad:!
628     OFF ERROR 
629     CALL User_error("Save failed: "&ERRM$)
630     SUBEXIT
631 Main_sv_badfile:!
632     OFF ERROR 
633     SUBEXIT
634   SUBEND
635   !
636 Main_recall:SUB Main_recall(Current_appl$,Ok)
637     !
638     !  This subprogram recalls a saved save state.  The state must
639     !  match the currently loaded application.  If an error occurrs
640     !  during the recall, the recall is aborted and the state is reset.
641     !
642     DIM Recall_appl$[100]
643     !
644     ON ERROR RECOVER Main_ld_badfile
645     CALL File_load_open(@File,Ok)
646     IF NOT Ok THEN GOTO Main_ld_badfile
647     !
648     ON ERROR GOTO Main_ld_bad
649     !
650     ENTER @File;Recall_appl$
651     IF NOT (Current_appl$=Recall_appl$) THEN 
652       User_error("Load failed: File not saved from "&Current_appl$&".")
653       ASSIGN @File TO *
654       SUBEXIT
655     END IF
656     !
657     IF Ok THEN 
658       DISP "Recalling configuration setup"
659       CALL Cnfg_load(@File,Ok)
660     END IF
661     !
662     Main_appl_init
663     !
664     IF Ok THEN 
665       DISP "Recalling input setup"
666       CALL Inpt_load(@File,Ok)
667     END IF
668     IF Ok THEN 
669       DISP "Recalling source setup"
670       CALL Srce_load(@File,Ok)
671     END IF
672     IF Ok THEN 
673       DISP "Recalling measurement setup"
674       CALL Meas_load(@File,Ok)
675     END IF
676     IF Ok THEN 
677       DISP "Recalling display setup"
678       User_load_ok=0
680       ON ERROR GOTO Skip_user_load
681       CALL User_disp_load(@File,Ok)
682       User_load_ok=1
684 Skip_user_load:       OFF ERROR 
685       IF ERRN=7 AND User_load_ok=0 THEN 
686          ON ERROR GOTO Main_ld_bad
687          CALL Disp_load(@File,Ok)
688       END IF
689     END IF
690     ASSIGN @File TO *
691     IF Ok THEN 
692       DISP "Load done."
693       WAIT .5
694     ELSE
695       User_error("Load failed.")
696     END IF
697     SUBEXIT
698 Main_ld_bad:!
699     OFF ERROR 
700     CALL User_error("Load failed: "&ERRM$)
701     DISP "Initializing system"
702     Cnfg_cnfg
703     Cnfg_init
704     Diag_init
705     Main_appl_init  ! Reinitialize system
706     SUBEXIT
707 Main_ld_badfile:!
708     OFF ERROR 
709     SUBEXIT
710   SUBEND
711   ! PAGE -> 
712   !************************************************************************
713 Main_marquee:SUB Main_marquee
714     !
715     !  This subprogram puts up the pretty picture when SPAM is first run.
716     !
717     CALL User_clr_scr
718     GRAPHICS ON
719     INTEGER A(0:5)
720     GESCAPE CRT,3;A(*)       !gets CRT pixel size in A(*)
721     X_pixels=A(2)
722     IF X_pixels>1000 THEN 
723       Char_size=8*FNPlot_good_csize
724     ELSE
725       Char_size=4*FNPlot_good_csize
726     END IF
727     Plot_set_viewp(1,1,0,0,16)
728     CALL Plot_background
729     WINDOW 0,1,0,1
730     LORG 4
731     PEN 2
732     MOVE .5,.7
733     CALL Plot_bold_label(Char_size,"HP3565S")
734     MOVE .5,.55
735     CALL Plot_bold_label(Char_size/2,"Example Programs")
736     LORG 4
737     PEN 5
738     MOVE .5,.35
739     CALL Plot_bold_label(Char_size/3,"Frequency Response")
740     CALL Plot_bold_label(Char_size/3,"Power Spectral Density")
741     CALL Plot_bold_label(Char_size/3,"Digital Scope")
742     CALL Plot_bold_label(Char_size/3,"Throughput")
743     !
744     ! now plot fancy frame
745     PEN 1
746     FOR I=0 TO 3
747       Plot_set_viewp(1,1,0,0,I)
748       FRAME
749     NEXT I
750     PEN 2     !red
751     FOR I=4 TO 7
752       Plot_set_viewp(1,1,0,0,I)
753       FRAME
754     NEXT I
755     PEN 6  !brick red
756     FOR I=8 TO 11
757       Plot_set_viewp(1,1,0,0,I)
758       FRAME
759     NEXT I
760     PEN 1
761   SUBEND
762   ! PAGE -> 
763   !************************************************************************