| 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | ptdkey.c -- MIDAS-VII patch display data entry functions
|
|---|
| 4 | Version 29 -- 1988-12-08 -- D.N. Lynx Crowe
|
|---|
| 5 | =============================================================================
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #define DEBUGPD 0
|
|---|
| 9 | #define DEBUGVP 0
|
|---|
| 10 | #define DUMPDEF 0
|
|---|
| 11 | #define DUMPSTM 0
|
|---|
| 12 |
|
|---|
| 13 | #include "stddefs.h"
|
|---|
| 14 | #include "hwdefs.h"
|
|---|
| 15 | #include "vsdd.h"
|
|---|
| 16 | #include "fields.h"
|
|---|
| 17 | #include "curpak.h"
|
|---|
| 18 | #include "patch.h"
|
|---|
| 19 | #include "macros.h"
|
|---|
| 20 |
|
|---|
| 21 | #include "midas.h"
|
|---|
| 22 | #include "ptdisp.h"
|
|---|
| 23 |
|
|---|
| 24 | #if DEBUGPD
|
|---|
| 25 | short debugpd = 1;
|
|---|
| 26 | short snappb = 0;
|
|---|
| 27 | #endif
|
|---|
| 28 |
|
|---|
| 29 | #if DEBUGVP
|
|---|
| 30 | short debugvp = 1;
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | #if DUMPDEF
|
|---|
| 34 | short dumpdef = 0;
|
|---|
| 35 | #endif
|
|---|
| 36 |
|
|---|
| 37 | #if DUMPSTM
|
|---|
| 38 | short dumpstm = 0;
|
|---|
| 39 | #endif
|
|---|
| 40 |
|
|---|
| 41 | #if (DEBUGPD|DEBUGVP|DUMPDEF|DUMPSTM)
|
|---|
| 42 | extern short debugsw;
|
|---|
| 43 | #endif
|
|---|
| 44 |
|
|---|
| 45 | extern short asig, astat;
|
|---|
| 46 |
|
|---|
| 47 | extern short dpepred, dpecpos, dpesucc;
|
|---|
| 48 |
|
|---|
| 49 | extern short ptegood, ptedfok, ptestok, ptedsok, ptedtok;
|
|---|
| 50 |
|
|---|
| 51 | extern short ptedef, ptestm, ptespec, ptesuba, ptedat1, ptedat2;
|
|---|
| 52 |
|
|---|
| 53 | extern short ptedftp, ptedfst, ptedest, ptedata;
|
|---|
| 54 |
|
|---|
| 55 | extern short pteset, ptbflag, ptemenu;
|
|---|
| 56 |
|
|---|
| 57 | extern short ptepred, ptecpos, ptesucc;
|
|---|
| 58 |
|
|---|
| 59 | extern short stccol, stcrow;
|
|---|
| 60 |
|
|---|
| 61 | extern char ptdebuf[50];
|
|---|
| 62 |
|
|---|
| 63 | extern struct patch ptebuf;
|
|---|
| 64 |
|
|---|
| 65 | /* |
|---|
| 66 |
|
|---|
| 67 | */
|
|---|
| 68 |
|
|---|
| 69 | short dsdecol[5][2][2] = { /* destination data entry column table */
|
|---|
| 70 |
|
|---|
| 71 | 6, 8, 19, 21, /* 0 -- key, rel -- key number */
|
|---|
| 72 | 7, 8, 20, 21, /* 1 -- trg -- trigger number */
|
|---|
| 73 | 8, 8, 21, 21, /* 2 -- pls -- pulse number */
|
|---|
| 74 | 10, 10, 23, 23, /* 3 -- key, rel -- port number */
|
|---|
| 75 | 12, 13, 25, 26 /* 4 -- key, rel -- channel number */
|
|---|
| 76 | };
|
|---|
| 77 |
|
|---|
| 78 | short des2fmt[] = { /* destination type to data entry format */
|
|---|
| 79 |
|
|---|
| 80 | -1, 0, 1, 2, 3, 4, 4, 5,
|
|---|
| 81 | 4, 4, 6, 9, 6, 6, 6, 10,
|
|---|
| 82 | 9, 9, 10, 10, 10, 10, 7, 7,
|
|---|
| 83 | 7, 7, 8
|
|---|
| 84 | };
|
|---|
| 85 |
|
|---|
| 86 | short dtabl7[] = { 11, 1, 2, 3, 10 }; /* aux datum format table */
|
|---|
| 87 |
|
|---|
| 88 | short dtabl9[] = { 11, 1, 2, 3, 9 }; /* FPU datum format table */
|
|---|
| 89 |
|
|---|
| 90 | /* |
|---|
| 91 |
|
|---|
| 92 | */
|
|---|
| 93 |
|
|---|
| 94 | /*
|
|---|
| 95 | =============================================================================
|
|---|
| 96 | SnapPTV() -- snap dump patch variables
|
|---|
| 97 | =============================================================================
|
|---|
| 98 | */
|
|---|
| 99 |
|
|---|
| 100 | void SnapPTV(char *s)
|
|---|
| 101 | {
|
|---|
| 102 | register unsigned short stim;
|
|---|
| 103 | register short i;
|
|---|
| 104 | char dbuf[50];
|
|---|
| 105 |
|
|---|
| 106 | printf("\n%s(): called SnapPTV()\n", s);
|
|---|
| 107 |
|
|---|
| 108 | memcpy(dbuf, ptdebuf, 48);
|
|---|
| 109 |
|
|---|
| 110 | for (i = 0; i < 48; i++)
|
|---|
| 111 | if (dbuf[i] EQ '\0')
|
|---|
| 112 | dbuf[i] = ' ';
|
|---|
| 113 | else if (dbuf[i] & 0x0080)
|
|---|
| 114 | dbuf[i] = '~';
|
|---|
| 115 |
|
|---|
| 116 | dbuf[48] = '\0';
|
|---|
| 117 |
|
|---|
| 118 | printf(" ptdebuf = \"%s\"\n", dbuf);
|
|---|
| 119 |
|
|---|
| 120 | printf(" pte $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X\n",
|
|---|
| 121 | ptedef, ptestm, ptespec, ptesuba, ptedat1, ptedat2);
|
|---|
| 122 |
|
|---|
| 123 | printf(" ptb $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X\n",
|
|---|
| 124 | ptebuf.defnum, ptebuf.stmnum, ptebuf.paspec,
|
|---|
| 125 | ptebuf.pasuba, ptebuf.padat1, ptebuf.padat2);
|
|---|
| 126 |
|
|---|
| 127 | printf(" pte dftp: %2d dfst: %2d dest: %2d data: %2d menu: %2d\n",
|
|---|
| 128 | ptedftp, ptedfst, ptedest, ptedata, ptemenu);
|
|---|
| 129 |
|
|---|
| 130 | printf(" pte good: %d dfok: %d stok: %d dsok: %d dtok: %d set: %d flag: %d\n",
|
|---|
| 131 | ptegood, ptedfok, ptestok, ptedsok, ptedtok, pteset, ptbflag);
|
|---|
| 132 |
|
|---|
| 133 | printf(" pte pred: %3d cpos: %3d succ: %3d\n",
|
|---|
| 134 | ptepred, ptecpos, ptesucc);
|
|---|
| 135 |
|
|---|
| 136 | /* |
|---|
| 137 |
|
|---|
| 138 | */
|
|---|
| 139 |
|
|---|
| 140 | #if DUMPDEF
|
|---|
| 141 |
|
|---|
| 142 | if (dumpdef) {
|
|---|
| 143 |
|
|---|
| 144 | printf(" dpe pred: %3d cpos: %3d succ: %3d\n",
|
|---|
| 145 | dpepred, dpecpos, dpesucc);
|
|---|
| 146 |
|
|---|
| 147 | for (stim = 0; stim < NDEFSTMS; stim++) {
|
|---|
| 148 |
|
|---|
| 149 | if (defptr[stim]) {
|
|---|
| 150 |
|
|---|
| 151 | printf(" defptr[$%04.4X] = %3d%s\n",
|
|---|
| 152 | stim, defptr[stim],
|
|---|
| 153 | ((TRG_MASK & ptedef) EQ stim) ?
|
|---|
| 154 | " <-- ptedef" : "");
|
|---|
| 155 | }
|
|---|
| 156 | }
|
|---|
| 157 | }
|
|---|
| 158 | #endif
|
|---|
| 159 |
|
|---|
| 160 | #if DUMPSTM
|
|---|
| 161 | if (dumpstm) {
|
|---|
| 162 |
|
|---|
| 163 | for (stim = 0; stim < NDEFSTMS; stim++)
|
|---|
| 164 | if (stmptr[stim])
|
|---|
| 165 | printf(" stmptr[$%04.4X] = %3d%s\n",
|
|---|
| 166 | stim, stmptr[stim],
|
|---|
| 167 | ((TRG_MASK & ptestm) EQ stim) ?
|
|---|
| 168 | " <-- ptestm" : "");
|
|---|
| 169 | }
|
|---|
| 170 | #endif
|
|---|
| 171 |
|
|---|
| 172 | printf("\n");
|
|---|
| 173 | }
|
|---|
| 174 |
|
|---|
| 175 | /* |
|---|
| 176 |
|
|---|
| 177 | */
|
|---|
| 178 |
|
|---|
| 179 | /*
|
|---|
| 180 | =============================================================================
|
|---|
| 181 | buf2pte() -- pack the patch buffer
|
|---|
| 182 | =============================================================================
|
|---|
| 183 | */
|
|---|
| 184 |
|
|---|
| 185 | void buf2pte(void)
|
|---|
| 186 | {
|
|---|
| 187 | ptebuf.defnum = ptedef;
|
|---|
| 188 | ptebuf.stmnum = ptestm;
|
|---|
| 189 | ptebuf.paspec = ptespec;
|
|---|
| 190 | ptebuf.pasuba = ptesuba;
|
|---|
| 191 | ptebuf.padat1 = ptedat1;
|
|---|
| 192 | ptebuf.padat2 = ptedat2;
|
|---|
| 193 |
|
|---|
| 194 | pteset = TRUE;
|
|---|
| 195 |
|
|---|
| 196 | #if DEBUGPD
|
|---|
| 197 | if (debugsw AND debugpd) {
|
|---|
| 198 |
|
|---|
| 199 | if (snappb)
|
|---|
| 200 | SnapPTV("buf2pte");
|
|---|
| 201 |
|
|---|
| 202 | printf("buf2pte(): ptebuf setup\n");
|
|---|
| 203 | }
|
|---|
| 204 | #endif
|
|---|
| 205 |
|
|---|
| 206 | }
|
|---|
| 207 |
|
|---|
| 208 | /* |
|---|
| 209 |
|
|---|
| 210 | */
|
|---|
| 211 |
|
|---|
| 212 | /*
|
|---|
| 213 | =============================================================================
|
|---|
| 214 | voidpb() -- void the patch buffer
|
|---|
| 215 | =============================================================================
|
|---|
| 216 | */
|
|---|
| 217 |
|
|---|
| 218 | void voidpb(void)
|
|---|
| 219 | {
|
|---|
| 220 | memset(ptdebuf, ' ', 50); /* clear data entry buffer */
|
|---|
| 221 |
|
|---|
| 222 | ptebuf.defnum = ptedef = NULL_DEF; /* blank definer */
|
|---|
| 223 | ptebuf.stmnum = ptestm = 0x0000;
|
|---|
| 224 | ptebuf.paspec = ptespec = 0x0000;
|
|---|
| 225 | ptebuf.pasuba = ptesuba = 0x0000;
|
|---|
| 226 | ptebuf.padat1 = ptedat1 = 0x0000;
|
|---|
| 227 | ptebuf.padat2 = ptedat2 = 0x0000;
|
|---|
| 228 |
|
|---|
| 229 | ptbflag = FALSE;
|
|---|
| 230 |
|
|---|
| 231 | pteset = FALSE;
|
|---|
| 232 |
|
|---|
| 233 | ptegood = FALSE;
|
|---|
| 234 |
|
|---|
| 235 | ptedfok = TRUE; /* definer is OK until it's screwed up */
|
|---|
| 236 | ptestok = FALSE;
|
|---|
| 237 | ptedsok = FALSE;
|
|---|
| 238 | ptedtok = FALSE;
|
|---|
| 239 |
|
|---|
| 240 | ptedfst = -1;
|
|---|
| 241 | ptedest = -1;
|
|---|
| 242 | ptedata = -1;
|
|---|
| 243 |
|
|---|
| 244 | #if DEBUGVP
|
|---|
| 245 | if (debugsw AND debugvp) {
|
|---|
| 246 |
|
|---|
| 247 | if (snappb)
|
|---|
| 248 | SnapPTV("voidpb");
|
|---|
| 249 |
|
|---|
| 250 | printf("voidpb(): patch buffer VOIDED\n");
|
|---|
| 251 | }
|
|---|
| 252 | #endif
|
|---|
| 253 |
|
|---|
| 254 | }
|
|---|
| 255 |
|
|---|
| 256 | /* |
|---|
| 257 |
|
|---|
| 258 | */
|
|---|
| 259 |
|
|---|
| 260 | /*
|
|---|
| 261 | =============================================================================
|
|---|
| 262 |
|
|---|
| 263 | =============================================================================
|
|---|
| 264 | */
|
|---|
| 265 |
|
|---|
| 266 | void setptcv(void)
|
|---|
| 267 | {
|
|---|
| 268 | register unsigned short spec;
|
|---|
| 269 |
|
|---|
| 270 | ptedest = des2fmt[spec = ptespec & PE_SPEC];
|
|---|
| 271 |
|
|---|
| 272 | switch (ptedest) { /* setup datum entry format */
|
|---|
| 273 |
|
|---|
| 274 | case 0: /* key */
|
|---|
| 275 | case 2: /* pulse */
|
|---|
| 276 |
|
|---|
| 277 | ptedata = 8;
|
|---|
| 278 | break;
|
|---|
| 279 |
|
|---|
| 280 | case 1: /* trigger */
|
|---|
| 281 |
|
|---|
| 282 | ptedata = 9;
|
|---|
| 283 | break;
|
|---|
| 284 |
|
|---|
| 285 | case 3: /* led */
|
|---|
| 286 |
|
|---|
| 287 | ptedata = 14;
|
|---|
| 288 | break;
|
|---|
| 289 | /* |
|---|
| 290 |
|
|---|
| 291 | */
|
|---|
| 292 | case 4: /* seq, reg */
|
|---|
| 293 |
|
|---|
| 294 | if (spec EQ PA_SLIN)
|
|---|
| 295 | ptedata = 13;
|
|---|
| 296 | else if (spec EQ PA_SCTL)
|
|---|
| 297 | ptedata = 9;
|
|---|
| 298 | else
|
|---|
| 299 | ptedata = 12;
|
|---|
| 300 |
|
|---|
| 301 | break;
|
|---|
| 302 |
|
|---|
| 303 | case 5: /* tuning */
|
|---|
| 304 |
|
|---|
| 305 | ptedata = 18;
|
|---|
| 306 | break;
|
|---|
| 307 |
|
|---|
| 308 | case 6: /* inst, wave, config */
|
|---|
| 309 |
|
|---|
| 310 | if (spec EQ PA_INST)
|
|---|
| 311 | ptedata = 15;
|
|---|
| 312 | else if (spec EQ PA_CNFG)
|
|---|
| 313 | ptedata = 17;
|
|---|
| 314 | else
|
|---|
| 315 | ptedata = 16;
|
|---|
| 316 |
|
|---|
| 317 | break;
|
|---|
| 318 |
|
|---|
| 319 | case 7: /* aux, rate, inten, dpth */
|
|---|
| 320 | case 8: /* vout */
|
|---|
| 321 |
|
|---|
| 322 | ptedata = dtabl7[ptedat1];
|
|---|
| 323 | break;
|
|---|
| 324 |
|
|---|
| 325 | case 9: /* osc, ind, frq */
|
|---|
| 326 | case 10: /* level, filtr, fil q, loctn, dynmc */
|
|---|
| 327 |
|
|---|
| 328 | if (spec EQ PA_OSC)
|
|---|
| 329 | ptedata = ptedat1 + 4;
|
|---|
| 330 | else
|
|---|
| 331 | ptedata = dtabl9[ptedat1];
|
|---|
| 332 |
|
|---|
| 333 | break;
|
|---|
| 334 |
|
|---|
| 335 | default: /* something weird got in here somehow ... */
|
|---|
| 336 |
|
|---|
| 337 | #if DEBUGPD
|
|---|
| 338 | if (debugsw AND debugpd)
|
|---|
| 339 | printf("setptcv(): BAD ptedest ($%04.4X), spec = $%04.4X\n",
|
|---|
| 340 | ptedest, spec);
|
|---|
| 341 | #endif
|
|---|
| 342 |
|
|---|
| 343 | ptedata = -1;
|
|---|
| 344 | break;
|
|---|
| 345 | }
|
|---|
| 346 | }
|
|---|
| 347 |
|
|---|
| 348 | /* |
|---|
| 349 |
|
|---|
| 350 | */
|
|---|
| 351 |
|
|---|
| 352 | /*
|
|---|
| 353 | =============================================================================
|
|---|
| 354 | pte2buf() -- convert ptebuf to ptdebuf format and load edit variables
|
|---|
| 355 | =============================================================================
|
|---|
| 356 | */
|
|---|
| 357 |
|
|---|
| 358 | void pte2buf(void)
|
|---|
| 359 | {
|
|---|
| 360 | register unsigned short spec;
|
|---|
| 361 |
|
|---|
| 362 | memset(ptdebuf, ' ', 50);
|
|---|
| 363 |
|
|---|
| 364 | ptbflag = TRUE;
|
|---|
| 365 |
|
|---|
| 366 | if (pteset) { /* if ptebuf is valid ... */
|
|---|
| 367 |
|
|---|
| 368 | ptedef = ptebuf.defnum; /* ... setup the edit variables */
|
|---|
| 369 | ptestm = ptebuf.stmnum;
|
|---|
| 370 | ptespec = ptebuf.paspec;
|
|---|
| 371 | ptesuba = ptebuf.pasuba;
|
|---|
| 372 | ptedat1 = ptebuf.padat1;
|
|---|
| 373 | ptedat2 = ptebuf.padat2;
|
|---|
| 374 |
|
|---|
| 375 | setptcv(); /* setup control variables */
|
|---|
| 376 |
|
|---|
| 377 | dspdfst(&ptdebuf[ 2], ptedef); /* setup the patch buffer */
|
|---|
| 378 | dspdfst(&ptdebuf[15], ptestm);
|
|---|
| 379 | dspdest(&ptdebuf[28], &ptebuf);
|
|---|
| 380 | ptdebuf[ 0] = ' ';
|
|---|
| 381 | ptdebuf[ 1] = ' ';
|
|---|
| 382 | ptdebuf[14] = ' ';
|
|---|
| 383 | ptdebuf[27] = ' ';
|
|---|
| 384 |
|
|---|
| 385 | /* |
|---|
| 386 |
|
|---|
| 387 | */
|
|---|
| 388 | ptegood = TRUE; /* validate the patch buffer */
|
|---|
| 389 | ptedfok = TRUE;
|
|---|
| 390 | ptestok = TRUE;
|
|---|
| 391 | ptedsok = TRUE;
|
|---|
| 392 | ptedtok = TRUE;
|
|---|
| 393 |
|
|---|
| 394 | #if DEBUGPD
|
|---|
| 395 | if (debugsw AND debugpd) {
|
|---|
| 396 |
|
|---|
| 397 | if (snappb)
|
|---|
| 398 | SnapPTV("pte2buf");
|
|---|
| 399 |
|
|---|
| 400 | printf("pte2buf(): patch buffer LOADED\n");
|
|---|
| 401 | }
|
|---|
| 402 | #endif
|
|---|
| 403 |
|
|---|
| 404 | } else {
|
|---|
| 405 |
|
|---|
| 406 | voidpb(); /* void the patch buffer */
|
|---|
| 407 |
|
|---|
| 408 | #if DEBUGPD
|
|---|
| 409 | if (debugsw AND debugpd)
|
|---|
| 410 | printf("pte2buf(): patch buffer VOIDED\n");
|
|---|
| 411 | #endif
|
|---|
| 412 |
|
|---|
| 413 | }
|
|---|
| 414 | }
|
|---|
| 415 |
|
|---|
| 416 | /* |
|---|
| 417 |
|
|---|
| 418 | */
|
|---|
| 419 |
|
|---|
| 420 | /*
|
|---|
| 421 | =============================================================================
|
|---|
| 422 | ptde_ds() -- digit data entry for definer / stimulus fields
|
|---|
| 423 | =============================================================================
|
|---|
| 424 | */
|
|---|
| 425 |
|
|---|
| 426 | void ptde_ds(short n, short key)
|
|---|
| 427 | {
|
|---|
| 428 | register short chan, port, stim;
|
|---|
| 429 | char buf[8], buf2[8];
|
|---|
| 430 |
|
|---|
| 431 | if (n ? ptestok : ptedfok) {
|
|---|
| 432 |
|
|---|
| 433 | if ((n EQ 0) AND (ptedef EQ 0xFFFF))
|
|---|
| 434 | return;
|
|---|
| 435 |
|
|---|
| 436 | port = ((n ? ptestm : ptedef) >> 11) & 0x0003;
|
|---|
| 437 | chan = ((n ? ptestm : ptedef) >> 7) & 0x000F;
|
|---|
| 438 | stim = (n ? ptestm : ptedef) & 0x007F;
|
|---|
| 439 |
|
|---|
| 440 | if ((port EQ 0) OR (port EQ 1) OR ((port EQ 2) AND (chan < 2))) {
|
|---|
| 441 |
|
|---|
| 442 | /* Key / Rel */
|
|---|
| 443 |
|
|---|
| 444 | if (inrange(stccol, dsdecol[0][n][0], dsdecol[0][n][1]) OR
|
|---|
| 445 | inrange(stccol, dsdecol[3][n][0], dsdecol[3][n][1]) OR
|
|---|
| 446 | inrange(stccol, dsdecol[4][n][0], dsdecol[4][n][1])) {
|
|---|
| 447 |
|
|---|
| 448 | if (stccol EQ dsdecol[3][n][1]) {
|
|---|
| 449 |
|
|---|
| 450 | if ((key < 1) OR (key > 3))
|
|---|
| 451 | return;
|
|---|
| 452 |
|
|---|
| 453 | if (key EQ 3) {
|
|---|
| 454 |
|
|---|
| 455 | buf[0] = 'L';
|
|---|
| 456 | UpdVid(7, n ? 25 : 12, " ", PTDATR);
|
|---|
| 457 |
|
|---|
| 458 | if (n)
|
|---|
| 459 | ptestm &= 0xF87F;
|
|---|
| 460 | else
|
|---|
| 461 | ptedef &= 0xF87F;
|
|---|
| 462 |
|
|---|
| 463 | } else {
|
|---|
| 464 |
|
|---|
| 465 | sprintf(buf2, "%02d", 1 + chan);
|
|---|
| 466 | buf[0] = key + '0';
|
|---|
| 467 | UpdVid(7, n ? 25 : 12, buf2, PTDATR);
|
|---|
| 468 | }
|
|---|
| 469 | /* |
|---|
| 470 |
|
|---|
| 471 | */
|
|---|
| 472 | port = key - 1;
|
|---|
| 473 |
|
|---|
| 474 | if (n)
|
|---|
| 475 | ptestm = (ptestm & 0xE7FF) | (port << 11);
|
|---|
| 476 | else
|
|---|
| 477 | ptedef = (ptestm & 0xE7FF) | (port << 11);
|
|---|
| 478 |
|
|---|
| 479 | } else {
|
|---|
| 480 |
|
|---|
| 481 | buf[0] = key + '0';
|
|---|
| 482 | }
|
|---|
| 483 |
|
|---|
| 484 | ptdebuf[stccol] = buf[0];
|
|---|
| 485 | buf[1] = '\0';
|
|---|
| 486 |
|
|---|
| 487 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 488 |
|
|---|
| 489 | if (stccol EQ dsdecol[4][n][1]) {
|
|---|
| 490 |
|
|---|
| 491 | ctcon();
|
|---|
| 492 | return;
|
|---|
| 493 | }
|
|---|
| 494 |
|
|---|
| 495 | if ((stccol EQ dsdecol[0][n][1]) OR
|
|---|
| 496 | (stccol EQ dsdecol[3][n][1]))
|
|---|
| 497 | ++stccol;
|
|---|
| 498 |
|
|---|
| 499 | movectc(stcrow, ++stccol);
|
|---|
| 500 | }
|
|---|
| 501 |
|
|---|
| 502 | return;
|
|---|
| 503 | /* |
|---|
| 504 |
|
|---|
| 505 | */
|
|---|
| 506 | } else if ((port EQ 2) AND (chan EQ 2)) {
|
|---|
| 507 |
|
|---|
| 508 | /* Trig */
|
|---|
| 509 |
|
|---|
| 510 | if (inrange(stccol, dsdecol[1][n][0], dsdecol[1][n][1])) {
|
|---|
| 511 |
|
|---|
| 512 | ptdebuf[stccol] = key + '0';
|
|---|
| 513 | buf[0] = key + '0';
|
|---|
| 514 | buf[1] = '\0';
|
|---|
| 515 |
|
|---|
| 516 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 517 |
|
|---|
| 518 | if (stccol EQ dsdecol[1][n][1]) {
|
|---|
| 519 |
|
|---|
| 520 | ctcon();
|
|---|
| 521 | return;
|
|---|
| 522 | }
|
|---|
| 523 |
|
|---|
| 524 | movectc(stcrow, ++stccol);
|
|---|
| 525 | }
|
|---|
| 526 |
|
|---|
| 527 | return;
|
|---|
| 528 |
|
|---|
| 529 | } else if ((port EQ 2) AND (chan EQ 3)) {
|
|---|
| 530 |
|
|---|
| 531 | /* Pulse */
|
|---|
| 532 |
|
|---|
| 533 | if (stccol EQ dsdecol[2][n][1]) {
|
|---|
| 534 |
|
|---|
| 535 | if ((key < 1) OR (key > 2))
|
|---|
| 536 | return;
|
|---|
| 537 |
|
|---|
| 538 | ptdebuf[stccol] = key + '0';
|
|---|
| 539 | buf[0] = key + '0';
|
|---|
| 540 | buf[1] = '\0';
|
|---|
| 541 |
|
|---|
| 542 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 543 | ctcon();
|
|---|
| 544 | }
|
|---|
| 545 |
|
|---|
| 546 | return;
|
|---|
| 547 | }
|
|---|
| 548 | }
|
|---|
| 549 | }
|
|---|
| 550 |
|
|---|
| 551 | /* |
|---|
| 552 |
|
|---|
| 553 | */
|
|---|
| 554 |
|
|---|
| 555 | /*
|
|---|
| 556 | =============================================================================
|
|---|
| 557 | ptdkey() -- patch digit data entry function
|
|---|
| 558 | =============================================================================
|
|---|
| 559 | */
|
|---|
| 560 |
|
|---|
| 561 | void ptdkey(void)
|
|---|
| 562 | {
|
|---|
| 563 | register short key, val, vg;
|
|---|
| 564 | char buf[8];
|
|---|
| 565 |
|
|---|
| 566 | if (NOT astat) /* only do this on key closures */
|
|---|
| 567 | return;
|
|---|
| 568 |
|
|---|
| 569 | if (NOT ptbflag) /* load up the edit buffer */
|
|---|
| 570 | pte2buf();
|
|---|
| 571 |
|
|---|
| 572 | key = asig - 60;
|
|---|
| 573 |
|
|---|
| 574 | if (inrange(stccol, 2, 13)) { /* DEFINER */
|
|---|
| 575 |
|
|---|
| 576 | ptde_ds(0, key);
|
|---|
| 577 | return;
|
|---|
| 578 |
|
|---|
| 579 | } else if (inrange(stccol, 15, 26)) { /* STIMULUS */
|
|---|
| 580 |
|
|---|
| 581 | ptde_ds(1, key);
|
|---|
| 582 | return;
|
|---|
| 583 | /* |
|---|
| 584 |
|
|---|
| 585 | */
|
|---|
| 586 | } else if (inrange(stccol, 28, 40)) { /* DESTINATION */
|
|---|
| 587 |
|
|---|
| 588 | if (ptedsok) {
|
|---|
| 589 |
|
|---|
| 590 | switch (ptedest) {
|
|---|
| 591 |
|
|---|
| 592 | case 0: /* key */
|
|---|
| 593 |
|
|---|
| 594 | if (inrange(stccol, 30, 32) OR
|
|---|
| 595 | (stccol EQ 34) OR
|
|---|
| 596 | inrange(stccol, 36, 37)) {
|
|---|
| 597 |
|
|---|
| 598 | if (stccol EQ 34) {
|
|---|
| 599 |
|
|---|
| 600 | if ((key < 1) OR (key > 3))
|
|---|
| 601 | return;
|
|---|
| 602 |
|
|---|
| 603 | if (key EQ 3)
|
|---|
| 604 | buf[0] = 'L';
|
|---|
| 605 | else
|
|---|
| 606 | buf[0] = key + '0';
|
|---|
| 607 |
|
|---|
| 608 | } else {
|
|---|
| 609 |
|
|---|
| 610 | buf[0] = key + '0';
|
|---|
| 611 | }
|
|---|
| 612 |
|
|---|
| 613 | ptdebuf[stccol] = buf[0];
|
|---|
| 614 | buf[1] = '\0';
|
|---|
| 615 |
|
|---|
| 616 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 617 |
|
|---|
| 618 | if ((stccol EQ 32) OR (stccol EQ 34))
|
|---|
| 619 | ++stccol;
|
|---|
| 620 |
|
|---|
| 621 | if (stccol EQ 37)
|
|---|
| 622 | ctcon();
|
|---|
| 623 | else
|
|---|
| 624 | movectc(stcrow, ++stccol);
|
|---|
| 625 | }
|
|---|
| 626 |
|
|---|
| 627 | return;
|
|---|
| 628 | /* |
|---|
| 629 |
|
|---|
| 630 | */
|
|---|
| 631 | case 1: /* trg */
|
|---|
| 632 |
|
|---|
| 633 | if (inrange(stccol, 36, 37)) {
|
|---|
| 634 |
|
|---|
| 635 | ptdebuf[stccol] = key + '0';
|
|---|
| 636 | buf[0] = key + '0';
|
|---|
| 637 | buf[1] = '\0';
|
|---|
| 638 |
|
|---|
| 639 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 640 |
|
|---|
| 641 | if (stccol EQ 37)
|
|---|
| 642 | ctcon();
|
|---|
| 643 | else
|
|---|
| 644 | movectc(stcrow, ++stccol);
|
|---|
| 645 | }
|
|---|
| 646 |
|
|---|
| 647 | return;
|
|---|
| 648 |
|
|---|
| 649 | case 2: /* pls */
|
|---|
| 650 |
|
|---|
| 651 | if (stccol EQ 34) {
|
|---|
| 652 |
|
|---|
| 653 | if ((key < 1) OR (key > 2))
|
|---|
| 654 | return;
|
|---|
| 655 |
|
|---|
| 656 | ptdebuf[stccol] = key + '0';
|
|---|
| 657 | buf[0] = key + '0';
|
|---|
| 658 | buf[1] = '\0';
|
|---|
| 659 |
|
|---|
| 660 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 661 | ctcon();
|
|---|
| 662 | }
|
|---|
| 663 |
|
|---|
| 664 | return;
|
|---|
| 665 | /* |
|---|
| 666 |
|
|---|
| 667 | */
|
|---|
| 668 | case 3: /* led */
|
|---|
| 669 |
|
|---|
| 670 | if (stccol EQ 32) {
|
|---|
| 671 |
|
|---|
| 672 | if (key > 6)
|
|---|
| 673 | return;
|
|---|
| 674 |
|
|---|
| 675 | ptdebuf[stccol] = key + 'A';
|
|---|
| 676 | buf[0] = key + 'A';
|
|---|
| 677 | buf[1] = '\0';
|
|---|
| 678 |
|
|---|
| 679 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 680 | ctcon();
|
|---|
| 681 | }
|
|---|
| 682 |
|
|---|
| 683 | return;
|
|---|
| 684 |
|
|---|
| 685 | case 4: /* seqlin, seqctl, regset, regadd */
|
|---|
| 686 |
|
|---|
| 687 | if (inrange(stccol, 32, 33)) {
|
|---|
| 688 |
|
|---|
| 689 | ptdebuf[stccol] = key + '0';
|
|---|
| 690 | buf[0] = key + '0';
|
|---|
| 691 | buf[1] = '\0';
|
|---|
| 692 |
|
|---|
| 693 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 694 |
|
|---|
| 695 | if (stccol EQ 33)
|
|---|
| 696 | ctcon();
|
|---|
| 697 | else
|
|---|
| 698 | movectc(stcrow, ++stccol);
|
|---|
| 699 | }
|
|---|
| 700 |
|
|---|
| 701 | return;
|
|---|
| 702 | /* |
|---|
| 703 |
|
|---|
| 704 | */
|
|---|
| 705 | case 5: /* tune */
|
|---|
| 706 | case 7: /* aux, rate, inten, depth */
|
|---|
| 707 |
|
|---|
| 708 | return;
|
|---|
| 709 |
|
|---|
| 710 | case 8: /* v out */
|
|---|
| 711 |
|
|---|
| 712 | if (stccol EQ 32) {
|
|---|
| 713 |
|
|---|
| 714 | if ((key < 1) OR (key > 5))
|
|---|
| 715 | return;
|
|---|
| 716 |
|
|---|
| 717 | ptdebuf[stccol] = key + '0';
|
|---|
| 718 | buf[0] = key + '0';
|
|---|
| 719 | buf[1] = '\0';
|
|---|
| 720 |
|
|---|
| 721 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 722 | movectc(DATAROW, 34);
|
|---|
| 723 | }
|
|---|
| 724 |
|
|---|
| 725 | return;
|
|---|
| 726 |
|
|---|
| 727 | case 9: /* osc, index, freq */
|
|---|
| 728 |
|
|---|
| 729 | if (stccol EQ 32) {
|
|---|
| 730 |
|
|---|
| 731 | if ((key < 1) OR (key > 4))
|
|---|
| 732 | return;
|
|---|
| 733 |
|
|---|
| 734 | ptdebuf[stccol] = key + '0';
|
|---|
| 735 | buf[0] = key + '0';
|
|---|
| 736 | buf[1] = '\0';
|
|---|
| 737 |
|
|---|
| 738 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 739 | movectc(DATAROW, 34);
|
|---|
| 740 | return;
|
|---|
| 741 | }
|
|---|
| 742 |
|
|---|
| 743 | /* FALL-THROUGH to handle v/g in columns 39..40 */
|
|---|
| 744 | /* |
|---|
| 745 |
|
|---|
| 746 | */
|
|---|
| 747 | case 6: /* inst, wava, wavb, conf */
|
|---|
| 748 | case 10: /* level, filtr, fil q, loctn, dynmc */
|
|---|
| 749 |
|
|---|
| 750 | if (inrange(stccol, 39, 40)) {
|
|---|
| 751 |
|
|---|
| 752 | vg = (ptesuba >> 8) & 0x00FF;
|
|---|
| 753 |
|
|---|
| 754 | if (stccol EQ 39) {
|
|---|
| 755 |
|
|---|
| 756 | if ((key EQ 8) OR (key EQ 9)) {
|
|---|
| 757 |
|
|---|
| 758 | if (vg > 11) {
|
|---|
| 759 |
|
|---|
| 760 | vg -= 12;
|
|---|
| 761 | val = 'V';
|
|---|
| 762 |
|
|---|
| 763 | } else {
|
|---|
| 764 |
|
|---|
| 765 | vg += 12;
|
|---|
| 766 | val = 'G';
|
|---|
| 767 | }
|
|---|
| 768 |
|
|---|
| 769 | ptesuba = (ptesuba & 0x00FF) |
|
|---|
| 770 | (vg << 8);
|
|---|
| 771 |
|
|---|
| 772 | } else {
|
|---|
| 773 |
|
|---|
| 774 | return;
|
|---|
| 775 | }
|
|---|
| 776 | /* |
|---|
| 777 |
|
|---|
| 778 | */
|
|---|
| 779 | } else { /* column 40 */
|
|---|
| 780 |
|
|---|
| 781 | if ( ((vg EQ 0) OR (vg EQ 12)) AND
|
|---|
| 782 | ((key EQ 0) OR (key EQ 1) OR (key EQ 2)) )
|
|---|
| 783 | key += 10;
|
|---|
| 784 | else if (key EQ 0)
|
|---|
| 785 | return;
|
|---|
| 786 |
|
|---|
| 787 | val = key + ((key > 9) ? '\242' :'0') ;
|
|---|
| 788 |
|
|---|
| 789 | --key;
|
|---|
| 790 |
|
|---|
| 791 | if (vg > 11)
|
|---|
| 792 | vg = key + 12;
|
|---|
| 793 | else
|
|---|
| 794 | vg = key;
|
|---|
| 795 |
|
|---|
| 796 | ptesuba = (ptesuba & 0x00FF) |
|
|---|
| 797 | (vg << 8);
|
|---|
| 798 | }
|
|---|
| 799 |
|
|---|
| 800 | ptdebuf[stccol] = val;
|
|---|
| 801 | buf[0] = val;
|
|---|
| 802 | buf[1] = '\0';
|
|---|
| 803 |
|
|---|
| 804 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 805 |
|
|---|
| 806 | if (stccol EQ 40)
|
|---|
| 807 | ctcon();
|
|---|
| 808 | else
|
|---|
| 809 | movectc(stcrow, ++stccol);
|
|---|
| 810 | }
|
|---|
| 811 |
|
|---|
| 812 | return;
|
|---|
| 813 |
|
|---|
| 814 | default: /* Eh ? */
|
|---|
| 815 |
|
|---|
| 816 | return;
|
|---|
| 817 | }
|
|---|
| 818 | }
|
|---|
| 819 | /* |
|---|
| 820 |
|
|---|
| 821 | */
|
|---|
| 822 | } else if (inrange(stccol, 42, 46)) { /* DATUM */
|
|---|
| 823 |
|
|---|
| 824 | switch (ptedata) {
|
|---|
| 825 |
|
|---|
| 826 | case 1: /* multiplier -- +1.00 */
|
|---|
| 827 |
|
|---|
| 828 | switch (stccol) {
|
|---|
| 829 |
|
|---|
| 830 | case 42: /* + | - */
|
|---|
| 831 |
|
|---|
| 832 | if (key EQ 8)
|
|---|
| 833 | buf[0] = '-';
|
|---|
| 834 | else if (key EQ 9)
|
|---|
| 835 | buf[0] = '+';
|
|---|
| 836 | else
|
|---|
| 837 | return;
|
|---|
| 838 |
|
|---|
| 839 | break;
|
|---|
| 840 |
|
|---|
| 841 | case 43: /* 0 | 1 */
|
|---|
| 842 |
|
|---|
| 843 | if ((key EQ 0) OR (key EQ 1))
|
|---|
| 844 | buf[0] = key + '0';
|
|---|
| 845 | else
|
|---|
| 846 | return;
|
|---|
| 847 |
|
|---|
| 848 | break;
|
|---|
| 849 |
|
|---|
| 850 | case 45: /* 0..9 */
|
|---|
| 851 | case 46: /* 0..9 */
|
|---|
| 852 |
|
|---|
| 853 | buf[0] = key + '0';
|
|---|
| 854 | break;
|
|---|
| 855 |
|
|---|
| 856 | case 44: /* . */
|
|---|
| 857 | default:
|
|---|
| 858 |
|
|---|
| 859 | return;
|
|---|
| 860 | }
|
|---|
| 861 | /* |
|---|
| 862 |
|
|---|
| 863 | */
|
|---|
| 864 | buf[1] = '\0';
|
|---|
| 865 | ptdebuf[stccol] = buf[0];
|
|---|
| 866 |
|
|---|
| 867 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 868 |
|
|---|
| 869 | if (stccol EQ 43)
|
|---|
| 870 | ++stccol;
|
|---|
| 871 |
|
|---|
| 872 | if (stccol EQ 46)
|
|---|
| 873 | ctcon();
|
|---|
| 874 | else
|
|---|
| 875 | movectc(stcrow, ++stccol);
|
|---|
| 876 |
|
|---|
| 877 | return;
|
|---|
| 878 | /* |
|---|
| 879 |
|
|---|
| 880 | */
|
|---|
| 881 | case 2: /* time -- 32767 */
|
|---|
| 882 |
|
|---|
| 883 | if ((stccol EQ 42) AND (key > 3))
|
|---|
| 884 | return;
|
|---|
| 885 |
|
|---|
| 886 | buf[0] = key + '0';
|
|---|
| 887 | buf[1] = '\0';
|
|---|
| 888 | ptdebuf[stccol] = buf[0];
|
|---|
| 889 |
|
|---|
| 890 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 891 |
|
|---|
| 892 | if (stccol EQ 46)
|
|---|
| 893 | ctcon();
|
|---|
| 894 | else
|
|---|
| 895 | movectc(stcrow, ++stccol);
|
|---|
| 896 |
|
|---|
| 897 | return;
|
|---|
| 898 |
|
|---|
| 899 | /* |
|---|
| 900 |
|
|---|
| 901 | */
|
|---|
| 902 | case 3: /* value -- +10.00 */
|
|---|
| 903 |
|
|---|
| 904 | switch (stccol) {
|
|---|
| 905 |
|
|---|
| 906 | case 42:
|
|---|
| 907 |
|
|---|
| 908 | if (key EQ 8) {
|
|---|
| 909 |
|
|---|
| 910 | if (ptdebuf[42] EQ '\240')
|
|---|
| 911 | buf[0] = '\241';
|
|---|
| 912 | else if (ptdebuf[42] EQ '\241')
|
|---|
| 913 | buf[0] = '\241';
|
|---|
| 914 | else
|
|---|
| 915 | buf[0] = '-';
|
|---|
| 916 |
|
|---|
| 917 | } else if (key EQ 9) {
|
|---|
| 918 |
|
|---|
| 919 | if (ptdebuf[42] EQ '\240')
|
|---|
| 920 | buf[0] = '\240';
|
|---|
| 921 | else if (ptdebuf[42] EQ '\241')
|
|---|
| 922 | buf[0] = '\240';
|
|---|
| 923 | else
|
|---|
| 924 | buf[0] = '+';
|
|---|
| 925 |
|
|---|
| 926 | } else if (key EQ 0) {
|
|---|
| 927 |
|
|---|
| 928 | if (ptdebuf[42] EQ '\240')
|
|---|
| 929 | buf[0] = '+';
|
|---|
| 930 | else if (ptdebuf[42] EQ '\241')
|
|---|
| 931 | buf[0] = '-';
|
|---|
| 932 | else
|
|---|
| 933 | return;
|
|---|
| 934 |
|
|---|
| 935 | } else if (key EQ 1) {
|
|---|
| 936 |
|
|---|
| 937 | if (ptdebuf[42] EQ '\240')
|
|---|
| 938 | buf[0] = '\240';
|
|---|
| 939 | else if (ptdebuf[42] EQ '\241')
|
|---|
| 940 | buf[0] = '\241';
|
|---|
| 941 | else if (ptdebuf[42] EQ '+')
|
|---|
| 942 | buf[0] = '\240';
|
|---|
| 943 | else if (ptdebuf[42] EQ '-')
|
|---|
| 944 | buf[0] = '\241';
|
|---|
| 945 | else
|
|---|
| 946 | return;
|
|---|
| 947 |
|
|---|
| 948 | } else
|
|---|
| 949 | return;
|
|---|
| 950 |
|
|---|
| 951 | break;
|
|---|
| 952 | /* |
|---|
| 953 |
|
|---|
| 954 | */
|
|---|
| 955 | case 43:
|
|---|
| 956 | case 45:
|
|---|
| 957 | case 46:
|
|---|
| 958 |
|
|---|
| 959 | buf[0] = key + '0';
|
|---|
| 960 | break;
|
|---|
| 961 |
|
|---|
| 962 | case 44:
|
|---|
| 963 | default:
|
|---|
| 964 | return;
|
|---|
| 965 | }
|
|---|
| 966 |
|
|---|
| 967 | buf[1] = '\0';
|
|---|
| 968 | ptdebuf[stccol] = buf[0];
|
|---|
| 969 |
|
|---|
| 970 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 971 |
|
|---|
| 972 | if (stccol EQ 43)
|
|---|
| 973 | ++stccol;
|
|---|
| 974 |
|
|---|
| 975 | if (stccol EQ 46)
|
|---|
| 976 | ctcon();
|
|---|
| 977 | else
|
|---|
| 978 | movectc(stcrow, ++stccol);
|
|---|
| 979 |
|
|---|
| 980 | return;
|
|---|
| 981 | /* |
|---|
| 982 |
|
|---|
| 983 | */
|
|---|
| 984 | case 4: /* interval -- +1200 */
|
|---|
| 985 |
|
|---|
| 986 | if (stccol EQ 42) {
|
|---|
| 987 |
|
|---|
| 988 | if (key EQ 8)
|
|---|
| 989 | buf[0] = '-';
|
|---|
| 990 | else if (key EQ 9)
|
|---|
| 991 | buf[0] = '+';
|
|---|
| 992 | else
|
|---|
| 993 | return;
|
|---|
| 994 |
|
|---|
| 995 | } else if (stccol EQ 43) {
|
|---|
| 996 |
|
|---|
| 997 | if (key > 1)
|
|---|
| 998 | return;
|
|---|
| 999 | else
|
|---|
| 1000 | buf[0] = key + '0';
|
|---|
| 1001 |
|
|---|
| 1002 | } else {
|
|---|
| 1003 |
|
|---|
| 1004 | buf[0] = key + '0';
|
|---|
| 1005 | }
|
|---|
| 1006 |
|
|---|
| 1007 | ptdebuf[stccol] = buf[0];
|
|---|
| 1008 | buf[1] = '\0';
|
|---|
| 1009 |
|
|---|
| 1010 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1011 |
|
|---|
| 1012 | if (stccol EQ 46)
|
|---|
| 1013 | ctcon();
|
|---|
| 1014 | else
|
|---|
| 1015 | movectc(stcrow, ++stccol);
|
|---|
| 1016 |
|
|---|
| 1017 | return;
|
|---|
| 1018 | /* |
|---|
| 1019 |
|
|---|
| 1020 | */
|
|---|
| 1021 | case 5: /* ratio -- 9/9 */
|
|---|
| 1022 |
|
|---|
| 1023 | switch (stccol) {
|
|---|
| 1024 |
|
|---|
| 1025 | case 42:
|
|---|
| 1026 | case 44:
|
|---|
| 1027 |
|
|---|
| 1028 | buf[0] = key +'0';
|
|---|
| 1029 | break;
|
|---|
| 1030 |
|
|---|
| 1031 | case 43:
|
|---|
| 1032 | case 45:
|
|---|
| 1033 | case 46:
|
|---|
| 1034 |
|
|---|
| 1035 | return;
|
|---|
| 1036 | }
|
|---|
| 1037 |
|
|---|
| 1038 | ptdebuf[stccol] = buf[0];
|
|---|
| 1039 | buf[1] = '\0';
|
|---|
| 1040 |
|
|---|
| 1041 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1042 |
|
|---|
| 1043 | if (stccol EQ 42)
|
|---|
| 1044 | ++stccol;
|
|---|
| 1045 |
|
|---|
| 1046 | if (stccol EQ 44)
|
|---|
| 1047 | ctcon();
|
|---|
| 1048 | else
|
|---|
| 1049 | movectc(stcrow, ++stccol);
|
|---|
| 1050 |
|
|---|
| 1051 | return;
|
|---|
| 1052 | /* |
|---|
| 1053 |
|
|---|
| 1054 | */
|
|---|
| 1055 | case 6: /* frequency -- 15.9 */
|
|---|
| 1056 |
|
|---|
| 1057 | switch (stccol) {
|
|---|
| 1058 |
|
|---|
| 1059 | case 42:
|
|---|
| 1060 |
|
|---|
| 1061 | if (key > 1)
|
|---|
| 1062 | return;
|
|---|
| 1063 |
|
|---|
| 1064 | /* FALL-THROUGH */
|
|---|
| 1065 |
|
|---|
| 1066 | case 43:
|
|---|
| 1067 | case 45:
|
|---|
| 1068 |
|
|---|
| 1069 | buf[0] = key + '0';
|
|---|
| 1070 | break;
|
|---|
| 1071 |
|
|---|
| 1072 | case 44:
|
|---|
| 1073 | case 46:
|
|---|
| 1074 |
|
|---|
| 1075 | return;
|
|---|
| 1076 | }
|
|---|
| 1077 |
|
|---|
| 1078 | ptdebuf[stccol] = buf[0];
|
|---|
| 1079 | buf[1] = '\0';
|
|---|
| 1080 |
|
|---|
| 1081 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1082 |
|
|---|
| 1083 | if (stccol EQ 43)
|
|---|
| 1084 | ++stccol;
|
|---|
| 1085 |
|
|---|
| 1086 | if (stccol EQ 45)
|
|---|
| 1087 | ctcon();
|
|---|
| 1088 | else
|
|---|
| 1089 | movectc(stcrow, ++stccol);
|
|---|
| 1090 |
|
|---|
| 1091 | return;
|
|---|
| 1092 | /* |
|---|
| 1093 |
|
|---|
| 1094 | */
|
|---|
| 1095 | case 7: /* pitch -- 9C#99 */
|
|---|
| 1096 |
|
|---|
| 1097 | switch (stccol) {
|
|---|
| 1098 |
|
|---|
| 1099 | case 43:
|
|---|
| 1100 |
|
|---|
| 1101 | if (key > 6)
|
|---|
| 1102 | return;
|
|---|
| 1103 |
|
|---|
| 1104 | buf[0] = key + 'A';
|
|---|
| 1105 | break;
|
|---|
| 1106 |
|
|---|
| 1107 | case 44:
|
|---|
| 1108 |
|
|---|
| 1109 | if (key EQ 7)
|
|---|
| 1110 | buf[0] = ' ';
|
|---|
| 1111 | else if (key EQ 8)
|
|---|
| 1112 | buf[0] = '\251';
|
|---|
| 1113 | else if (key EQ 9)
|
|---|
| 1114 | buf[0] = '\250';
|
|---|
| 1115 | else
|
|---|
| 1116 | return;
|
|---|
| 1117 |
|
|---|
| 1118 | break;
|
|---|
| 1119 |
|
|---|
| 1120 | case 42:
|
|---|
| 1121 | case 45:
|
|---|
| 1122 | case 46:
|
|---|
| 1123 |
|
|---|
| 1124 | buf[0] = key + '0';
|
|---|
| 1125 | break;
|
|---|
| 1126 | }
|
|---|
| 1127 |
|
|---|
| 1128 | ptdebuf[stccol] = buf[0];
|
|---|
| 1129 | buf[1] = '\0';
|
|---|
| 1130 |
|
|---|
| 1131 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1132 |
|
|---|
| 1133 | if (stccol EQ 46)
|
|---|
| 1134 | ctcon();
|
|---|
| 1135 | else
|
|---|
| 1136 | movectc(stcrow, ++stccol);
|
|---|
| 1137 |
|
|---|
| 1138 | return;
|
|---|
| 1139 | /* |
|---|
| 1140 |
|
|---|
| 1141 | */
|
|---|
| 1142 | case 8: /* trans | stop | start */
|
|---|
| 1143 |
|
|---|
| 1144 | switch (key) {
|
|---|
| 1145 |
|
|---|
| 1146 | case 7: /* trans */
|
|---|
| 1147 |
|
|---|
| 1148 | strcpy(buf, "Trans");
|
|---|
| 1149 | ptedat2 = 0;
|
|---|
| 1150 | break;
|
|---|
| 1151 |
|
|---|
| 1152 | case 8: /* stop */
|
|---|
| 1153 |
|
|---|
| 1154 | strcpy(buf, "Stop ");
|
|---|
| 1155 | ptedat2 = 1;
|
|---|
| 1156 | break;
|
|---|
| 1157 |
|
|---|
| 1158 | case 9: /* start */
|
|---|
| 1159 |
|
|---|
| 1160 | strcpy(buf, "Start");
|
|---|
| 1161 | ptedat2 = 2;
|
|---|
| 1162 | break;
|
|---|
| 1163 |
|
|---|
| 1164 | default:
|
|---|
| 1165 |
|
|---|
| 1166 | return;
|
|---|
| 1167 | }
|
|---|
| 1168 |
|
|---|
| 1169 | strcpy(&ptdebuf[42], buf);
|
|---|
| 1170 | UpdVid(7, 42, buf, PTDATR);
|
|---|
| 1171 | movectc(stcrow, 46);
|
|---|
| 1172 | return;
|
|---|
| 1173 | /* |
|---|
| 1174 |
|
|---|
| 1175 | */
|
|---|
| 1176 | case 9: /* stop | start */
|
|---|
| 1177 |
|
|---|
| 1178 | if (key EQ 8) { /* stop */
|
|---|
| 1179 |
|
|---|
| 1180 | strcpy(buf, "Stop ");
|
|---|
| 1181 | ptedat2 = 0;
|
|---|
| 1182 |
|
|---|
| 1183 | } else if (key EQ 9) { /* start */
|
|---|
| 1184 |
|
|---|
| 1185 | strcpy(buf, "Start");
|
|---|
| 1186 | ptedat2 = 1;
|
|---|
| 1187 |
|
|---|
| 1188 | } else {
|
|---|
| 1189 |
|
|---|
| 1190 | return;
|
|---|
| 1191 | }
|
|---|
| 1192 |
|
|---|
| 1193 | strcpy(&ptdebuf[42], buf);
|
|---|
| 1194 | UpdVid(7, 42, buf, PTDATR);
|
|---|
| 1195 | movectc(stcrow, 46);
|
|---|
| 1196 | return;
|
|---|
| 1197 |
|
|---|
| 1198 | case 10: /* off | on */
|
|---|
| 1199 |
|
|---|
| 1200 | if (key EQ 8) { /* off */
|
|---|
| 1201 |
|
|---|
| 1202 | strcpy(buf, "Off ");
|
|---|
| 1203 | ptedat2 = 0;
|
|---|
| 1204 |
|
|---|
| 1205 | } else if (key EQ 9) { /* on */
|
|---|
| 1206 |
|
|---|
| 1207 | strcpy(buf, "On ");
|
|---|
| 1208 | ptedat2 = 1;
|
|---|
| 1209 |
|
|---|
| 1210 | } else {
|
|---|
| 1211 |
|
|---|
| 1212 | return;
|
|---|
| 1213 | }
|
|---|
| 1214 |
|
|---|
| 1215 | strcpy(&ptdebuf[42], buf);
|
|---|
| 1216 | UpdVid(7, 42, buf, PTDATR);
|
|---|
| 1217 | movectc(stcrow, 46);
|
|---|
| 1218 | return;
|
|---|
| 1219 | /* |
|---|
| 1220 |
|
|---|
| 1221 | */
|
|---|
| 1222 | case 11: /* source */
|
|---|
| 1223 |
|
|---|
| 1224 | return;
|
|---|
| 1225 |
|
|---|
| 1226 | case 12: /* register | value */
|
|---|
| 1227 |
|
|---|
| 1228 | switch (stccol) {
|
|---|
| 1229 |
|
|---|
| 1230 | case 42:
|
|---|
| 1231 |
|
|---|
| 1232 | if (key EQ 7)
|
|---|
| 1233 | buf[0] = 'R';
|
|---|
| 1234 | else if (key EQ 8 AND ((PE_SPEC & ptespec) NE PA_RSET))
|
|---|
| 1235 | buf[0] = '-';
|
|---|
| 1236 | else if (key EQ 9)
|
|---|
| 1237 | buf[0] = '+';
|
|---|
| 1238 | else
|
|---|
| 1239 | return;
|
|---|
| 1240 |
|
|---|
| 1241 | break;
|
|---|
| 1242 |
|
|---|
| 1243 | case 43:
|
|---|
| 1244 | case 44:
|
|---|
| 1245 |
|
|---|
| 1246 | buf[0] = key + '0';
|
|---|
| 1247 | break;
|
|---|
| 1248 |
|
|---|
| 1249 | default:
|
|---|
| 1250 |
|
|---|
| 1251 | return;
|
|---|
| 1252 | }
|
|---|
| 1253 |
|
|---|
| 1254 | ptdebuf[stccol] = buf[0];
|
|---|
| 1255 | buf[1] = '\0';
|
|---|
| 1256 |
|
|---|
| 1257 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1258 |
|
|---|
| 1259 | if (stccol EQ 44)
|
|---|
| 1260 | ctcon();
|
|---|
| 1261 | else
|
|---|
| 1262 | movectc(stcrow, ++stccol);
|
|---|
| 1263 |
|
|---|
| 1264 | return;
|
|---|
| 1265 | /* |
|---|
| 1266 |
|
|---|
| 1267 | */
|
|---|
| 1268 | case 13: /* sequence line */
|
|---|
| 1269 |
|
|---|
| 1270 | if (stccol > 44)
|
|---|
| 1271 | return;
|
|---|
| 1272 |
|
|---|
| 1273 | buf[0] = key + '0';
|
|---|
| 1274 | ptdebuf[stccol] = buf[0];
|
|---|
| 1275 | buf[1] = '\0';
|
|---|
| 1276 |
|
|---|
| 1277 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1278 |
|
|---|
| 1279 | if (stccol EQ 44)
|
|---|
| 1280 | ctcon();
|
|---|
| 1281 | else
|
|---|
| 1282 | movectc(stcrow, ++stccol);
|
|---|
| 1283 |
|
|---|
| 1284 | return;
|
|---|
| 1285 |
|
|---|
| 1286 | case 14: /* LED controls */
|
|---|
| 1287 |
|
|---|
| 1288 | if ((key > 3) OR (stccol EQ 46))
|
|---|
| 1289 | return;
|
|---|
| 1290 |
|
|---|
| 1291 | if ((stccol EQ 45) AND (0 EQ (ptesuba & 0x0001)))
|
|---|
| 1292 | return;
|
|---|
| 1293 |
|
|---|
| 1294 | buf[0] = key + '0';
|
|---|
| 1295 | buf[1] = '\0';
|
|---|
| 1296 | ptdebuf[stccol] = buf[0];
|
|---|
| 1297 |
|
|---|
| 1298 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1299 |
|
|---|
| 1300 | if (((ptesuba & 0x0001) AND (stccol EQ 45)) OR
|
|---|
| 1301 | ((0 EQ ptesuba & 0x0001) AND (stccol EQ 44)))
|
|---|
| 1302 | ctcon();
|
|---|
| 1303 | else
|
|---|
| 1304 | movectc(stcrow, ++stccol);
|
|---|
| 1305 |
|
|---|
| 1306 | return;
|
|---|
| 1307 | /* |
|---|
| 1308 |
|
|---|
| 1309 | */
|
|---|
| 1310 | case 15: /* instrument number */
|
|---|
| 1311 |
|
|---|
| 1312 | if (stccol > 43)
|
|---|
| 1313 | return;
|
|---|
| 1314 |
|
|---|
| 1315 | if ((stccol EQ 42) AND (key > 4))
|
|---|
| 1316 | return;
|
|---|
| 1317 |
|
|---|
| 1318 | buf[0] = key + '0';
|
|---|
| 1319 | buf[1] = '\0';
|
|---|
| 1320 | ptdebuf[stccol] = buf[0];
|
|---|
| 1321 |
|
|---|
| 1322 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1323 |
|
|---|
| 1324 | if (stccol EQ 43)
|
|---|
| 1325 | ctcon();
|
|---|
| 1326 | else
|
|---|
| 1327 | movectc(stcrow, ++stccol);
|
|---|
| 1328 |
|
|---|
| 1329 | return;
|
|---|
| 1330 | /* |
|---|
| 1331 |
|
|---|
| 1332 | */
|
|---|
| 1333 | case 16: /* waveshape number */
|
|---|
| 1334 |
|
|---|
| 1335 | if (stccol > 43)
|
|---|
| 1336 | return;
|
|---|
| 1337 |
|
|---|
| 1338 | if ((stccol EQ 42) AND (key > 2))
|
|---|
| 1339 | return;
|
|---|
| 1340 |
|
|---|
| 1341 | buf[0] = key + '0';
|
|---|
| 1342 | buf[1] = '\0';
|
|---|
| 1343 | ptdebuf[stccol] = buf[0];
|
|---|
| 1344 |
|
|---|
| 1345 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1346 |
|
|---|
| 1347 | if (stccol EQ 43)
|
|---|
| 1348 | ctcon();
|
|---|
| 1349 | else
|
|---|
| 1350 | movectc(stcrow, ++stccol);
|
|---|
| 1351 |
|
|---|
| 1352 | return;
|
|---|
| 1353 |
|
|---|
| 1354 | case 17: /* configuration number */
|
|---|
| 1355 |
|
|---|
| 1356 | if (stccol > 43)
|
|---|
| 1357 | return;
|
|---|
| 1358 |
|
|---|
| 1359 | if ((stccol EQ 42) AND (key > 1))
|
|---|
| 1360 | return;
|
|---|
| 1361 |
|
|---|
| 1362 | buf[0] = key + '0';
|
|---|
| 1363 | buf[1] = '\0';
|
|---|
| 1364 | ptdebuf[stccol] = buf[0];
|
|---|
| 1365 |
|
|---|
| 1366 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1367 |
|
|---|
| 1368 | if (stccol EQ 43)
|
|---|
| 1369 | ctcon();
|
|---|
| 1370 | else
|
|---|
| 1371 | movectc(stcrow, ++stccol);
|
|---|
| 1372 |
|
|---|
| 1373 | return;
|
|---|
| 1374 | /* |
|---|
| 1375 |
|
|---|
| 1376 | */
|
|---|
| 1377 | case 18: /* tuning table number */
|
|---|
| 1378 |
|
|---|
| 1379 | if (stccol > 42)
|
|---|
| 1380 | return;
|
|---|
| 1381 |
|
|---|
| 1382 | buf[0] = key + '0';
|
|---|
| 1383 | buf[1] = '\0';
|
|---|
| 1384 | ptdebuf[stccol] = buf[0];
|
|---|
| 1385 |
|
|---|
| 1386 | UpdVid(7, stccol, buf, PTDATR);
|
|---|
| 1387 |
|
|---|
| 1388 | ctcon();
|
|---|
| 1389 | return;
|
|---|
| 1390 |
|
|---|
| 1391 | default:
|
|---|
| 1392 |
|
|---|
| 1393 | return;
|
|---|
| 1394 | }
|
|---|
| 1395 | }
|
|---|
| 1396 | }
|
|---|