[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | idselbx.c -- instrument definition box selection functions
|
---|
| 4 | Version 46 -- 1988-09-15 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include "stddefs.h"
|
---|
| 9 | #include "fields.h"
|
---|
| 10 | #include "hwdefs.h"
|
---|
| 11 | #include "vsdd.h"
|
---|
| 12 | #include "graphdef.h"
|
---|
| 13 |
|
---|
| 14 | #include "midas.h"
|
---|
| 15 | #include "instdsp.h"
|
---|
| 16 |
|
---|
| 17 | extern short (*itxput)();
|
---|
| 18 |
|
---|
[0580615] | 19 | extern void lseg(short x1, short y1, short x2, short y2, short t);
|
---|
| 20 | extern void dswin(short n);
|
---|
| 21 | extern void tsplot4(int *obase, int nw, int fg, int row, int col, char *str, int pitch);
|
---|
| 22 | extern void vbfill4(unsigned *obj, short obwidth, short xmin, short ymin, short xmax, short ymax, unsigned color);
|
---|
| 23 | extern void enterit(void);
|
---|
| 24 | extern void vtdisp(unsigned *obj, unsigned fg, unsigned bg, short row, short col, char *buf);
|
---|
| 25 | extern void advicur(void);
|
---|
| 26 | extern void bspicur(void);
|
---|
| 27 |
|
---|
| 28 | extern void drawfn(short fn, short how, short pen, short wn);
|
---|
| 29 | extern short selpnt(void);
|
---|
| 30 | extern short ttox(unsigned time, short window);
|
---|
| 31 | extern short vtoy(short val, short window);
|
---|
| 32 |
|
---|
| 33 | extern short timeto(short fn, short pj);
|
---|
| 34 | extern unsigned exp_c(unsigned c);
|
---|
[f40a309] | 35 |
|
---|
| 36 | /* |
---|
| 37 |
|
---|
| 38 | */
|
---|
| 39 |
|
---|
| 40 | extern short cursbox, cxval, cyval;
|
---|
| 41 | extern short curvce, curfunc, curpnt;
|
---|
| 42 | extern short hitbox, hitcx, hitcy, idnamsw, idimsw, idtdat;
|
---|
| 43 | extern short pntsv, pecase, stccol, subj, submenu;
|
---|
| 44 |
|
---|
| 45 | extern unsigned temin, temax;
|
---|
| 46 |
|
---|
| 47 | extern struct selbox *csbp, *curboxp;
|
---|
| 48 | extern struct instdef vbufs[];
|
---|
| 49 | extern struct instdef idefs[];
|
---|
| 50 |
|
---|
| 51 | extern struct instpnt *pntptr;
|
---|
| 52 |
|
---|
| 53 | extern short idbox[][8];
|
---|
| 54 | extern short instmod[];
|
---|
| 55 |
|
---|
| 56 | extern char *vtdeptr;
|
---|
| 57 |
|
---|
| 58 | extern char *idbxlbl[];
|
---|
| 59 | extern char idhlbl[];
|
---|
| 60 | extern char bfs[];
|
---|
| 61 |
|
---|
| 62 | extern unsigned *instob;
|
---|
| 63 |
|
---|
| 64 | /* forward references */
|
---|
[0580615] | 65 |
|
---|
| 66 | short bx_null(void);
|
---|
[f40a309] | 67 | short idfnbox(short n);
|
---|
| 68 |
|
---|
| 69 | /* |
---|
| 70 |
|
---|
| 71 | */
|
---|
| 72 |
|
---|
| 73 | struct selbox idboxes[] = {
|
---|
| 74 |
|
---|
| 75 | { 1, 1, 84, 26, 0, idfnbox}, /* 0: Freq 1 */
|
---|
| 76 | { 86, 1, 169, 26, 1, idfnbox}, /* 1: Freq 2 */
|
---|
| 77 | {171, 1, 254, 26, 2, idfnbox}, /* 2: Freq 3 */
|
---|
| 78 | {256, 1, 339, 26, 3, idfnbox}, /* 3: Freq 4 */
|
---|
| 79 | {341, 1, 424, 26, 4, idfnbox}, /* 4: Filter / Resonance */
|
---|
| 80 | {426, 1, 509, 26, 5, idfnbox}, /* 5: Location */
|
---|
| 81 |
|
---|
| 82 | { 1, 28, 84, 54, 6, idfnbox}, /* 6: Index 1 */
|
---|
| 83 | { 86, 28, 169, 54, 7, idfnbox}, /* 7: Index 2 */
|
---|
| 84 | {171, 28, 254, 54, 8, idfnbox}, /* 8: Index 3 */
|
---|
| 85 | {256, 28, 339, 54, 9, idfnbox}, /* 9: Index 4 */
|
---|
| 86 | {341, 28, 424, 54, 10, idfnbox}, /* 10: Index 5 */
|
---|
| 87 | {426, 28, 509, 54, 11, idfnbox}, /* 11: Index 6 */
|
---|
| 88 |
|
---|
| 89 | { 1, 56, 509, 208, 12, idfnbox}, /* 12: Level */
|
---|
| 90 |
|
---|
| 91 | { 1, 210, 110, 236, 0x0000, enterit}, /* 13: Source- Mlt */
|
---|
| 92 | {112, 210, 142, 236, 0x0000, enterit}, /* 14: Pt */
|
---|
| 93 | {144, 210, 206, 236, 0x0000, enterit}, /* 15: Time */
|
---|
| 94 | {208, 210, 366, 236, 0x0000, enterit}, /* 16: Value */
|
---|
| 95 | {368, 210, 509, 236, 0x0000, enterit}, /* 17: Action */
|
---|
| 96 |
|
---|
| 97 | { 1, 238, 131, 348, 0x0000, idfnbox}, /* 18: Algorithm */
|
---|
| 98 | {133, 238, 267, 251, 0x0000, idfnbox}, /* 19: Voice & Inst */
|
---|
| 99 | {269, 238, 379, 306, 0x0000, enterit}, /* 20: Oscillators */
|
---|
| 100 | {381, 238, 509, 348, 0x0000, idfnbox}, /* 21: Waveshape */
|
---|
| 101 |
|
---|
| 102 | {133, 308, 379, 348, 0x0000, enterit}, /* 22: Variables */
|
---|
| 103 |
|
---|
| 104 | {133, 252, 267, 306, 19, idfnbox}, /* 23: Name & Comments */
|
---|
| 105 |
|
---|
| 106 | { 0, 0, 0, 0, 0, FN_NULL} /* end of table */
|
---|
| 107 | };
|
---|
| 108 |
|
---|
| 109 | /* |
---|
| 110 |
|
---|
| 111 | */
|
---|
| 112 |
|
---|
| 113 | /*
|
---|
| 114 | =============================================================================
|
---|
| 115 | idtxput() -- put out instrument menu text for the instrument display
|
---|
[0580615] | 116 | =============================================================================
|
---|
[f40a309] | 117 | */
|
---|
| 118 |
|
---|
| 119 | void idtxput(short row, short col, char *txt, short tag)
|
---|
| 120 | {
|
---|
| 121 | if (v_regs[5] & 0x0180)
|
---|
| 122 | vbank(0);
|
---|
| 123 |
|
---|
| 124 | tsplot4(instob, 64, CFBX19, row, col, txt, 14);
|
---|
| 125 | }
|
---|
| 126 |
|
---|
| 127 | /*
|
---|
| 128 | =============================================================================
|
---|
| 129 | showim() -- show the instrument menu
|
---|
[0580615] | 130 | =============================================================================
|
---|
[f40a309] | 131 | */
|
---|
| 132 |
|
---|
| 133 | void showim(void)
|
---|
| 134 | {
|
---|
| 135 | register short row, col, ins;
|
---|
| 136 |
|
---|
| 137 | ins = 0;
|
---|
| 138 |
|
---|
| 139 | for (col = 1; col < 46; col += 22) {
|
---|
| 140 |
|
---|
| 141 | (*itxput)(0, col, "No Instrument", 0);
|
---|
| 142 |
|
---|
| 143 | for (row = 1; row < 15; row++) {
|
---|
| 144 |
|
---|
| 145 | if (ins GE NINST)
|
---|
| 146 | break;
|
---|
| 147 |
|
---|
| 148 | sprintf(bfs, "%02d %-16.16s", ins, idefs[ins].idhname);
|
---|
| 149 | (*itxput)(row, col, bfs, 1);
|
---|
| 150 | ++ins;
|
---|
| 151 | }
|
---|
| 152 | }
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | /* |
---|
| 156 |
|
---|
| 157 | */
|
---|
| 158 |
|
---|
| 159 | /*
|
---|
| 160 | =============================================================================
|
---|
[0580615] | 161 | cdnicur() -- instrument definition virtual typewriter -- cursor down
|
---|
[f40a309] | 162 | =============================================================================
|
---|
| 163 | */
|
---|
| 164 |
|
---|
| 165 | void cdnicur(void)
|
---|
| 166 | {
|
---|
| 167 | register struct instdef *ip;
|
---|
| 168 |
|
---|
| 169 | ip = &vbufs[curvce];
|
---|
| 170 |
|
---|
| 171 | switch (idtdat) {
|
---|
| 172 |
|
---|
| 173 | case 0:
|
---|
| 174 | idtdat = 1;
|
---|
| 175 | vtdeptr = ip->idhcom1;
|
---|
| 176 | settc(19, stccol);
|
---|
| 177 | return;
|
---|
| 178 |
|
---|
| 179 | case 1:
|
---|
| 180 | idtdat = 2;
|
---|
| 181 | vtdeptr = ip->idhcom2;
|
---|
| 182 | settc(20, stccol);
|
---|
| 183 | return;
|
---|
| 184 |
|
---|
| 185 | case 2:
|
---|
| 186 | idtdat = 3;
|
---|
| 187 | vtdeptr = ip->idhcom3;
|
---|
| 188 | settc(21, stccol);
|
---|
| 189 | return;
|
---|
| 190 |
|
---|
| 191 | case 3:
|
---|
| 192 | idtdat = 0;
|
---|
| 193 | vtdeptr = ip->idhname;
|
---|
| 194 | settc(18, stccol);
|
---|
| 195 | return;
|
---|
| 196 | }
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 | /* |
---|
| 200 |
|
---|
| 201 | */
|
---|
| 202 |
|
---|
| 203 | /*
|
---|
[0580615] | 204 | =============================================================================
|
---|
[f40a309] | 205 | cupicur() -- instrument definition virtual typewriter -- cursor up
|
---|
| 206 | =============================================================================
|
---|
| 207 | */
|
---|
| 208 |
|
---|
| 209 | void cupicur(void)
|
---|
| 210 | {
|
---|
| 211 | register struct instdef *ip;
|
---|
| 212 |
|
---|
| 213 | ip = &vbufs[curvce];
|
---|
| 214 |
|
---|
| 215 | switch (idtdat) {
|
---|
| 216 |
|
---|
| 217 | case 0:
|
---|
| 218 | idtdat = 3;
|
---|
| 219 | vtdeptr = ip->idhcom3;
|
---|
| 220 | settc(21, stccol);
|
---|
| 221 | return;
|
---|
| 222 |
|
---|
| 223 | case 1:
|
---|
| 224 | idtdat = 0;
|
---|
| 225 | vtdeptr = ip->idhname;
|
---|
| 226 | settc(18, stccol);
|
---|
| 227 | return;
|
---|
| 228 |
|
---|
| 229 | case 2:
|
---|
| 230 | idtdat = 1;
|
---|
| 231 | vtdeptr = ip->idhcom1;
|
---|
| 232 | settc(19, stccol);
|
---|
| 233 | return;
|
---|
| 234 |
|
---|
| 235 | case 3:
|
---|
| 236 | idtdat = 2;
|
---|
| 237 | vtdeptr = ip->idhcom2;
|
---|
| 238 | settc(20, stccol);
|
---|
| 239 | return;
|
---|
| 240 | }
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 | /* |
---|
| 244 |
|
---|
| 245 | */
|
---|
| 246 |
|
---|
[0580615] | 247 | /*
|
---|
[f40a309] | 248 | =============================================================================
|
---|
| 249 | edfunc() -- setup to edit a function
|
---|
| 250 | =============================================================================
|
---|
| 251 | */
|
---|
| 252 |
|
---|
| 253 | short edfunc(short n)
|
---|
| 254 | {
|
---|
| 255 | register unsigned cx;
|
---|
| 256 | register struct instdef *ip;
|
---|
| 257 |
|
---|
| 258 | ip = &vbufs[curvce];
|
---|
| 259 |
|
---|
| 260 | /* first, put level in selected window */
|
---|
| 261 |
|
---|
| 262 | cx = exp_c(ID_LVLC); /* label background = level background */
|
---|
| 263 |
|
---|
| 264 | vbank(0);
|
---|
| 265 | vbfill4(instob, 128, idbox[n][0], idbox[n][1],
|
---|
| 266 | idbox[n][2], idbox[n][3], cx);
|
---|
| 267 |
|
---|
| 268 | tsplot4(instob, 64,
|
---|
| 269 | ((ip->idhfnc[12].idftmd & I_TM_KEY) ? idbox[n][4] : ID_INST),
|
---|
| 270 | idbox[n][6], idbox[n][7], idbxlbl[12], 14);
|
---|
| 271 |
|
---|
| 272 | if (n NE 12) /* if not editing the level, draw it in the label */
|
---|
| 273 | drawfn(12, 0, ID_CLVL, n);
|
---|
| 274 |
|
---|
| 275 | /* |
---|
| 276 |
|
---|
| 277 | */
|
---|
| 278 | /* next, put the level and selected functions in the level window */
|
---|
| 279 |
|
---|
| 280 | vbank(0); /* clear the edit/level box */
|
---|
| 281 | vbfill4(instob, 128, idbox[12][0], idbox[12][1],
|
---|
| 282 | idbox[12][2], idbox[12][3], cx);
|
---|
| 283 |
|
---|
| 284 | /* label the function */
|
---|
| 285 |
|
---|
| 286 | tsplot4(instob, 64,
|
---|
| 287 | ((ip->idhfnc[n].idftmd & I_TM_KEY) ? idbox[n][4] : ID_INST),
|
---|
| 288 | idbox[12][6], idbox[12][7], idbxlbl[n], 14);
|
---|
| 289 |
|
---|
| 290 | /* scale -- x labels */
|
---|
| 291 |
|
---|
| 292 | tsplot4(instob, 64, TGRID, 14, 0, idhlbl, 14);
|
---|
| 293 |
|
---|
| 294 | /* scale -- y labels */
|
---|
| 295 |
|
---|
| 296 | tsplot4(instob, 64, TGRID, 14, 0, "\300", 14);
|
---|
| 297 | tsplot4(instob, 64, TGRID, 12, 0, "\302", 14);
|
---|
| 298 | tsplot4(instob, 64, TGRID, 10, 0, "\304", 14);
|
---|
| 299 | tsplot4(instob, 64, TGRID, 8, 0, "\306", 14);
|
---|
| 300 | tsplot4(instob, 64, TGRID, 6, 0, "\310", 14);
|
---|
| 301 | tsplot4(instob, 64, TGRID, 4, 0, "\312", 14);
|
---|
| 302 |
|
---|
| 303 | lseg( 7, 56, 7, 196, LGRID); /* draw the scale */
|
---|
| 304 | lseg( 7, 196, 509, 196, LGRID);
|
---|
| 305 |
|
---|
| 306 | /* plot functions: first level, then selected function */
|
---|
| 307 |
|
---|
| 308 | if (n NE 12) /* if not editing level, draw it as a reference */
|
---|
| 309 | drawfn(12, 0, ID_CLVL, 12);
|
---|
| 310 |
|
---|
| 311 | drawfn(n, pntsv, ID_CLIN, 12);
|
---|
| 312 |
|
---|
| 313 | curfunc = n; /* make n the current function */
|
---|
| 314 |
|
---|
| 315 | if (curfunc EQ 4) {
|
---|
| 316 |
|
---|
| 317 | tsplot4(instob, 64,
|
---|
| 318 | ((ip->idhfnc[n].idftmd & I_TM_KEY) ?
|
---|
| 319 | idbox[12][4] : ID_INST),
|
---|
| 320 | idbox[12][6] + 1, idbox[12][7] + 4, "Res", 14);
|
---|
| 321 |
|
---|
| 322 | rd_ires(12);
|
---|
| 323 | }
|
---|
| 324 |
|
---|
| 325 | return(TRUE);
|
---|
| 326 | }
|
---|
| 327 |
|
---|
| 328 | /* |
---|
| 329 |
|
---|
[0580615] | 330 | */
|
---|
[f40a309] | 331 |
|
---|
| 332 | /*
|
---|
| 333 | =============================================================================
|
---|
| 334 | showpt() -- show the data about a point
|
---|
| 335 | =============================================================================
|
---|
| 336 | */
|
---|
| 337 |
|
---|
| 338 | void showpt(short q)
|
---|
| 339 | {
|
---|
| 340 | register short ptx, pty, i, j, k;
|
---|
| 341 | register struct instdef *ip;
|
---|
| 342 | short ptc;
|
---|
| 343 |
|
---|
| 344 | if (q)
|
---|
| 345 | dswin(14); /* point number */
|
---|
| 346 |
|
---|
| 347 | dswin(15); /* time */
|
---|
| 348 | dswin(16); /* value */
|
---|
| 349 | dswin(17); /* action */
|
---|
| 350 |
|
---|
| 351 | ip = &vbufs[curvce];
|
---|
| 352 | j = ip->idhfnc[curfunc].idfpif;
|
---|
| 353 | k = ip->idhfnc[curfunc].idfpt1;
|
---|
| 354 |
|
---|
| 355 | for (i = 0; i < j; i++) {
|
---|
| 356 |
|
---|
| 357 | ptx = ttox(timeto(curfunc, i), 12);
|
---|
| 358 | pty = vtoy((ip->idhpnt[k + i].ipval) >> 5, 12);
|
---|
| 359 | ptc = ((ip->idhpnt[k + i].ipvsrc) OR (ip->idhpnt[k + i].ipact) ?
|
---|
| 360 | ID_ACTP : ID_CPNT);
|
---|
| 361 |
|
---|
| 362 | drawpt(ptx, pty, ptc);
|
---|
| 363 | }
|
---|
| 364 |
|
---|
| 365 | ptx = ttox(timeto(curfunc, subj), 12);
|
---|
| 366 | pty = vtoy((ip->idhpnt[k + subj].ipval) >> 5, 12);
|
---|
| 367 | drawpt(ptx, pty, ID_SELD);
|
---|
| 368 | }
|
---|
| 369 |
|
---|
| 370 | /* |
---|
[0580615] | 371 |
|
---|
[f40a309] | 372 | */
|
---|
| 373 |
|
---|
| 374 | /*
|
---|
| 375 | =============================================================================
|
---|
| 376 | endityp() -- exit instrument definition virtual typewriter
|
---|
| 377 | =============================================================================
|
---|
| 378 | */
|
---|
| 379 |
|
---|
| 380 | void endityp(void)
|
---|
| 381 | {
|
---|
| 382 | idnamsw = FALSE;
|
---|
| 383 | submenu = FALSE;
|
---|
| 384 | idvlblc();
|
---|
| 385 | dswin(19);
|
---|
[0580615] | 386 | dswin(22);
|
---|
[f40a309] | 387 | }
|
---|
| 388 |
|
---|
| 389 | /*
|
---|
| 390 | =============================================================================
|
---|
| 391 | showfn() show the data about a function
|
---|
| 392 | =============================================================================
|
---|
| 393 | */
|
---|
| 394 |
|
---|
| 395 | void showfn(void)
|
---|
| 396 | {
|
---|
| 397 | dswin(13); /* source multiplier */
|
---|
[0580615] | 398 | showpt(1); /* point, time, value, action */
|
---|
[f40a309] | 399 | }
|
---|
| 400 |
|
---|
| 401 | /*
|
---|
| 402 | =============================================================================
|
---|
| 403 | bx_null() -- null item selection processor
|
---|
| 404 | =============================================================================
|
---|
| 405 | */
|
---|
| 406 |
|
---|
| 407 | short bx_null(void)
|
---|
| 408 | {
|
---|
[0580615] | 409 | return(TRUE);
|
---|
[f40a309] | 410 | }
|
---|
| 411 |
|
---|
| 412 | /*
|
---|
| 413 | =============================================================================
|
---|
| 414 | iclrwin() -- clear an instrument editor window
|
---|
| 415 | =============================================================================
|
---|
| 416 | */
|
---|
| 417 |
|
---|
| 418 | void iclrwin(short n)
|
---|
| 419 | {
|
---|
| 420 | if (v_regs[5] & 0x0180)
|
---|
| 421 | vbank(0);
|
---|
| 422 |
|
---|
| 423 | vbfill4(instob, 128, idbox[n][0], idbox[n][1], idbox[n][2], idbox[n][3],
|
---|
| 424 | exp_c(idbox[n][5]));
|
---|
| 425 | }
|
---|
| 426 |
|
---|
[0580615] | 427 | /* |
---|
[f40a309] | 428 |
|
---|
| 429 | */
|
---|
| 430 |
|
---|
| 431 | /*
|
---|
| 432 | =============================================================================
|
---|
| 433 | idfnbox() -- instrument display function box hit processor
|
---|
| 434 | =============================================================================
|
---|
| 435 | */
|
---|
| 436 |
|
---|
| 437 | short idfnbox(short n)
|
---|
| 438 | {
|
---|
| 439 | register short col, i, row;
|
---|
| 440 | register struct instdef *ip;
|
---|
| 441 | register char *ivtdptr;
|
---|
| 442 |
|
---|
| 443 | ip = &vbufs[curvce];
|
---|
| 444 |
|
---|
| 445 | row = hitcy / 14;
|
---|
| 446 | col = hitcx >> 3;
|
---|
| 447 |
|
---|
| 448 | /* |
---|
| 449 |
|
---|
| 450 | */
|
---|
| 451 | if (hitbox EQ 12) { /* process a hit in the level window */
|
---|
| 452 |
|
---|
| 453 | /* handle data entry special case for resonance in filter fn. */
|
---|
| 454 |
|
---|
| 455 | if ((curfunc EQ 4) AND (row EQ 5) AND (col EQ 62))
|
---|
| 456 | return(enterit());
|
---|
| 457 |
|
---|
| 458 | switch (pntsv) { /* dispatch off of point select state */
|
---|
| 459 |
|
---|
| 460 | case 0: /* nothing selected so far: select a point */
|
---|
| 461 |
|
---|
| 462 | subj = selpnt(); /* decide on the point */
|
---|
| 463 | pntsel(); /* make it current */
|
---|
| 464 | pntsv = 1; /* say it's selected */
|
---|
| 465 |
|
---|
| 466 | edfunc(curfunc); /* update the display */
|
---|
| 467 | showpt(1);
|
---|
| 468 |
|
---|
| 469 | /* set cursor to point */
|
---|
| 470 |
|
---|
| 471 | cxval = ttox(timeto(curfunc, subj), 12);
|
---|
| 472 | cyval = vtoy((pntptr->ipval >> 5), 12);
|
---|
| 473 | arcurs(ID_SELD);
|
---|
| 474 | gcurpos(cxval, cyval);
|
---|
| 475 | break;
|
---|
| 476 |
|
---|
| 477 | case 1: /* point was selected: unselect it */
|
---|
| 478 |
|
---|
| 479 | pntsv = 0;
|
---|
| 480 | edfunc(curfunc);
|
---|
| 481 | arcurs(ID_NCUR);
|
---|
| 482 | gcurpos(cxval, cyval);
|
---|
| 483 | break;
|
---|
| 484 | }
|
---|
| 485 |
|
---|
| 486 | return(TRUE);
|
---|
| 487 |
|
---|
| 488 | } else if (hitbox EQ 18) { /* configuration */
|
---|
| 489 |
|
---|
| 490 | if ((row EQ 17) AND (col GE 4) AND (col LE 9)) {
|
---|
| 491 |
|
---|
| 492 | wcmenu(0);
|
---|
| 493 | return(TRUE);
|
---|
| 494 |
|
---|
| 495 | } else {
|
---|
| 496 |
|
---|
| 497 | return(enterit());
|
---|
| 498 | }
|
---|
| 499 | /* |
---|
| 500 |
|
---|
| 501 | */
|
---|
| 502 | } else if (hitbox EQ 19) { /* voice & inst. */
|
---|
| 503 |
|
---|
| 504 | if ((col GE 26) AND (col LE 29) AND (row EQ 17)) {
|
---|
| 505 |
|
---|
| 506 | if (idimsw) { /* menu is up, take it down */
|
---|
| 507 |
|
---|
| 508 | idimsw = FALSE;
|
---|
| 509 |
|
---|
| 510 | if (v_regs[5] & 0x0180)
|
---|
| 511 | vbank(0);
|
---|
| 512 |
|
---|
| 513 | idbord();
|
---|
| 514 | allwins();
|
---|
| 515 |
|
---|
| 516 | } else { /* menu is down, put it up */
|
---|
| 517 |
|
---|
| 518 | idimsw = TRUE;
|
---|
| 519 | itxput = idtxput;
|
---|
| 520 |
|
---|
| 521 | if (v_regs[5] & 0x0180)
|
---|
| 522 | vbank(0);
|
---|
| 523 |
|
---|
| 524 | vbfill4(instob, 128, 1, 1, 510, 208,
|
---|
| 525 | exp_c(idbox[19][5]));
|
---|
| 526 |
|
---|
| 527 | for (i = 13; i LE 18; i++)
|
---|
| 528 | iclrwin(i);
|
---|
| 529 |
|
---|
| 530 | for (i = 20; i LE 22; i++)
|
---|
| 531 | iclrwin(i);
|
---|
| 532 |
|
---|
| 533 | showim();
|
---|
| 534 | }
|
---|
| 535 |
|
---|
| 536 | return(SUCCESS);
|
---|
| 537 |
|
---|
| 538 | } else {
|
---|
| 539 |
|
---|
| 540 | return(enterit()); /* do data entry */
|
---|
| 541 | }
|
---|
| 542 | /* |
---|
| 543 |
|
---|
| 544 | */
|
---|
| 545 | } else if (hitbox EQ 21) { /* waveshapes */
|
---|
| 546 |
|
---|
| 547 | if ((row EQ 17) AND (col GE 48) AND (col LE 54)) {
|
---|
| 548 |
|
---|
| 549 | wcmenu(1);
|
---|
| 550 | return(TRUE);
|
---|
| 551 |
|
---|
| 552 | } else {
|
---|
| 553 |
|
---|
| 554 | return(enterit());
|
---|
| 555 | }
|
---|
| 556 |
|
---|
| 557 | } else if (hitbox EQ 23) { /* process a hit in the name window */
|
---|
| 558 |
|
---|
| 559 | if (idnamsw) { /* typewriter up - enter data */
|
---|
| 560 |
|
---|
| 561 | vtyper();
|
---|
| 562 | instmod[curvce] = TRUE;
|
---|
| 563 |
|
---|
| 564 | } else { /* put up the typewriter */
|
---|
| 565 |
|
---|
| 566 | /* set data pointer */
|
---|
| 567 |
|
---|
| 568 | if (row EQ 18)
|
---|
| 569 | ivtdptr = ip->idhname;
|
---|
| 570 | else if (row EQ 19)
|
---|
| 571 | ivtdptr = ip->idhcom1;
|
---|
| 572 | else if (row EQ 20)
|
---|
| 573 | ivtdptr = ip->idhcom2;
|
---|
| 574 | else
|
---|
| 575 | ivtdptr = ip->idhcom3;
|
---|
| 576 |
|
---|
| 577 | idtdat = row - 18;
|
---|
| 578 |
|
---|
| 579 | idvtyp(); /* display typewriter */
|
---|
| 580 | dswin(22);
|
---|
| 581 | idnamsw = TRUE;
|
---|
| 582 | submenu = TRUE;
|
---|
| 583 |
|
---|
| 584 | vtsetup(instob, vtdisp, 17, ivtdptr, 22, 17,
|
---|
| 585 | advicur, bspicur, cupicur, cdnicur, endityp,
|
---|
| 586 | idbox[19][4], idbox[19][5]);
|
---|
| 587 | }
|
---|
| 588 |
|
---|
| 589 | return(TRUE);
|
---|
| 590 | /* |
---|
| 591 |
|
---|
| 592 | */
|
---|
| 593 | } else if (hitbox < 12) { /* process a hit in a label window */
|
---|
| 594 |
|
---|
| 595 | pntsv = 0; /* unselect previous point */
|
---|
| 596 |
|
---|
| 597 | arcurs(ID_NCUR); /* set cursor color */
|
---|
| 598 | gcurpos(cxval, cyval);
|
---|
| 599 |
|
---|
| 600 | if (n NE curfunc) { /* new function selected */
|
---|
| 601 |
|
---|
| 602 | if (curfunc NE 12)
|
---|
| 603 | dswin(curfunc); /* stow old function */
|
---|
| 604 |
|
---|
| 605 | edfunc(n); /* select new function */
|
---|
| 606 |
|
---|
| 607 | } else { /* reselect level */
|
---|
| 608 |
|
---|
| 609 | dswin(curfunc); /* stow old function */
|
---|
| 610 | edfunc(12); /* select level */
|
---|
| 611 | }
|
---|
| 612 |
|
---|
| 613 | subj = 0; /* reset function selection */
|
---|
| 614 | pntsel();
|
---|
| 615 |
|
---|
| 616 | showfn(); /* update display */
|
---|
| 617 |
|
---|
| 618 | setgc(ICURX, ICURY); /* put cursor in center */
|
---|
| 619 | return(TRUE);
|
---|
| 620 | }
|
---|
| 621 |
|
---|
| 622 | return(FALSE);
|
---|
| 623 | }
|
---|