[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | idfield.c -- instrument display field processing and cursor motion
|
---|
| 4 | Version 89 -- 1989-11-15 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[6262b5c] | 8 | #include "all.h"
|
---|
[e225e77] | 9 |
|
---|
[0580615] | 10 | extern void select(void);
|
---|
| 11 | extern void stdmkey(void);
|
---|
[7258c6a] | 12 | extern void stddkey(int16_t k);
|
---|
[60288f5] | 13 | extern void nokey(void);
|
---|
[0580615] | 14 | extern void cxkstd(void);
|
---|
| 15 | extern void cykstd(void);
|
---|
[7258c6a] | 16 | extern int16_t vtoy(int16_t val, int16_t window);
|
---|
| 17 | extern int16_t ttox(uint16_t time, int16_t window);
|
---|
| 18 | extern int16_t timeto(int16_t fn, int16_t pj);
|
---|
| 19 | extern void dswin(int16_t n);
|
---|
| 20 | extern int16_t stdctp1(void);
|
---|
| 21 | extern int16_t whatbox(void);
|
---|
| 22 | extern int16_t inspnt(struct instdef *ip, int16_t fn, int16_t inpnt);
|
---|
[0580615] | 23 | extern void pntsel(void);
|
---|
[7258c6a] | 24 | extern void setseg(int16_t pn, uint16_t ptime);
|
---|
| 25 | extern void showpt(int16_t q);
|
---|
| 26 |
|
---|
| 27 | extern int16_t et_null(int16_t n);
|
---|
| 28 | extern int16_t ef_null(int16_t n);
|
---|
| 29 | extern int16_t rd_null(int16_t n);
|
---|
| 30 | extern int16_t nd_null(int16_t n, int16_t k);
|
---|
| 31 | extern int16_t et_ipnt(int16_t n);
|
---|
| 32 | extern int16_t ef_ipnt(int16_t n);
|
---|
| 33 | extern int16_t rd_ipnt(int16_t n);
|
---|
| 34 | extern int16_t nd_ipnt(int16_t n, int16_t k);
|
---|
| 35 | extern int16_t et_idin(int16_t n);
|
---|
| 36 | extern int16_t ef_idin(int16_t n);
|
---|
| 37 | extern int16_t rd_idin(int16_t n);
|
---|
| 38 | extern int16_t nd_idin(int16_t n, int16_t k);
|
---|
| 39 | extern int16_t et_ivce(int16_t n);
|
---|
| 40 | extern int16_t ef_ivce(int16_t n);
|
---|
| 41 | extern int16_t rd_ivce(int16_t n);
|
---|
| 42 | extern int16_t nd_ivce(int16_t n, int16_t k);
|
---|
| 43 | extern int16_t et_icnf(int16_t n);
|
---|
| 44 | extern int16_t ef_icnf(int16_t n);
|
---|
| 45 | extern int16_t rd_icnf(int16_t n);
|
---|
| 46 | extern int16_t nd_icnf(int16_t n, int16_t k);
|
---|
| 47 | extern int16_t et_ival(int16_t n);
|
---|
| 48 | extern int16_t ef_ival(int16_t n);
|
---|
| 49 | extern int16_t rd_ival(int16_t n);
|
---|
| 50 | extern int16_t nd_ival(int16_t n, int16_t k);
|
---|
| 51 | extern int16_t et_itim(int16_t n);
|
---|
| 52 | extern int16_t ef_itim(int16_t n);
|
---|
| 53 | extern int16_t rd_itim(int16_t n);
|
---|
| 54 | extern int16_t nd_itim(int16_t n, int16_t k);
|
---|
| 55 | extern int16_t et_iosc(int16_t nn);
|
---|
| 56 | extern int16_t ef_iosc(int16_t nn);
|
---|
| 57 | extern int16_t rd_iosc(int16_t nn);
|
---|
| 58 | extern int16_t nd_iosc(int16_t nn, int16_t k);
|
---|
| 59 | extern int16_t et_iact(int16_t nn);
|
---|
| 60 | extern int16_t ef_iact(int16_t nn);
|
---|
| 61 | extern int16_t rd_iact(int16_t nn);
|
---|
| 62 | extern int16_t nd_iact(int16_t nn, int16_t k);
|
---|
| 63 | extern int16_t et_iwsn(int16_t nn);
|
---|
| 64 | extern int16_t ef_iwsn(int16_t nn);
|
---|
| 65 | extern int16_t rd_iwsn(int16_t nn);
|
---|
| 66 | extern int16_t nd_iwsn(int16_t nn, int16_t k);
|
---|
| 67 | extern int16_t et_ires(int16_t n);
|
---|
| 68 | extern int16_t ef_ires(int16_t n);
|
---|
| 69 | extern int16_t rd_ires(int16_t n);
|
---|
| 70 | extern int16_t nd_ires(int16_t n, int16_t k);
|
---|
| 71 | extern int16_t et_imlt(int16_t n);
|
---|
| 72 | extern int16_t ef_imlt(int16_t n);
|
---|
| 73 | extern int16_t rd_imlt(int16_t n);
|
---|
| 74 | extern int16_t nd_imlt(int16_t n, int16_t k);
|
---|
| 75 |
|
---|
| 76 | extern uint16_t fromfpu(uint16_t fputime);
|
---|
| 77 |
|
---|
| 78 | extern void *memset(void *vp, int8_t c, int16_t n);
|
---|
[f40a309] | 79 |
|
---|
| 80 | /* |
---|
| 81 |
|
---|
| 82 | */
|
---|
[7258c6a] | 83 |
|
---|
| 84 | extern int16_t curvce, curfunc, curpnt, hitbox, astat, idnamsw;
|
---|
| 85 | extern int16_t cxval, cyval, cxrate, cyrate, curslim, cmtype, cmfirst;
|
---|
| 86 | extern int16_t pecase, pntsv, npts, subj, idimsw, wcflag, imflag;
|
---|
| 87 | extern int16_t idcfsw, idsrcsw, vtcrow, vtccol, stcrow, stccol;
|
---|
[f40a309] | 88 | extern int16_t vtxval, vtyval;
|
---|
[7258c6a] | 89 |
|
---|
[f40a309] | 90 | extern int16_t temax, temin;
|
---|
[7258c6a] | 91 |
|
---|
[f40a309] | 92 | extern int16_t *cratex, *cratey, crate0[], crate1[];
|
---|
[7258c6a] | 93 |
|
---|
[f40a309] | 94 | extern uint16_t *instob;
|
---|
[7258c6a] | 95 |
|
---|
| 96 | extern int8_t bfs[];
|
---|
[f40a309] | 97 | extern int8_t *idbxlbl[];
|
---|
[7258c6a] | 98 |
|
---|
| 99 | extern int16_t fnoff[];
|
---|
[f40a309] | 100 | extern int16_t idbox[][8];
|
---|
| 101 |
|
---|
| 102 | extern struct selbox *csbp;
|
---|
| 103 | extern struct selbox idboxes[];
|
---|
| 104 |
|
---|
| 105 | extern struct sment sments[];
|
---|
| 106 | extern struct sment *vpsms[];
|
---|
| 107 |
|
---|
| 108 | extern struct valent valents[];
|
---|
| 109 |
|
---|
| 110 | extern struct instpnt *pntptr;
|
---|
| 111 |
|
---|
| 112 | extern struct instdef vbufs[];
|
---|
[0580615] | 113 |
|
---|
[7258c6a] | 114 | void idx_key(void);
|
---|
[0580615] | 115 | int16_t idnfld(int16_t k);
|
---|
| 116 | void idcxupd(void);
|
---|
| 117 | void idcyupd(void);
|
---|
| 118 | void ikyup(void);
|
---|
[f40a309] | 119 | void ikydn(void);
|
---|
[e225e77] | 120 |
|
---|
| 121 | extern int16_t delpnts(void);
|
---|
| 122 | extern int16_t edfunc(int16_t n);
|
---|
| 123 | extern int16_t gcurpos(int16_t xloc, int16_t yloc);
|
---|
| 124 | extern int16_t segtime(int16_t pn, uint16_t ptime);
|
---|
| 125 | extern uint16_t addfpu(uint16_t t, int16_t k);
|
---|
| 126 | extern uint16_t subfpu(uint16_t t, int16_t k);
|
---|
| 127 | extern void allwins(void);
|
---|
| 128 | extern void arcurs(uint16_t icolor);
|
---|
| 129 | extern void curset(struct curpak *s);
|
---|
| 130 | extern void execins(int16_t vce, int16_t ins, int16_t tag);
|
---|
| 131 | extern void initi(struct instdef *ip);
|
---|
| 132 | extern void modinst(void);
|
---|
| 133 | extern void setinst(void);
|
---|
| 134 | extern void vtcxupd(void);
|
---|
| 135 | extern void vtcyupd(void);
|
---|
[f40a309] | 136 |
|
---|
| 137 | /* |
---|
| 138 |
|
---|
[7258c6a] | 139 | */
|
---|
[f40a309] | 140 |
|
---|
[7258c6a] | 141 | int16_t zonemax[9] = { 63, 119, 175, 231, 287, 343, 399, 455, 509};
|
---|
[f40a309] | 142 |
|
---|
| 143 | int16_t zoneinc[9] = { 2, 2, 4, 9, 18, 36, 73, 146, 303};
|
---|
| 144 |
|
---|
| 145 | struct fet id_fet1[] = {
|
---|
| 146 |
|
---|
| 147 | { 5, 62, 62, 12, et_ires, ef_ires, rd_ires, nd_ires},
|
---|
| 148 | {16, 1, 12, 13, et_imlt, ef_imlt, rd_imlt, nd_imlt},
|
---|
| 149 | {16, 15, 16, 14, et_ipnt, ef_ipnt, rd_ipnt, nd_ipnt},
|
---|
| 150 | {16, 19, 24, 15, et_itim, ef_itim, rd_itim, nd_itim},
|
---|
| 151 | {16, 27, 44, 16, et_ival, ef_ival, rd_ival, nd_ival},
|
---|
| 152 | {16, 47, 62, 17, et_iact, ef_iact, rd_iact, nd_iact},
|
---|
| 153 | {17, 12, 13, 18, et_icnf, ef_icnf, rd_icnf, nd_icnf},
|
---|
| 154 | {17, 23, 24, 19, et_ivce, ef_ivce, rd_ivce, nd_ivce},
|
---|
| 155 | {17, 31, 32, 19, et_idin, ef_idin, rd_idin, nd_idin},
|
---|
| 156 | {17, 57, 58, 0x0015, et_iwsn, ef_iwsn, rd_iwsn, nd_iwsn},
|
---|
| 157 | {17, 61, 62, 0x0115, et_iwsn, ef_iwsn, rd_iwsn, nd_iwsn},
|
---|
| 158 | {18, 36, 46, 0x8014, et_iosc, ef_iosc, rd_iosc, nd_iosc},
|
---|
| 159 | {18, 17, 32, 0, et_null, ef_null, rd_null, nd_null},
|
---|
| 160 | {19, 36, 46, 0x8114, et_iosc, ef_iosc, rd_iosc, nd_iosc},
|
---|
| 161 | {19, 17, 32, 0, et_null, ef_null, rd_null, nd_null},
|
---|
| 162 | {20, 36, 46, 0x8214, et_iosc, ef_iosc, rd_iosc, nd_iosc},
|
---|
| 163 | {20, 17, 32, 0, et_null, ef_null, rd_null, nd_null},
|
---|
| 164 | {21, 36, 46, 0x8314, et_iosc, ef_iosc, rd_iosc, nd_iosc},
|
---|
| 165 | {21, 17, 32, 0, et_null, ef_null, rd_null, nd_null},
|
---|
| 166 |
|
---|
| 167 | { 0, 0, 0, 0x0000, FN_NULL, FN_NULL, FN_NULL, FN_NULL}
|
---|
[7258c6a] | 168 | };
|
---|
[f40a309] | 169 |
|
---|
| 170 | int8_t *srctbl[] = { /* source label table */
|
---|
| 171 |
|
---|
| 172 | " ", /* 0 */
|
---|
| 173 | "Random ", /* 1 */
|
---|
| 174 | "GPC/CV1", /* 2 */
|
---|
| 175 | "???????", /* 3 */
|
---|
| 176 | "???????", /* 4 */
|
---|
| 177 | "Pitch ", /* 5 */
|
---|
| 178 | "Key Prs", /* 6 */
|
---|
| 179 | "Key Vel", /* 7 */
|
---|
| 180 | "Pedal 1", /* 8 */
|
---|
| 181 | "???????", /* 9 */
|
---|
| 182 | "Freq ", /* 10 */
|
---|
| 183 | "PchW/HT", /* 11 */
|
---|
| 184 | "ModW/VT", /* 12 */
|
---|
| 185 | "Brth/LP", /* 13 */
|
---|
| 186 | };
|
---|
| 187 |
|
---|
| 188 | /* |
---|
| 189 |
|
---|
| 190 | */
|
---|
| 191 |
|
---|
| 192 | struct curpak id_flds = {
|
---|
| 193 |
|
---|
| 194 | stdctp1, /* curtype */
|
---|
| 195 | nokey, /* premove */
|
---|
| 196 | nokey, /* pstmove */
|
---|
| 197 | cxkstd, /* cx_key */
|
---|
| 198 | cykstd, /* cy_key */
|
---|
| 199 | idcxupd, /* cx_upd */
|
---|
| 200 | idcyupd, /* cy_upd */
|
---|
| 201 | ikyup, /* xy_up */
|
---|
| 202 | ikydn, /* xy_dn */
|
---|
| 203 | idx_key, /* x_key */
|
---|
| 204 | select, /* e_key */
|
---|
| 205 | stdmkey, /* m_key */
|
---|
| 206 | stddkey, /* d_key */
|
---|
| 207 | idnfld, /* not_fld */
|
---|
| 208 | id_fet1, /* curfet */
|
---|
| 209 | idboxes, /* csbp */
|
---|
| 210 | crate1, /* cratex */
|
---|
| 211 | crate1, /* cratey */
|
---|
| 212 | CT_GRAF, /* cmtype */
|
---|
| 213 | ICURX, /* cxval */
|
---|
| 214 | ICURY /* cyval */
|
---|
| 215 | };
|
---|
| 216 |
|
---|
| 217 | /* |
---|
| 218 |
|
---|
| 219 | */
|
---|
| 220 |
|
---|
| 221 | /*
|
---|
| 222 | =============================================================================
|
---|
[0580615] | 223 | ikydn() -- process instrument cursor key down
|
---|
[f40a309] | 224 | =============================================================================
|
---|
| 225 | */
|
---|
| 226 |
|
---|
| 227 | void ikydn(void)
|
---|
| 228 | {
|
---|
| 229 | imflag = FALSE;
|
---|
| 230 | }
|
---|
| 231 |
|
---|
| 232 | /*
|
---|
| 233 | =============================================================================
|
---|
[0580615] | 234 | ikyup() -- process instrument cursor key up
|
---|
[f40a309] | 235 | =============================================================================
|
---|
| 236 | */
|
---|
| 237 |
|
---|
| 238 | void ikyup(void)
|
---|
| 239 | {
|
---|
| 240 | if (imflag)
|
---|
| 241 | modinst();
|
---|
| 242 | }
|
---|
| 243 | /* |
---|
| 244 |
|
---|
| 245 | */
|
---|
| 246 |
|
---|
| 247 | /*
|
---|
[0580615] | 248 | =============================================================================
|
---|
[f40a309] | 249 | idcyupd() -- update cursor y location from value
|
---|
[7258c6a] | 250 | =============================================================================
|
---|
[f40a309] | 251 | */
|
---|
| 252 |
|
---|
| 253 | void idcyupd(void)
|
---|
| 254 | {
|
---|
| 255 | register int16_t pval, vh, vl;
|
---|
| 256 |
|
---|
| 257 | if (wcflag NE -1) /* ws/cf menu page can't be up */
|
---|
| 258 | return;
|
---|
| 259 |
|
---|
| 260 | if (idimsw) /* no y update if instrument menu is up */
|
---|
| 261 | return;
|
---|
| 262 |
|
---|
| 263 | if (idsrcsw OR idcfsw) { /* see if we're in the menu area */
|
---|
| 264 |
|
---|
| 265 | vtcrow = YTOR(vtyval += cyrate);
|
---|
| 266 |
|
---|
| 267 | if (vtcrow > 24)
|
---|
| 268 | vtyval = RTOY(vtcrow = 24);
|
---|
| 269 | else if (vtcrow < 22)
|
---|
| 270 | vtyval = RTOY(vtcrow = 22);
|
---|
| 271 |
|
---|
| 272 | } else if (idnamsw) { /* see if we're in the typewriter */
|
---|
| 273 |
|
---|
| 274 | vtcyupd();
|
---|
| 275 |
|
---|
| 276 | } else if (pntsv) { /* see if we're moving a point */
|
---|
| 277 |
|
---|
| 278 | pval = (pntptr->ipval >> 5) - (cyrate * 7);
|
---|
| 279 |
|
---|
| 280 | if (pval GT 1000) /* limit at +10.00 */
|
---|
| 281 | pval = 1000;
|
---|
| 282 | else if (pval LT 0) /* limit at +00.00 */
|
---|
| 283 | pval = 0;
|
---|
| 284 |
|
---|
| 285 | cyval = vtoy(pval, 12); /* new cursor location */
|
---|
| 286 | pntptr->ipval = pval << 5; /* update function value */
|
---|
| 287 |
|
---|
| 288 | vh = pval / 100; /* display the new value */
|
---|
| 289 | vl = pval - (vh * 100);
|
---|
| 290 |
|
---|
| 291 | sprintf(bfs, "%02d.%02d", vh, vl);
|
---|
| 292 |
|
---|
| 293 | vbank(0);
|
---|
| 294 | vcputsv(instob, 64, idbox[16][4], idbox[16][5],
|
---|
| 295 | idbox[16][6] + 1, idbox[16][7], bfs, 14);
|
---|
| 296 |
|
---|
| 297 | imflag = TRUE;
|
---|
| 298 | /* |
---|
| 299 |
|
---|
| 300 | */
|
---|
| 301 | } else { /* just moving the cursor */
|
---|
| 302 |
|
---|
| 303 | cyval += cyrate;
|
---|
| 304 |
|
---|
| 305 | if (cyval GT (CYMAX - 1))
|
---|
| 306 | cyval = CYMAX - 1;
|
---|
| 307 | else if (cyval LT 1)
|
---|
| 308 | cyval = 1;
|
---|
| 309 | }
|
---|
| 310 | }
|
---|
| 311 |
|
---|
| 312 | /* |
---|
| 313 |
|
---|
| 314 | */
|
---|
[0580615] | 315 |
|
---|
[f40a309] | 316 | /*
|
---|
[7258c6a] | 317 | =============================================================================
|
---|
| 318 | idcxupd() -- update cursor x location from time
|
---|
| 319 | =============================================================================
|
---|
[f40a309] | 320 | */
|
---|
| 321 |
|
---|
| 322 | void idcxupd(void)
|
---|
| 323 | {
|
---|
| 324 | register uint16_t th, tl;
|
---|
| 325 | register uint16_t fptime, stime;
|
---|
| 326 | int16_t zone;
|
---|
| 327 |
|
---|
| 328 | if (idimsw) { /* see if instrument menu is up */
|
---|
| 329 |
|
---|
| 330 | cxval += cxrate;
|
---|
| 331 |
|
---|
| 332 | if (cxval > CTOX(32))
|
---|
| 333 | cxval = CTOX(32);
|
---|
| 334 | else if (cxval < CTOX(26))
|
---|
| 335 | cxval = CTOX(26);
|
---|
| 336 |
|
---|
| 337 | } if (idsrcsw OR idcfsw) { /* see if we're in a submenu */
|
---|
| 338 |
|
---|
| 339 | vtccol = XTOC(vtxval += cxrate);
|
---|
| 340 |
|
---|
| 341 | if (vtccol > 46)
|
---|
| 342 | vtxval = CTOX(vtccol = 46);
|
---|
| 343 | else if (vtccol < 17)
|
---|
| 344 | vtxval = CTOX(vtccol = 17);
|
---|
| 345 |
|
---|
| 346 | } else if (idnamsw) { /* see if we're in the typewriter */
|
---|
| 347 |
|
---|
| 348 | vtcxupd();
|
---|
| 349 | /* |
---|
| 350 |
|
---|
| 351 | */
|
---|
| 352 | } else if (pntsv) { /* see if we're moving a point */
|
---|
| 353 |
|
---|
| 354 | for (zone = 0; zone LE 8; zone++) /* find display zone */
|
---|
| 355 | if (cxval LE zonemax[zone])
|
---|
| 356 | break;
|
---|
| 357 |
|
---|
| 358 | switch (pecase) {
|
---|
| 359 |
|
---|
| 360 | case 0: /* single point */
|
---|
| 361 | case 1: /* last point */
|
---|
| 362 |
|
---|
| 363 | if (cxrate GE 0)
|
---|
| 364 | fptime = addfpu(pntptr->iptim,
|
---|
| 365 | cxrate * zoneinc[zone]);
|
---|
| 366 | else
|
---|
| 367 | fptime = subfpu(pntptr->iptim,
|
---|
| 368 | -cxrate * zoneinc[zone]);
|
---|
| 369 |
|
---|
| 370 | stime = segtime(subj, fptime);
|
---|
| 371 |
|
---|
| 372 | if (stime GE temax) {
|
---|
| 373 |
|
---|
| 374 | setseg(subj, temax - 1);
|
---|
| 375 | break;
|
---|
| 376 |
|
---|
| 377 | } else if (stime EQ 0) {
|
---|
| 378 |
|
---|
| 379 | setseg(subj, 1);
|
---|
| 380 | break;
|
---|
| 381 | }
|
---|
| 382 |
|
---|
| 383 | setseg(subj, stime);
|
---|
| 384 | break;
|
---|
| 385 |
|
---|
| 386 | /* |
---|
| 387 |
|
---|
| 388 | */
|
---|
| 389 | case 2: /* interior point */
|
---|
| 390 |
|
---|
| 391 | if (cxrate GE 0)
|
---|
| 392 | fptime = addfpu(pntptr->iptim, cxrate * zoneinc[zone]);
|
---|
| 393 | else
|
---|
| 394 | fptime = subfpu(pntptr->iptim, -cxrate * zoneinc[zone]);
|
---|
| 395 |
|
---|
| 396 | stime = temin + fromfpu(fptime);
|
---|
| 397 |
|
---|
| 398 | if (stime GE temax)
|
---|
| 399 | break;
|
---|
| 400 |
|
---|
| 401 | setseg(subj, segtime(subj, fptime));
|
---|
| 402 | setseg(subj + 1, temax);
|
---|
| 403 | break;
|
---|
| 404 | }
|
---|
| 405 |
|
---|
| 406 | th = timeto(curfunc, subj); /* display the time */
|
---|
| 407 | tl = th - ((th / 1000) * 1000);
|
---|
| 408 | th /= 1000;
|
---|
| 409 |
|
---|
| 410 | sprintf(bfs, "%02d.%03d", th, tl);
|
---|
| 411 |
|
---|
| 412 | if (v_regs[5] & 0x0180)
|
---|
| 413 | vbank(0);
|
---|
| 414 |
|
---|
| 415 | vcputsv(instob, 64, idbox[15][4], idbox[15][5],
|
---|
| 416 | idbox[15][6] + 1, idbox[15][7], bfs, 14);
|
---|
| 417 |
|
---|
| 418 | imflag = TRUE;
|
---|
| 419 | cxval = ttox(timeto(curfunc, subj), 12);
|
---|
| 420 |
|
---|
| 421 | } else { /* just moving the cursor */
|
---|
| 422 |
|
---|
| 423 | cxval += cxrate;
|
---|
| 424 |
|
---|
| 425 | if (cxval GT (CXMAX- 1))
|
---|
| 426 | cxval = CXMAX - 1;
|
---|
| 427 | else if (cxval LT 1)
|
---|
| 428 | cxval = 1;
|
---|
| 429 | }
|
---|
| 430 | }
|
---|
| 431 |
|
---|
[7258c6a] | 432 | /* |
---|
[f40a309] | 433 |
|
---|
[7258c6a] | 434 | */
|
---|
[f40a309] | 435 |
|
---|
| 436 | /*
|
---|
| 437 | =============================================================================
|
---|
| 438 | idnfld() -- process not-in-field key entry
|
---|
| 439 | =============================================================================
|
---|
| 440 | */
|
---|
| 441 |
|
---|
| 442 | int16_t idnfld(int16_t k)
|
---|
| 443 | {
|
---|
| 444 | register int16_t endpnt, basepnt, t, fn;
|
---|
| 445 | register struct idfnhdr *fp;
|
---|
| 446 | register struct instdef *ip;
|
---|
| 447 |
|
---|
| 448 | ip = &vbufs[curvce];
|
---|
| 449 | fp = &ip->idhfnc[curfunc];
|
---|
| 450 |
|
---|
| 451 | if (astat) {
|
---|
| 452 |
|
---|
| 453 | if (whatbox()) {
|
---|
| 454 |
|
---|
| 455 | if (hitbox EQ 12) { /* edit window */
|
---|
| 456 |
|
---|
| 457 | if (k EQ 8) { /* - = toggle I_TM_KEY */
|
---|
| 458 |
|
---|
| 459 | t = (fp->idftmd ^= I_TM_KEY);
|
---|
| 460 |
|
---|
| 461 | if (v_regs[5] & 0x0180)
|
---|
| 462 | vbank(0);
|
---|
| 463 |
|
---|
| 464 | tsplot4(instob, 64,
|
---|
| 465 | ((t & I_TM_KEY) ?
|
---|
| 466 | idbox[curfunc][4] : ID_INST),
|
---|
| 467 | 4, 54, idbxlbl[curfunc], 14);
|
---|
| 468 |
|
---|
| 469 | modinst();
|
---|
| 470 | return(SUCCESS);
|
---|
| 471 | /* |
---|
| 472 |
|
---|
| 473 | */
|
---|
| 474 | } else if (k EQ 9) { /* + = new point */
|
---|
| 475 |
|
---|
| 476 | basepnt = fp->idfpt1;
|
---|
| 477 | endpnt = basepnt + fp->idfpif - 1;
|
---|
| 478 |
|
---|
| 479 | if (fp->idfpif EQ 99)
|
---|
| 480 | return(FAILURE);
|
---|
| 481 |
|
---|
| 482 | if (FALSE EQ inspnt(ip, curfunc, endpnt)) {
|
---|
| 483 |
|
---|
| 484 | return(FAILURE);
|
---|
| 485 |
|
---|
| 486 | } else {
|
---|
| 487 |
|
---|
| 488 | subj = fp->idfpif - 1;
|
---|
| 489 | pntsel();
|
---|
| 490 | pntsv = 1;
|
---|
| 491 | memset(pntptr, 0, sizeof (struct instpnt));
|
---|
| 492 | pntptr->ipval = (pntptr -1)->ipval;
|
---|
| 493 | setseg(subj, timeto(curfunc, subj - 1) + 1);
|
---|
| 494 | edfunc(curfunc);
|
---|
| 495 | showpt(1);
|
---|
| 496 | cxval = ttox(timeto(curfunc, subj), 12);
|
---|
| 497 | cyval = vtoy((pntptr->ipval >> 5), 12);
|
---|
| 498 | arcurs(ID_SELD);
|
---|
| 499 | gcurpos(cxval, cyval);
|
---|
| 500 | modinst();
|
---|
| 501 | return(SUCCESS);
|
---|
| 502 | }
|
---|
| 503 |
|
---|
| 504 | }
|
---|
| 505 | /* |
---|
| 506 |
|
---|
| 507 | */
|
---|
| 508 | } else if (hitbox < 12 ) { /* label window */
|
---|
| 509 |
|
---|
| 510 | fn = (hitbox EQ curfunc) ? 12 : hitbox;
|
---|
| 511 |
|
---|
| 512 | if (k EQ 8) { /* + = toggle I_TM_KEY */
|
---|
| 513 |
|
---|
| 514 | if (v_regs[5] & 0x0180)
|
---|
| 515 | vbank(0);
|
---|
| 516 |
|
---|
| 517 | tsplot4(instob, 64,
|
---|
[599d89b] | 518 | (((ip->idhfnc[fn].idftmd ^= I_TM_KEY) & I_TM_KEY)
|
---|
| 519 | ? idbox[fn][4] : ID_INST),
|
---|
[f40a309] | 520 | idbox[hitbox][6], idbox[hitbox][7],
|
---|
| 521 | idbxlbl[fn], 14);
|
---|
| 522 |
|
---|
| 523 | modinst();
|
---|
| 524 | }
|
---|
| 525 | }
|
---|
| 526 | }
|
---|
| 527 |
|
---|
| 528 | return(FAILURE);
|
---|
| 529 | }
|
---|
| 530 |
|
---|
[0580615] | 531 | return(FAILURE);
|
---|
[f40a309] | 532 | }
|
---|
| 533 |
|
---|
| 534 | /* |
---|
[7258c6a] | 535 |
|
---|
[f40a309] | 536 | */
|
---|
| 537 |
|
---|
| 538 | /*
|
---|
| 539 | =============================================================================
|
---|
| 540 | idx_key() -- process the 'X' (delete) key
|
---|
| 541 | =============================================================================
|
---|
| 542 | */
|
---|
| 543 |
|
---|
| 544 | void idx_key(void)
|
---|
| 545 | {
|
---|
| 546 | register struct sment *smp;
|
---|
| 547 | register struct valent *vep;
|
---|
| 548 | register int16_t i;
|
---|
| 549 | register struct instdef *ip;
|
---|
| 550 |
|
---|
| 551 | if (astat) {
|
---|
| 552 |
|
---|
| 553 | if (idsrcsw OR idcfsw OR idnamsw OR (wcflag NE -1))
|
---|
| 554 | return;
|
---|
| 555 |
|
---|
| 556 | if (stcrow EQ 16) {
|
---|
| 557 |
|
---|
| 558 | if ((stccol GE 1) AND (stccol LE 7)) {
|
---|
| 559 |
|
---|
| 560 | /* general source */
|
---|
| 561 |
|
---|
| 562 | vep = &valents[0];
|
---|
| 563 | smp = vpsms[(curvce << 4) + fnoff[curfunc]];
|
---|
| 564 |
|
---|
| 565 | if (smp->sm NE SM_NONE) { /* check for new general S/M */
|
---|
| 566 |
|
---|
| 567 | (smp->prv)->nxt = smp->nxt; /* unlink from old S/M chain */
|
---|
| 568 | (smp->nxt)->prv = smp->prv;
|
---|
| 569 |
|
---|
| 570 | smp->prv = (struct sment *)vep; /* link into new S/M chain */
|
---|
| 571 | smp->nxt = vep->nxt;
|
---|
| 572 | (vep->nxt)->prv = smp;
|
---|
| 573 | vep->nxt = smp;
|
---|
| 574 |
|
---|
| 575 | smp->sm = SM_NONE; /* update sment S/M entry */
|
---|
| 576 | }
|
---|
| 577 |
|
---|
| 578 | vbufs[curvce].idhfnc[curfunc].idfsrc = SM_NONE;
|
---|
| 579 | dswin(13);
|
---|
| 580 | modinst();
|
---|
| 581 | /* |
---|
| 582 |
|
---|
| 583 | */
|
---|
| 584 | } else if ((stccol EQ 15) OR (stccol EQ 16)) {
|
---|
| 585 |
|
---|
| 586 | /* current point and points to the right */
|
---|
| 587 |
|
---|
| 588 | delpnts();
|
---|
| 589 |
|
---|
| 590 | } else if ((stccol GE 33) AND (stccol LE 39)) {
|
---|
| 591 |
|
---|
| 592 | /* point source */
|
---|
| 593 |
|
---|
| 594 | pntptr->ipvsrc = SM_NONE;
|
---|
| 595 | dswin(16);
|
---|
| 596 | modinst();
|
---|
| 597 | }
|
---|
| 598 |
|
---|
| 599 | } else if ((stcrow EQ 17) AND
|
---|
| 600 | ((stccol EQ 31) OR (stccol EQ 32))) {
|
---|
| 601 |
|
---|
| 602 | /* entire instrument */
|
---|
| 603 |
|
---|
| 604 | initi(&vbufs[curvce]);
|
---|
| 605 | execins(curvce, 0, 0);
|
---|
| 606 | setinst();
|
---|
| 607 | allwins();
|
---|
[0580615] | 608 | modinst();
|
---|
[f40a309] | 609 | }
|
---|
| 610 | }
|
---|
| 611 | }
|
---|
| 612 |
|
---|
| 613 | /* |
---|
| 614 |
|
---|
[6262b5c] | 615 | */
|
---|
| 616 |
|
---|
| 617 | /*
|
---|
| 618 | =============================================================================
|
---|
| 619 | idfield() -- setup field routines for the score display
|
---|
| 620 | =============================================================================
|
---|
| 621 | */
|
---|
| 622 |
|
---|
| 623 | void idfield(void)
|
---|
| 624 | {
|
---|
| 625 | idimsw = FALSE;
|
---|
| 626 | curslim = 210;
|
---|
| 627 |
|
---|
| 628 | curset(&id_flds);
|
---|
| 629 | }
|
---|
| 630 |
|
---|