source: buchla-68k/orig/RAM/SQREAD.C@ 73dd55f

Last change on this file since 73dd55f was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
File size: 2.1 KB
Line 
1/*
2 =============================================================================
3 sqread.c -- librarian - read sequence functions
4 Version 2 -- 1988-11-17 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "graphdef.h"
9#include "stddefs.h"
10#include "stdio.h"
11#include "patch.h"
12#include "vsdd.h"
13
14#include "midas.h"
15#include "libdsp.h"
16
17extern short errno; /* system error number */
18
19
20/*
21 =============================================================================
22 sqioerr() -- put up an I/O error message
23 =============================================================================
24*/
25
26sqioerr()
27{
28 char erms[40];
29
30 clrlsel();
31
32 sprintf(erms, " errno = %d", errno);
33
34 ldermsg("Couldn't read", " the sequence table", erms,
35 LD_EMCF, LD_EMCB);
36}
37
38/*
39
40*/
41
42/*
43 =============================================================================
44 sqread() -- read a sequence
45 =============================================================================
46*/
47
48short
49sqread(fp)
50register FILE *fp;
51{
52 char cb;
53 short seq;
54
55 ldwmsg(" Busy -- please stand by", (char *)NULL, " Reading sequences",
56 LCFBX10, LCBBX10);
57
58 for (;;) {
59
60 if (rd_ec(fp, &cb, 1L)) { /* get control byte */
61
62 sqioerr();
63 return(FAILURE);
64 }
65
66 if (0 EQ cb) /* zero control byte is end */
67 return(SUCCESS);
68
69 if (rd_ec(fp, &seq, 2L)) { /* get Line number */
70
71 sqioerr();
72 return(FAILURE);
73 }
74
75 if (cb & 0x08) { /* get Time */
76
77 if (rd_ec(fp, &seqtab[seq].seqtime, 2L)) {
78
79 sqioerr();
80 return(FAILURE);
81 }
82 }
83/*
84
85*/
86 if (cb & 0x04) { /* get Action 1 */
87
88 if (rd_ec(fp, &seqtab[seq].seqact1, 4L)) {
89
90 sqioerr();
91 return(FAILURE);
92 }
93 }
94
95 if (cb & 0x02) { /* get Action 2 */
96
97 if (rd_ec(fp, &seqtab[seq].seqact2, 4L)) {
98
99 sqioerr();
100 return(FAILURE);
101 }
102 }
103
104 if (cb & 0x01) { /* get Action 3 */
105
106 if (rd_ec(fp, &seqtab[seq].seqact3, 4L)) {
107
108 sqioerr();
109 return(FAILURE);
110 }
111 }
112 }
113}
Note: See TracBrowser for help on using the repository browser.