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