source: buchla-68k/ram/swinit.c@ 298f0b4

Last change on this file since 298f0b4 was 0170798, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added last missing function pointer prototypes.

  • Property mode set to 100644
File size: 8.5 KB
Line 
1/*
2 =============================================================================
3 swinit.c -- MIDAS-VII -- more variable definitions and initializations
4 Version 12 -- 1988-10-12 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define FET_DEFS 1 /* so fields.h gets things right */
9
10#include "ram.h"
11
12BOOL se_chg; /* Score free list changed flag */
13
14LPF (*oldsw)[]; /* saved swpt value */
15LPF (*swpt)[]; /* switch dispatch table pointer */
16
17LPF aswtbl[14]; /* assignment switch table */
18
19void (*curmove)(void); /* cursor move function */
20int16_t (*curtype)(void); /* cursor type function */
21void (*cx_key)(void); /* x rate calculation */
22void (*cx_upd)(void); /* x update */
23void (*cy_key)(void); /* y rate calculation */
24void (*cy_upd)(void); /* y update */
25void (*d_key)(int16_t k); /* in-field data key processor */
26void (*e_key)(void); /* E key processor */
27void (*m_key)(void); /* M key processor */
28void (*itxput)(int16_t row, int16_t col, int8_t *txt, int16_t tag);
29 /* instrument menu text put function */
30int16_t (*not_fld)(int16_t k); /* not-in-field data key processor */
31void (*olddkey)(int16_t k); /* saved d_key value */
32void (*oldekey)(void); /* saved e_key value */
33void (*oldmkey)(void); /* saved m_key value */
34void (*oldxkey)(void); /* saved x_key value */
35void (*premove)(void); /* cursor pre-move function */
36void (*pstmove)(void); /* cursor post-move function */
37vtcurs vt_adv; /* vtyper data cursor advance function */
38vtcurs vt_bsp; /* vtyper data cursor backspace function */
39vtcurs vt_cdn; /* vtyper data cursor down function */
40vtcurs vt_cup; /* vtyper data cursor up function */
41vtchar vt_dsp; /* vtyper display function */
42vtcurs vt_stop; /* vtyper exit function */
43void (*x_key)(void); /* X key processor */
44void (*xy_dn)(void); /* cursor - finger on (down) */
45void (*xy_up)(void); /* cursor - finger off (up) */
46
47int16_t *cratex; /* cursor x rate table pointer */
48int16_t *cratey; /* cursor x rate table pointer */
49
50int16_t BotEdge; /* configuration box bottom edge */
51int16_t LftEdge; /* configuration box left edge */
52int16_t RgtEdge; /* configuration box right edge */
53int16_t TopEdge; /* configuration box top edge */
54
55int16_t BarBcur[14]; /* current bottom-zero bar values */
56int16_t BarCcur[14]; /* current centered-zero bar values */
57int16_t BGeq[14]; /* current EQ bar settings */
58int16_t BGother[14]; /* current other pot bar settings */
59int16_t BGprmtr[14]; /* current parameter pot bar settings */
60
61int16_t articen[12]; /* voice articulation enable status */
62int16_t grpdyn[12]; /* group dynamics table (0..9) */
63int16_t grploc[12]; /* group location table (0..8) */
64int16_t grpmode[12]; /* group mode - 0 = play, 1 = stdby, 2 = rec */
65int16_t grpsel[12]; /* group select status for instrument selection */
66int16_t grpstat[12]; /* group status - 0 = off, non-0 = on */
67int16_t grptmap[12]; /* group map */
68int16_t gtctab[12]; /* group to color table */
69int16_t ins2grp[12]; /* instrument to group table (00..NINST-1) */
70int16_t instmod[12]; /* intrument data modified */
71int16_t key2grp[88]; /* port 1 key to group assignment table */
72int16_t lastart[16]; /* last articulation values (by parameter) */
73int16_t lastvce[12]; /* last voice assigned in each group */
74int16_t lastvel[12]; /* last velocity sent to group */
75int16_t ldmap[N_SCORES]; /* gather read map */
76int16_t mctlnum[4]; /* MIDI controller number table (-1, 00..99) */
77int16_t mpbend[48]; /* MIDI pitch bend data, by port and channel */
78int16_t msmstv[3]; /* MIDI state machine state variables */
79int16_t offsets[NUMWPCAL]; /* offsets for current waveshape */
80int16_t oldtun[128]; /* previous tuning table for undo */
81int16_t prstab[NTRIGS]; /* pressure */
82int16_t s_inst[12]; /* instrument selections */
83int16_t s_trns[12]; /* current transposition values */
84int16_t swfifo[NSWFIFO]; /* scroll wheel fifo */
85int16_t txfifo[NTKFIFO]; /* trackball X fifo */
86int16_t tyfifo[NTKFIFO]; /* trackball Y fifo */
87int16_t tuntab[128]; /* current tuning table */
88int16_t vce2grp[12]; /* voice to group table (-1, 1..12)*/
89int16_t vce2trg[12]; /* voice to trigger map (-1 EQ NULL) */
90int16_t veltab[NTRIGS]; /* velocity */
91int16_t vmtab[NUMHARM]; /* harmonics for current waveshape */
92int16_t wsbuf[NUMWPCAL]; /* final values for current waveshape */
93
94/*
95
96*/
97
98int8_t *lmln22; /* message window line 22 */
99int8_t *lmln23; /* message window line 23 */
100int8_t *lmln24; /* message window line 24 */
101int8_t *vtdeptr; /* virtual typewriter data entry pointer */
102
103int8_t *funcndx[256][2]; /* function header pointers */
104int8_t *vlbptr[3]; /* variable label pointers */
105
106int8_t bfs[128]; /* display generation buffer */
107int8_t caname[16]; /* current assignment table name */
108int8_t dspbuf[65]; /* display generation buffer */
109int8_t ebuf[MAXEBUF+1]; /* edit data entry buffer */
110int8_t errbuf[65]; /* error message build area */
111int8_t idbuf[65]; /* display format conversion work area */
112int8_t keystat[24]; /* front panel key status */
113int8_t ldcmnt[38]; /* comment field */
114int8_t ldfile[9]; /* file name field */
115int8_t ldmsg1[65]; /* messsage build area 1 */
116int8_t ldmsg2[65]; /* messsage build area 2 */
117int8_t ldmsg3[65]; /* messsage build area 3 */
118int8_t loadedc[NLTYPES][37]; /* loaded file comments */
119int8_t loadedf[NLTYPES][8]; /* loaded file names */
120int8_t masens[3]; /* MIDI port active sensing flags */
121int8_t mctlval[NCTRLS]; /* MIDI controller values */
122int8_t mdbyte[3]; /* MIDI data byte buffers */
123int8_t mpsust[48]; /* MIDI sustain status, by port and channel */
124int8_t mrstat[3]; /* MIDI running status */
125int8_t scname[N_SCORES][16]; /* Score names */
126int8_t trgtab[NTRIGS]; /* trigger status */
127int8_t tuncurn[33]; /* current tuning table name */
128int8_t tunname[NTUNS][32]; /* tuning table names */
129
130/*
131
132*/
133
134int32_t *pspool; /* Score storage pool pointer */
135
136int32_t afi; /* analog processor FIFO value */
137int32_t curtime; /* current sqscan time */
138int32_t ctime; /* time at cursor */
139int32_t dvwork; /* divide work area */
140int32_t frags; /* Score storage pool fragment count */
141int32_t iotime; /* saved lcdtime value */
142int32_t lcdontm; /* LCD backlight on time */
143int32_t lcdtime; /* LCD backlight timer */
144int32_t lcsum; /* library checksum */
145int32_t ndbytes; /* bytes needed for storage */
146int32_t noteoff; /* note off time */
147int32_t noteon; /* note on time */
148int32_t noteper; /* note period */
149int32_t noteval; /* note value */
150int32_t nrest; /* number of rests */
151int32_t schksum; /* Score checksum */
152int32_t se1_cnt; /* Score - free list E_SIZE1 entry count */
153int32_t se2_cnt; /* Score - free list E_SIZE2 entry count */
154int32_t se3_cnt; /* Score - free list E_SIZE3 entry count */
155int32_t snbreq; /* Score - disk bytes required */
156int32_t snlreq; /* Score - score bytes required */
157int32_t sntbreq; /* Score - total disk bytes required */
158int32_t sntlreq; /* Score - total score bytes required */
159int32_t spcount; /* Score - storage pool free entry count */
160int32_t swcount; /* scroll wheel counter */
161int32_t swrate; /* scroll wheel rate */
162int32_t swtemp; /* scroll wheel work area */
163int32_t t_bak; /* time at p_bak */
164int32_t t_cbgn; /* time at p_cbgn */
165int32_t t_cend; /* time at p_cend */
166int32_t t_cur; /* time at p_cur */
167int32_t t_ctr; /* time at p_ctr */
168int32_t t_fwd; /* time at p_fwd */
169int32_t t_ins; /* time at peg */
170int32_t t_note; /* note duration between p_nbeg and p_nend */
171int32_t t_sbgn; /* time at p_sbgn */
172int32_t t_sec1; /* time at p_sec1 */
173int32_t t_sec2; /* time at p_sec2 */
174int32_t t_sect; /* section time */
175int32_t t_send; /* time at p_send */
176int32_t wshfac; /* waveshape scale factor */
177
178int32_t hwave[NUMWPCAL]; /* harmonic waveshape generation buffer */
179int32_t nlpersc[N_SCORES]; /* number of longs per score */
180int32_t scsums[N_SCORES]; /* score checksums */
181int32_t spool[MAX_SE]; /* Score storage pool */
182
183int32_t vknm[NUMHARM][NUMWPCAL]; /* scaled harmonics for current ws */
184
185int32_t swrmin = SWRMIN; /* scroll wheel rate threshold */
186
187/*
188
189*/
190
191/*
192 =============================================================================
193 swinit() -- initialize scroll wheel variables
194 =============================================================================
195*/
196
197void swinit(void)
198{
199 swflag = FALSE; /* stop the scroll wheel */
200 swctrl = FALSE; /* ... */
201 swdir = D_FWD; /* ... */
202 swrate = 0; /* ... */
203 swcount = 0; /* ... */
204
205 memsetw(swfifo, 0, NSWFIFO); /* clear scroll wheel fifo */
206 swfiin = 0; /* ... */
207
208 tkinit(); /* initialize the trackball */
209}
210
Note: See TracBrowser for help on using the repository browser.