[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | ldselbx.c -- librarian box selection functions
|
---|
| 4 | Version 46 -- 1988-11-18 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #define DEBUGIT 0
|
---|
| 9 |
|
---|
| 10 | #include "stdio.h"
|
---|
| 11 | #include "stddefs.h"
|
---|
| 12 | #include "fields.h"
|
---|
| 13 | #include "graphdef.h"
|
---|
| 14 | #include "glcfns.h"
|
---|
| 15 | #include "glcdefs.h"
|
---|
| 16 | #include "graphdef.h"
|
---|
| 17 | #include "hwdefs.h"
|
---|
| 18 | #include "lcdline.h"
|
---|
| 19 | #include "panel.h"
|
---|
| 20 | #include "vsdd.h"
|
---|
| 21 | #include "vsddvars.h"
|
---|
| 22 |
|
---|
| 23 | #include "midas.h"
|
---|
| 24 | #include "instdsp.h"
|
---|
| 25 | #include "libdsp.h"
|
---|
| 26 | #include "score.h"
|
---|
| 27 | #include "scdsp.h"
|
---|
| 28 | #include "scfns.h"
|
---|
| 29 |
|
---|
[7258c6a] | 30 | extern void ldswin(int16_t n);
|
---|
[0580615] | 31 | extern void advlcur(void);
|
---|
| 32 | extern void bsplcur(void);
|
---|
[7258c6a] | 33 | extern void ttcpos(int16_t row, int16_t col);
|
---|
| 34 | extern int16_t fcindex(void);
|
---|
| 35 | extern int16_t storit(void);
|
---|
| 36 | extern int16_t showsiz(void);
|
---|
| 37 | extern int16_t get_asg(void);
|
---|
| 38 | extern int16_t get_orc(int16_t lorh, int16_t kind);
|
---|
| 39 | extern int16_t get_tun(void);
|
---|
| 40 | extern int16_t get_wav(void);
|
---|
[60288f5] | 41 | extern void nokey(void);
|
---|
[7258c6a] | 42 | extern int16_t ldline(int16_t cy);
|
---|
| 43 | extern int16_t lin2slt(int16_t line);
|
---|
| 44 | extern void dslslot(int16_t slot, uint16_t fg, int16_t row);
|
---|
| 45 | extern void vtdisp(uint16_t *obj, uint16_t fg, uint16_t bg, int16_t row, int16_t col, int8_t *buf);
|
---|
| 46 | extern void ldpoint(int16_t x, int16_t y, int16_t pen);
|
---|
| 47 | extern int16_t rd_ec(FILE *fp, int8_t *to, int32_t len);
|
---|
[0580615] | 48 | extern void fcreset(void);
|
---|
[7258c6a] | 49 | extern int16_t ftkind(int16_t ns);
|
---|
| 50 | extern void ldwmsg(int8_t *line1, int8_t *line2, int8_t *line3, uint16_t fgcolor, uint16_t bgcolor);
|
---|
| 51 | extern void ldbusy(int8_t *msg);
|
---|
| 52 | extern int16_t ckstor(void);
|
---|
| 53 | extern int16_t get_pat(void);
|
---|
| 54 | extern int16_t get_scr(void);
|
---|
[0580615] | 55 |
|
---|
[7258c6a] | 56 | extern uint16_t exp_c(uint16_t c);
|
---|
[0580615] | 57 |
|
---|
[7258c6a] | 58 | extern int8_t *slotnam(uint16_t slot, uint16_t kind);
|
---|
[f40a309] | 59 |
|
---|
| 60 | /* |
---|
| 61 |
|
---|
| 62 | */
|
---|
| 63 |
|
---|
| 64 | #if DEBUGIT
|
---|
| 65 | extern short debugsw;
|
---|
| 66 | #endif
|
---|
[7258c6a] | 67 |
|
---|
| 68 | extern void (*point)(int16_t x, int16_t y, int16_t pen);
|
---|
| 69 |
|
---|
| 70 | extern int16_t asmode;
|
---|
| 71 | extern int16_t catin;
|
---|
| 72 | extern int16_t cxrate;
|
---|
| 73 | extern int16_t cxval;
|
---|
| 74 | extern int16_t cyrate;
|
---|
| 75 | extern int16_t cyval;
|
---|
| 76 | extern int16_t errno;
|
---|
| 77 | extern int16_t gomode;
|
---|
| 78 | extern int16_t hitcx;
|
---|
| 79 | extern int16_t hitcy;
|
---|
| 80 | extern int16_t ismode;
|
---|
| 81 | extern int16_t lasgsw;
|
---|
| 82 | extern int16_t ldelsw;
|
---|
| 83 | extern int16_t lderrsw;
|
---|
| 84 | extern int16_t ldkind;
|
---|
| 85 | extern int16_t ldrow;
|
---|
| 86 | extern int16_t ldslot;
|
---|
| 87 | extern int16_t lksel;
|
---|
| 88 | extern int16_t lmwtype;
|
---|
| 89 | extern int16_t lorchl;
|
---|
| 90 | extern int16_t lorchsw;
|
---|
| 91 | extern int16_t lorclsw;
|
---|
| 92 | extern int16_t ldpass;
|
---|
| 93 | extern int16_t lpatsw;
|
---|
| 94 | extern int16_t lrasw;
|
---|
| 95 | extern int16_t lscrsw;
|
---|
| 96 | extern int16_t lselsw;
|
---|
| 97 | extern int16_t lseqsw;
|
---|
| 98 | extern int16_t lstrsw;
|
---|
| 99 | extern int16_t ltagged;
|
---|
| 100 | extern int16_t ltunsw;
|
---|
| 101 | extern int16_t lwavsw;
|
---|
| 102 | extern int16_t ndisp;
|
---|
| 103 | extern int16_t oldpk;
|
---|
| 104 | extern int16_t oldsl;
|
---|
| 105 | extern int16_t pkctrl;
|
---|
| 106 | extern int16_t sliders;
|
---|
| 107 | extern int16_t stcrow;
|
---|
| 108 | extern int16_t stccol;
|
---|
| 109 | extern int16_t tagslot;
|
---|
| 110 |
|
---|
| 111 | extern uint16_t *librob;
|
---|
| 112 |
|
---|
| 113 | extern int16_t ldmap[];
|
---|
| 114 | extern int16_t scsizes[][2];
|
---|
| 115 |
|
---|
[f40a309] | 116 | extern int16_t ldbox[][8];
|
---|
| 117 |
|
---|
| 118 | extern struct scndx sindex[];
|
---|
| 119 |
|
---|
| 120 | extern struct selbox *csbp;
|
---|
| 121 | extern struct selbox *curboxp;
|
---|
[60288f5] | 122 |
|
---|
| 123 | extern LPF (*swpt)[];
|
---|
| 124 | extern LPF (*oldsw)[];
|
---|
[f40a309] | 125 | extern LPF t_libr[];
|
---|
[7258c6a] | 126 |
|
---|
| 127 | extern int8_t bfs[];
|
---|
| 128 | extern int8_t ldfile[];
|
---|
[f40a309] | 129 | extern int8_t ldcmnt[];
|
---|
[7258c6a] | 130 |
|
---|
| 131 | extern int8_t loadedf[][8];
|
---|
[f40a309] | 132 | extern int8_t loadedc[][37];
|
---|
| 133 |
|
---|
| 134 | /* forward references */
|
---|
[7258c6a] | 135 |
|
---|
| 136 | int16_t bx_null(void);
|
---|
[f40a309] | 137 | int16_t ldfnbox(int16_t n);
|
---|
| 138 |
|
---|
| 139 | /* |
---|
| 140 |
|
---|
[7258c6a] | 141 | */
|
---|
[f40a309] | 142 |
|
---|
| 143 | int16_t ft2lt[] = { /* file type to load type map */
|
---|
| 144 |
|
---|
| 145 | LT_ASG,
|
---|
| 146 | LT_ORL,
|
---|
| 147 | LT_ORH,
|
---|
| 148 | LT_SCR,
|
---|
| 149 | LT_TUN,
|
---|
| 150 | LT_WAV,
|
---|
| 151 | LT_ORL,
|
---|
| 152 | LT_PAT,
|
---|
| 153 | LT_SEQ
|
---|
| 154 | };
|
---|
| 155 |
|
---|
| 156 | struct selbox ldboxes[] = {
|
---|
| 157 |
|
---|
| 158 | { 1, 1, 510, 13, 0, ldfnbox}, /* 0 - index area label */
|
---|
| 159 | { 1, 14, 510, 293, 1, ldfnbox}, /* 1 - index area */
|
---|
| 160 | { 1, 294, 78, 307, 2, ldfnbox}, /* 2 - file name label */
|
---|
| 161 | { 80, 294, 143, 307, 3, ldfnbox}, /* 3 - file name */
|
---|
| 162 | {145, 294, 214, 307, 4, ldfnbox}, /* 4 - comment label */
|
---|
| 163 | {216, 294, 510, 307, 5, ldfnbox}, /* 5 - comment */
|
---|
| 164 | { 1, 308, 70, 321, 6, ldfnbox}, /* 6 - fetch */
|
---|
| 165 | { 1, 322, 70, 335, 7, ldfnbox}, /* 7 - replace / append */
|
---|
| 166 | { 1, 336, 70, 349, 8, ldfnbox}, /* 8 - lo orch / hi orch */
|
---|
| 167 | { 72, 308, 255, 349, 9, ldfnbox}, /* 9 - store */
|
---|
| 168 | {257, 308, 510, 349, 10, ldfnbox}, /* 10 - message window */
|
---|
| 169 |
|
---|
| 170 | { 0, 0, 0, 0, 0, FN_NULL} /* end of table */
|
---|
| 171 | };
|
---|
| 172 |
|
---|
| 173 | /* |
---|
| 174 |
|
---|
| 175 | */
|
---|
| 176 |
|
---|
| 177 | /*
|
---|
| 178 | =============================================================================
|
---|
| 179 | skperr() -- complain about an error while skipping a score
|
---|
[7258c6a] | 180 | =============================================================================
|
---|
[f40a309] | 181 | */
|
---|
[7258c6a] | 182 |
|
---|
| 183 | void skperr(int16_t sn)
|
---|
[f40a309] | 184 | {
|
---|
| 185 | int8_t scid[32];
|
---|
| 186 | int8_t erms[64];
|
---|
| 187 |
|
---|
| 188 | clrlsel();
|
---|
| 189 |
|
---|
| 190 | sprintf(scid, " score %d", sn + 1);
|
---|
| 191 | sprintf(erms, " errno = %d", errno);
|
---|
| 192 |
|
---|
| 193 | ldermsg("Couldn't skip", scid, erms,
|
---|
| 194 | LD_EMCF, LD_EMCB);
|
---|
| 195 | }
|
---|
| 196 |
|
---|
| 197 | /* |
---|
| 198 |
|
---|
| 199 | */
|
---|
| 200 |
|
---|
| 201 | /*
|
---|
| 202 | =============================================================================
|
---|
[7258c6a] | 203 | skp_ec() -- skip with error checking
|
---|
[f40a309] | 204 | =============================================================================
|
---|
[7258c6a] | 205 | */
|
---|
| 206 |
|
---|
| 207 | int16_t skp_ec(FILE *fp, int32_t len)
|
---|
[f40a309] | 208 | {
|
---|
| 209 | register int32_t count;
|
---|
| 210 | register int16_t c;
|
---|
| 211 | int8_t errbuf[64];
|
---|
| 212 |
|
---|
| 213 | for (count = 0; count < len; count++) {
|
---|
| 214 |
|
---|
| 215 | errno = 0;
|
---|
| 216 |
|
---|
| 217 | if (EOF EQ (c = getc(fp))) {
|
---|
[7258c6a] | 218 |
|
---|
[f40a309] | 219 | sprintf(errbuf, "errno = %d", errno);
|
---|
| 220 |
|
---|
| 221 | ldermsg("Unexpected EOF",
|
---|
| 222 | errbuf, (int8_t *)NULL, LD_EMCF, LD_EMCB);
|
---|
| 223 |
|
---|
| 224 | #if DEBUGIT
|
---|
| 225 | if (debugsw)
|
---|
| 226 | FILEpr(fp);
|
---|
| 227 | #endif
|
---|
| 228 |
|
---|
| 229 | fclose(fp);
|
---|
| 230 | postio(); /* restore LCD backlight */
|
---|
| 231 | return(FAILURE);
|
---|
| 232 | }
|
---|
| 233 | }
|
---|
| 234 |
|
---|
| 235 | return(SUCCESS);
|
---|
| 236 | }
|
---|
| 237 |
|
---|
| 238 | /* |
---|
| 239 |
|
---|
| 240 | */
|
---|
| 241 |
|
---|
| 242 | /*
|
---|
[7258c6a] | 243 | =============================================================================
|
---|
[f40a309] | 244 | scskip() -- skip a score starting with its section list
|
---|
[7258c6a] | 245 | =============================================================================
|
---|
| 246 | */
|
---|
| 247 |
|
---|
[f40a309] | 248 | int16_t scskip(FILE *fp, int16_t ns)
|
---|
| 249 | {
|
---|
| 250 | register int16_t ehdr, go;
|
---|
[7258c6a] | 251 | int8_t etype;
|
---|
[f40a309] | 252 | int8_t erms[64];
|
---|
| 253 |
|
---|
| 254 | go = TRUE;
|
---|
| 255 |
|
---|
| 256 | if (skp_ec(fp, (int32_t)(N_SECTS * 12))) { /* skip section times */
|
---|
| 257 |
|
---|
| 258 | skperr(ns);
|
---|
| 259 | return(FAILURE);
|
---|
| 260 | }
|
---|
| 261 |
|
---|
| 262 | if (rd_ec(fp, &etype, 1L)) { /* read first score header event */
|
---|
| 263 |
|
---|
| 264 | skperr(ns);
|
---|
| 265 | return(FAILURE);
|
---|
| 266 | }
|
---|
| 267 |
|
---|
| 268 | if (etype NE EV_SCORE) { /* complain if it's not a score event */
|
---|
| 269 |
|
---|
| 270 | sprintf(erms, " score %d etype = %d", ns + 1, etype);
|
---|
| 271 |
|
---|
| 272 | ldermsg("Bad score --", " 1st event is wrong",
|
---|
[7258c6a] | 273 | erms, LD_EMCF, LD_EMCB);
|
---|
[f40a309] | 274 |
|
---|
| 275 | return(FAILURE);
|
---|
| 276 | }
|
---|
| 277 |
|
---|
| 278 | if (skp_ec(fp, (int32_t)(scsizes[etype][1] - 1))) { /* skip data */
|
---|
| 279 |
|
---|
| 280 | skperr(ns);
|
---|
| 281 | return(FAILURE);
|
---|
| 282 | }
|
---|
| 283 |
|
---|
| 284 | /* |
---|
| 285 |
|
---|
| 286 | */
|
---|
| 287 | do { /* skip remaining score events */
|
---|
| 288 |
|
---|
| 289 | if (rd_ec(fp, &etype, 1L)) { /* get event type */
|
---|
| 290 |
|
---|
[7258c6a] | 291 | skperr(ns);
|
---|
[f40a309] | 292 | return(FAILURE);
|
---|
| 293 | }
|
---|
| 294 |
|
---|
| 295 | /* skip the event's data */
|
---|
| 296 |
|
---|
| 297 | if (skp_ec(fp, (int32_t)(scsizes[etype][1] - 1))) {
|
---|
| 298 |
|
---|
| 299 | skperr(ns);
|
---|
| 300 | return(FAILURE);
|
---|
| 301 | }
|
---|
| 302 |
|
---|
| 303 | if (etype EQ EV_FINI) /* check for score end */
|
---|
| 304 | go = FALSE;
|
---|
| 305 |
|
---|
| 306 | } while (go);
|
---|
| 307 |
|
---|
| 308 | return(SUCCESS);
|
---|
| 309 | }
|
---|
| 310 |
|
---|
| 311 | /* |
---|
| 312 |
|
---|
| 313 | */
|
---|
[7258c6a] | 314 |
|
---|
[f40a309] | 315 | /*
|
---|
[7258c6a] | 316 | =============================================================================
|
---|
[f40a309] | 317 | ldermsg() -- display an error message if none is up already
|
---|
| 318 | =============================================================================
|
---|
| 319 | */
|
---|
| 320 |
|
---|
| 321 | void ldermsg(int8_t *p1, int8_t *p2, int8_t *p3, uint16_t p4, uint16_t p5)
|
---|
| 322 | {
|
---|
| 323 | int8_t msgbuf[64];
|
---|
| 324 |
|
---|
| 325 | if (NOT lderrsw) { /* put up new messages only */
|
---|
| 326 |
|
---|
| 327 | strcpy(msgbuf, "ERROR: ");
|
---|
| 328 | strcat(msgbuf, p1);
|
---|
| 329 |
|
---|
| 330 | ldwmsg(p1, p2, p3, p4, p5);
|
---|
| 331 | }
|
---|
| 332 |
|
---|
| 333 | lderrsw = TRUE; /* set error state */
|
---|
| 334 | }
|
---|
[0580615] | 335 |
|
---|
[f40a309] | 336 | /*
|
---|
| 337 | =============================================================================
|
---|
| 338 | clrerms() -- clear an error message from the message window
|
---|
| 339 | =============================================================================
|
---|
| 340 | */
|
---|
| 341 |
|
---|
| 342 | void clrerms(void)
|
---|
| 343 | {
|
---|
| 344 | if (lderrsw) {
|
---|
| 345 |
|
---|
| 346 | lderrsw = FALSE;
|
---|
| 347 | lmwclr();
|
---|
| 348 | ldswin(10);
|
---|
| 349 | }
|
---|
| 350 | }
|
---|
| 351 |
|
---|
| 352 | /* |
---|
| 353 |
|
---|
[0580615] | 354 | */
|
---|
[f40a309] | 355 |
|
---|
| 356 | /*
|
---|
| 357 | =============================================================================
|
---|
| 358 | clrlsel() -- clear library selection
|
---|
| 359 | =============================================================================
|
---|
| 360 | */
|
---|
| 361 |
|
---|
| 362 | void clrlsel(void)
|
---|
| 363 | {
|
---|
| 364 | if (lselsw) {
|
---|
| 365 |
|
---|
| 366 | if (lrasw) {
|
---|
| 367 |
|
---|
| 368 | lksel = -1;
|
---|
| 369 | ldpass = 0;
|
---|
| 370 | pkctrl = oldpk;
|
---|
| 371 | sliders = oldsl;
|
---|
| 372 | swpt = oldsw;
|
---|
| 373 | lcdlbls();
|
---|
| 374 | setleds();
|
---|
| 375 | fcindex();
|
---|
| 376 |
|
---|
| 377 | } else {
|
---|
| 378 |
|
---|
| 379 | dslslot(ldslot, exp_c(ldbox[1][4]), ldrow);
|
---|
| 380 | }
|
---|
| 381 | }
|
---|
| 382 |
|
---|
| 383 | fcreset();
|
---|
[0580615] | 384 | }
|
---|
[f40a309] | 385 |
|
---|
| 386 | /*
|
---|
| 387 | =============================================================================
|
---|
| 388 | endltyp() -- end function for virtual typewriter
|
---|
| 389 | =============================================================================
|
---|
| 390 | */
|
---|
| 391 |
|
---|
| 392 | void endltyp(void)
|
---|
| 393 | {
|
---|
| 394 | lmwclr();
|
---|
| 395 | ldswin(10);
|
---|
| 396 | }
|
---|
| 397 |
|
---|
| 398 | /* |
---|
[7258c6a] | 399 |
|
---|
[f40a309] | 400 | */
|
---|
[7258c6a] | 401 |
|
---|
[f40a309] | 402 | /*
|
---|
| 403 | =============================================================================
|
---|
| 404 | savefc() -- save name and comment from loaded or stored file
|
---|
| 405 | =============================================================================
|
---|
| 406 | */
|
---|
| 407 |
|
---|
| 408 | void savefc(int16_t kind)
|
---|
| 409 | {
|
---|
| 410 | int16_t fi;
|
---|
| 411 |
|
---|
| 412 | fi = ft2lt[kind - 1];
|
---|
| 413 |
|
---|
| 414 | if (kind EQ FT_ORC)
|
---|
| 415 | fi = lorchl ? LT_ORH : LT_ORL;
|
---|
| 416 |
|
---|
| 417 | memcpy(loadedf[fi], ldfile, 8);
|
---|
| 418 | memcpy(loadedc[fi], ldcmnt, 37);
|
---|
| 419 | }
|
---|
| 420 |
|
---|
[7258c6a] | 421 | /* |
---|
[f40a309] | 422 |
|
---|
[7258c6a] | 423 | */
|
---|
[f40a309] | 424 |
|
---|
| 425 | /*
|
---|
| 426 | =============================================================================
|
---|
| 427 | lcancel() -- cancel librarian selections
|
---|
| 428 | =============================================================================
|
---|
| 429 | */
|
---|
| 430 |
|
---|
| 431 | int16_t lcancel(int16_t lct)
|
---|
| 432 | {
|
---|
| 433 | int16_t rc;
|
---|
| 434 |
|
---|
| 435 | rc = FALSE;
|
---|
| 436 |
|
---|
| 437 | if ((lct NE 0) AND lselsw) {
|
---|
| 438 |
|
---|
| 439 | rc = TRUE;
|
---|
| 440 | clrlsel();
|
---|
| 441 | }
|
---|
| 442 |
|
---|
| 443 | if ((lct NE 1) AND (lstrsw OR (NOT ckstor()))) {
|
---|
| 444 |
|
---|
| 445 | rc = TRUE;
|
---|
| 446 | streset();
|
---|
| 447 | }
|
---|
| 448 |
|
---|
| 449 | if ((lct NE 2) AND ldelsw) {
|
---|
| 450 |
|
---|
| 451 | rc = TRUE;
|
---|
| 452 | ldelsw = FALSE;
|
---|
| 453 | dslslot(ldslot, exp_c(ldbox[1][4]), ldrow);
|
---|
| 454 | }
|
---|
| 455 |
|
---|
| 456 | return(rc);
|
---|
| 457 | }
|
---|
[7258c6a] | 458 |
|
---|
[f40a309] | 459 | /* |
---|
[7258c6a] | 460 |
|
---|
| 461 | */
|
---|
[f40a309] | 462 |
|
---|
| 463 | /*
|
---|
| 464 | =============================================================================
|
---|
| 465 | dpy_scr() -- display score contents entry
|
---|
| 466 | =============================================================================
|
---|
| 467 | */
|
---|
| 468 |
|
---|
| 469 | void dpy_scr(uint16_t color, int16_t ns)
|
---|
| 470 | {
|
---|
| 471 | int8_t buf[40];
|
---|
| 472 | int32_t scl;
|
---|
| 473 |
|
---|
| 474 | if (ndisp NE 0)
|
---|
| 475 | return;
|
---|
| 476 |
|
---|
| 477 | if (v_regs[5] & 0x0180)
|
---|
| 478 | vbank(0);
|
---|
| 479 |
|
---|
| 480 | if (ldmap[ns] EQ -1)
|
---|
| 481 | strcpy(buf, " ");
|
---|
| 482 | else
|
---|
| 483 | sprintf(buf, "%02d", 1 + ldmap[ns]);
|
---|
| 484 |
|
---|
| 485 | vcputsv(librob, 64, ldbox[1][4], ldbox[1][5], 1 + ns, 1, buf, 14);
|
---|
| 486 |
|
---|
| 487 | if (-1L EQ (scl = sindex[ns].sclen))
|
---|
| 488 | strcpy(buf, "{ empty score } 0");
|
---|
| 489 | else
|
---|
| 490 | sprintf(buf, "%-16.16s %5ld", sindex[ns].scfnm, scl);
|
---|
| 491 |
|
---|
| 492 | vcputsv(librob, 64, color, ldbox[1][5], 1 + ns, 4, buf, 14);
|
---|
[0580615] | 493 | }
|
---|
[f40a309] | 494 |
|
---|
[7258c6a] | 495 | /* |
---|
| 496 |
|
---|
[f40a309] | 497 | */
|
---|
| 498 |
|
---|
| 499 | /*
|
---|
| 500 | =============================================================================
|
---|
| 501 | lst_scr() -- list the score contents directory
|
---|
| 502 | =============================================================================
|
---|
| 503 | */
|
---|
| 504 |
|
---|
| 505 | void lst_scr(void)
|
---|
| 506 | {
|
---|
| 507 | register int16_t i;
|
---|
| 508 | uint16_t cx;
|
---|
| 509 |
|
---|
| 510 | if (ndisp NE 0)
|
---|
| 511 | return;
|
---|
| 512 |
|
---|
| 513 | point = ldpoint;
|
---|
| 514 |
|
---|
| 515 | cx = exp_c(ldbox[0][5]);
|
---|
| 516 |
|
---|
| 517 | if (v_regs[5] & 0x0180)
|
---|
| 518 | vbank(0);
|
---|
| 519 |
|
---|
| 520 | vbfill4(librob, 128, ldbox[0][0], ldbox[0][1],
|
---|
| 521 | ldbox[0][2], ldbox[0][3], cx);
|
---|
| 522 |
|
---|
| 523 | tsplot4(librob, 64, ldbox[0][4], ldbox[0][6], ldbox[0][7],
|
---|
| 524 | "No Score Name Length", 14);
|
---|
| 525 |
|
---|
| 526 | lseg( 8, 13, 23, 13, LUNDRLN);
|
---|
| 527 | lseg( 32, 13, 159, 13, LUNDRLN);
|
---|
| 528 | lseg(168, 13, 215, 13, LUNDRLN);
|
---|
| 529 |
|
---|
| 530 | cx = exp_c(ldbox[1][5]);
|
---|
| 531 |
|
---|
| 532 | vbfill4(librob, 128, ldbox[1][0], ldbox[1][1],
|
---|
| 533 | ldbox[1][2], ldbox[1][3], cx);
|
---|
| 534 |
|
---|
| 535 | for (i = 0; i < N_SCORES; i++)
|
---|
[7258c6a] | 536 | dpy_scr(ldbox[1][4], i);
|
---|
[f40a309] | 537 | }
|
---|
| 538 |
|
---|
[7258c6a] | 539 | /* |
---|
| 540 |
|
---|
| 541 | */
|
---|
| 542 |
|
---|
| 543 | /*
|
---|
[f40a309] | 544 | =============================================================================
|
---|
| 545 | ndx_scr() -- display the table of contents for a score
|
---|
| 546 | =============================================================================
|
---|
| 547 | */
|
---|
| 548 |
|
---|
| 549 | int16_t ndx_scr(int16_t slot)
|
---|
| 550 | {
|
---|
| 551 | register FILE *fp;
|
---|
| 552 | register int16_t i;
|
---|
| 553 | register int32_t rlen;
|
---|
| 554 | int32_t rdlen;
|
---|
| 555 | int8_t msgbuf1[64];
|
---|
| 556 | int8_t msgbuf2[64];
|
---|
| 557 |
|
---|
| 558 | ldpass = 0;
|
---|
| 559 |
|
---|
| 560 | for (i = 0; i < N_SCORES; i++) {
|
---|
| 561 |
|
---|
| 562 | sindex[i].sclen = -1L;
|
---|
| 563 | memset(sindex[i].scfnm, ' ', 16);
|
---|
| 564 | }
|
---|
| 565 |
|
---|
| 566 | errno = 0;
|
---|
| 567 |
|
---|
| 568 | if ((FILE *)NULL EQ (fp = fopenb(slotnam(slot, FT_SCR), "r"))) {
|
---|
| 569 |
|
---|
| 570 | sprintf(msgbuf2, " errno = %d", errno);
|
---|
| 571 |
|
---|
| 572 | ldermsg("Couldn't open the file",
|
---|
| 573 | " for the scores", msgbuf2,
|
---|
[7258c6a] | 574 | LD_EMCF, LD_EMCB);
|
---|
[f40a309] | 575 |
|
---|
| 576 | clrlsel();
|
---|
| 577 | return(FAILURE);
|
---|
| 578 | }
|
---|
| 579 |
|
---|
| 580 | errno = 0;
|
---|
| 581 |
|
---|
| 582 | if (fseek(fp, 60L, 1)) { /* seek past header */
|
---|
| 583 |
|
---|
| 584 | sprintf(msgbuf2, " errno = %d", errno);
|
---|
| 585 |
|
---|
| 586 | ldermsg("Seek failure",
|
---|
| 587 | (int8_t *)NULL, msgbuf2,
|
---|
| 588 | LD_EMCF, LD_EMCB);
|
---|
| 589 |
|
---|
| 590 |
|
---|
| 591 | #if DEBUGIT
|
---|
| 592 | if (debugsw)
|
---|
| 593 | FILEpr(fp);
|
---|
| 594 | #endif
|
---|
| 595 |
|
---|
| 596 | fclose(fp);
|
---|
| 597 | postio(); /* restore LCD backlight */
|
---|
| 598 | clrlsel();
|
---|
| 599 | return(FAILURE);
|
---|
| 600 | }
|
---|
| 601 |
|
---|
| 602 | /* |
---|
| 603 |
|
---|
| 604 | */
|
---|
| 605 | #if DEBUGIT
|
---|
| 606 | if (debugsw)
|
---|
| 607 | FILEpr(fp);
|
---|
| 608 | #endif
|
---|
| 609 |
|
---|
| 610 | for (i = 0; i < N_SCORES; i++) {
|
---|
| 611 |
|
---|
| 612 | if (rd_ec(fp, &rdlen, 4L)) {
|
---|
| 613 |
|
---|
| 614 | sprintf(msgbuf1, " of score %d", i + 1);
|
---|
| 615 | sprintf(msgbuf2, " errno = %d", errno);
|
---|
| 616 |
|
---|
| 617 | ldermsg("Unable to read the length",
|
---|
| 618 | msgbuf1, msgbuf2,
|
---|
| 619 | LD_EMCF, LD_EMCB);
|
---|
| 620 |
|
---|
| 621 |
|
---|
| 622 | #if DEBUGIT
|
---|
| 623 | if (debugsw)
|
---|
| 624 | FILEpr(fp);
|
---|
| 625 | #endif
|
---|
| 626 |
|
---|
| 627 | clrlsel();
|
---|
| 628 | return(FAILURE);
|
---|
| 629 | }
|
---|
| 630 |
|
---|
| 631 | sindex[i].sclen = rdlen;
|
---|
| 632 |
|
---|
| 633 | if (-1L NE rdlen) {
|
---|
| 634 |
|
---|
| 635 | if (rd_ec(fp, sindex[i].scfnm, 16L)) {
|
---|
| 636 |
|
---|
| 637 | sprintf(msgbuf1, " of score %d", i + 1);
|
---|
| 638 | sprintf(msgbuf2, " errno = %d", errno);
|
---|
| 639 |
|
---|
| 640 | ldermsg("Unable to read the name",
|
---|
| 641 | msgbuf1, msgbuf2,
|
---|
| 642 | LD_EMCF, LD_EMCB);
|
---|
| 643 |
|
---|
| 644 |
|
---|
| 645 | #if DEBUGIT
|
---|
| 646 | if (debugsw)
|
---|
| 647 | FILEpr(fp);
|
---|
| 648 | #endif
|
---|
| 649 |
|
---|
| 650 | clrlsel();
|
---|
| 651 | return(FAILURE);
|
---|
| 652 | }
|
---|
| 653 |
|
---|
| 654 | errno = 0;
|
---|
| 655 |
|
---|
| 656 | if (scskip(fp, i)) {
|
---|
| 657 |
|
---|
| 658 | sprintf(msgbuf1, " score %d", i + 1);
|
---|
| 659 | sprintf(msgbuf2, " errno=%d rlen=%ld",
|
---|
| 660 | errno, rlen);
|
---|
| 661 |
|
---|
| 662 | ldermsg("Unable to skip past",
|
---|
| 663 | msgbuf1, msgbuf2,
|
---|
| 664 | LD_EMCF, LD_EMCB);
|
---|
| 665 |
|
---|
| 666 |
|
---|
| 667 | #if DEBUGIT
|
---|
| 668 | if (debugsw)
|
---|
| 669 | FILEpr(fp);
|
---|
| 670 | #endif
|
---|
| 671 |
|
---|
| 672 | fclose(fp);
|
---|
| 673 | postio(); /* restore LCD backlight */
|
---|
| 674 | clrlsel();
|
---|
| 675 | return(FAILURE);
|
---|
| 676 | }
|
---|
| 677 | }
|
---|
| 678 | }
|
---|
| 679 |
|
---|
| 680 | fclose(fp);
|
---|
| 681 | postio(); /* restore LCD backlight */
|
---|
| 682 | ldpass = 1;
|
---|
| 683 | lst_scr();
|
---|
| 684 |
|
---|
| 685 | /* |
---|
| 686 |
|
---|
| 687 | */
|
---|
| 688 | point = GLCplot;
|
---|
| 689 | GLCcurs(G_ON);
|
---|
| 690 |
|
---|
| 691 | if (ismode NE IS_NULL) { /* cancel inst. mode */
|
---|
| 692 |
|
---|
| 693 | ismode = IS_NULL;
|
---|
| 694 | pkctrl = oldpk;
|
---|
| 695 | sliders = oldsl;
|
---|
| 696 | swpt = oldsw;
|
---|
| 697 | lcdlbls();
|
---|
| 698 | }
|
---|
| 699 |
|
---|
| 700 | if (gomode NE GO_NULL) { /* cancel goto mode */
|
---|
| 701 |
|
---|
| 702 | gomode = GO_NULL;
|
---|
| 703 | pkctrl = oldpk;
|
---|
| 704 | lseg(GOTO_XL, GOTO_Y, GOTO_XR, GOTO_Y, 0);
|
---|
| 705 | }
|
---|
| 706 |
|
---|
[6dd74a9] | 707 | if (asmode) { /* cancel assign mode */
|
---|
[f40a309] | 708 |
|
---|
| 709 | asmode = 0;
|
---|
| 710 | pkctrl = oldpk;
|
---|
| 711 | swpt = oldsw;
|
---|
| 712 | lseg(ASGN_XL, ASGN_Y, ASGN_XR, ASGN_Y, 0);
|
---|
| 713 | }
|
---|
| 714 |
|
---|
| 715 | if ((pkctrl EQ PK_PFRM) OR (pkctrl EQ PK_NOTE))
|
---|
| 716 | oldpk = pkctrl;
|
---|
| 717 |
|
---|
| 718 | if (sliders NE LS_LIBR)
|
---|
| 719 | oldsl = sliders;
|
---|
| 720 |
|
---|
| 721 | oldsw = swpt;
|
---|
| 722 | swpt = &t_libr;
|
---|
| 723 | pkctrl = PK_LIBR;
|
---|
| 724 | sliders = LS_LIBR;
|
---|
| 725 |
|
---|
[7258c6a] | 726 | lcdlbls();
|
---|
[f40a309] | 727 | setleds();
|
---|
| 728 |
|
---|
| 729 | return(SUCCESS);
|
---|
| 730 | }
|
---|
| 731 |
|
---|
| 732 | /* |
---|
[7258c6a] | 733 |
|
---|
[f40a309] | 734 | */
|
---|
| 735 |
|
---|
| 736 | /*
|
---|
| 737 | =============================================================================
|
---|
| 738 | getit() -- read selected file
|
---|
| 739 | =============================================================================
|
---|
| 740 | */
|
---|
| 741 |
|
---|
| 742 | int16_t getit(void)
|
---|
| 743 | {
|
---|
| 744 | ldkind = ftkind(ldslot);
|
---|
| 745 |
|
---|
| 746 | if (ldkind EQ -1) {
|
---|
| 747 |
|
---|
| 748 | ldermsg("Unknown file type",
|
---|
| 749 | (int8_t *)NULL, (int8_t *)NULL,
|
---|
| 750 | LD_EMCF, LD_EMCB);
|
---|
| 751 |
|
---|
| 752 | clrlsel();
|
---|
| 753 | return(FAILURE);
|
---|
| 754 | }
|
---|
| 755 |
|
---|
| 756 | ldbusy(" Reading file");
|
---|
| 757 | /* |
---|
| 758 |
|
---|
| 759 | */
|
---|
| 760 | switch (ldkind) {
|
---|
| 761 |
|
---|
| 762 | case FT_ASG:
|
---|
| 763 |
|
---|
| 764 | if (get_asg())
|
---|
| 765 | return(FAILURE);
|
---|
| 766 |
|
---|
| 767 | break;
|
---|
| 768 |
|
---|
| 769 | case FT_ORH:
|
---|
| 770 | case FT_ORL:
|
---|
| 771 | case FT_ORC:
|
---|
| 772 |
|
---|
| 773 | if (get_orc(lorchl, ldkind))
|
---|
| 774 | return(FAILURE);
|
---|
| 775 |
|
---|
| 776 | break;
|
---|
| 777 |
|
---|
| 778 | case FT_PAT:
|
---|
| 779 |
|
---|
| 780 | if (get_pat())
|
---|
| 781 | return(FAILURE);
|
---|
| 782 |
|
---|
| 783 | break;
|
---|
| 784 |
|
---|
| 785 | case FT_SCR:
|
---|
| 786 |
|
---|
| 787 | if (get_scr())
|
---|
| 788 | return(FAILURE);
|
---|
| 789 |
|
---|
| 790 | break;
|
---|
| 791 |
|
---|
| 792 | case FT_SEQ:
|
---|
| 793 |
|
---|
| 794 | if (get_seq())
|
---|
| 795 | return(FAILURE);
|
---|
| 796 |
|
---|
| 797 | break;
|
---|
| 798 |
|
---|
[7258c6a] | 799 | case FT_TUN:
|
---|
[f40a309] | 800 |
|
---|
| 801 | if (get_tun())
|
---|
| 802 | return(FAILURE);
|
---|
| 803 |
|
---|
| 804 | break;
|
---|
| 805 |
|
---|
| 806 | case FT_WAV:
|
---|
| 807 |
|
---|
| 808 | if (get_wav())
|
---|
| 809 | return(FAILURE);
|
---|
| 810 |
|
---|
| 811 | break;
|
---|
| 812 |
|
---|
| 813 | default:
|
---|
| 814 |
|
---|
| 815 | ldermsg("ldkind bad",
|
---|
| 816 | (int8_t *)NULL, (int8_t *)NULL,
|
---|
| 817 | LD_EMCF, LD_EMCB);
|
---|
| 818 |
|
---|
| 819 | clrlsel();
|
---|
| 820 | return(FAILURE);
|
---|
| 821 | }
|
---|
| 822 | /* |
---|
| 823 |
|
---|
| 824 | */
|
---|
| 825 |
|
---|
| 826 | memcpy(ldfile, filecat[ldslot].fcname, 8);
|
---|
| 827 | memcpy(ldcmnt, filecat[ldslot].fccmnt, 37);
|
---|
| 828 | savefc(ldkind);
|
---|
| 829 |
|
---|
| 830 | clrlsel();
|
---|
| 831 |
|
---|
| 832 | if (lrasw) {
|
---|
| 833 |
|
---|
| 834 | ldswin(0);
|
---|
[7258c6a] | 835 | ldswin(8);
|
---|
[f40a309] | 836 | }
|
---|
[7258c6a] | 837 |
|
---|
[f40a309] | 838 | ldswin(3);
|
---|
| 839 | ldswin(5);
|
---|
| 840 | showsiz();
|
---|
| 841 | return(SUCCESS);
|
---|
| 842 | }
|
---|
| 843 |
|
---|
| 844 | /* |
---|
| 845 |
|
---|
| 846 | */
|
---|
| 847 |
|
---|
| 848 | /*
|
---|
| 849 | =============================================================================
|
---|
| 850 | ldfnbox() -- librarian display box hit processor
|
---|
| 851 | =============================================================================
|
---|
| 852 | */
|
---|
| 853 |
|
---|
| 854 | int16_t ldfnbox(int16_t n)
|
---|
| 855 | {
|
---|
| 856 | register int16_t col, i, slot, sn;
|
---|
| 857 |
|
---|
| 858 | col = hitcx >> 3;
|
---|
| 859 |
|
---|
| 860 | if (lderrsw)
|
---|
| 861 | clrerms();
|
---|
| 862 |
|
---|
| 863 | switch (n) {
|
---|
| 864 |
|
---|
| 865 | case 1: /* index area */
|
---|
| 866 |
|
---|
| 867 | if (lcancel(0))
|
---|
| 868 | return(SUCCESS);
|
---|
| 869 |
|
---|
| 870 | if (lselsw) { /* something already selected ? */
|
---|
| 871 |
|
---|
| 872 | if (lrasw) { /* content mode ? */
|
---|
| 873 |
|
---|
| 874 | if (ldkind EQ FT_SCR) { /* score */
|
---|
| 875 |
|
---|
| 876 | sn = ldline(hitcy) - 1;
|
---|
| 877 |
|
---|
| 878 | if (sindex[sn].sclen NE -1L) {
|
---|
| 879 |
|
---|
| 880 | if ((1 + sn) NE ldrow) {
|
---|
| 881 |
|
---|
| 882 | dpy_scr(ldbox[1][4], ldrow - 1);
|
---|
| 883 | ldrow = 1 + sn;
|
---|
| 884 | }
|
---|
| 885 |
|
---|
| 886 | dpy_scr(LD_SELC, sn);
|
---|
| 887 | lksel = sn;
|
---|
| 888 |
|
---|
| 889 | } else {
|
---|
| 890 |
|
---|
| 891 | lksel = -1;
|
---|
| 892 | }
|
---|
| 893 |
|
---|
| 894 | return(SUCCESS);
|
---|
| 895 | }
|
---|
| 896 | }
|
---|
| 897 |
|
---|
| 898 | if (ldrow NE ldline(hitcy)) {
|
---|
| 899 |
|
---|
| 900 | clrlsel();
|
---|
| 901 | return(SUCCESS);
|
---|
| 902 | }
|
---|
| 903 |
|
---|
| 904 | return(getit());
|
---|
| 905 | /* |
---|
| 906 |
|
---|
| 907 | */
|
---|
| 908 | } else { /* nothing selected yet */
|
---|
| 909 |
|
---|
| 910 | if (0 NE (ldrow = ldline(hitcy))) {
|
---|
| 911 |
|
---|
| 912 | if (col EQ 11) {
|
---|
| 913 |
|
---|
| 914 | if (catin AND ltagged) {
|
---|
| 915 |
|
---|
| 916 | slot = lin2slt(ldrow);
|
---|
| 917 |
|
---|
| 918 | if (slot EQ tagslot) {
|
---|
| 919 |
|
---|
| 920 | putcat();
|
---|
| 921 | ltagged = FALSE;
|
---|
| 922 | showcat();
|
---|
| 923 | }
|
---|
| 924 | }
|
---|
| 925 |
|
---|
| 926 | } else {
|
---|
| 927 |
|
---|
| 928 | if (-1 NE (ldslot = lin2slt(ldrow))) {
|
---|
| 929 |
|
---|
| 930 | lselsw = TRUE;
|
---|
| 931 | ldswin(8);
|
---|
| 932 | ldkind = ftkind(ldslot);
|
---|
| 933 |
|
---|
| 934 | for (i = 0; i < N_SCORES; i++)
|
---|
| 935 | ldmap[i] = i;
|
---|
| 936 |
|
---|
| 937 | if (lrasw AND (ldkind EQ FT_SCR))
|
---|
| 938 | return(ndx_scr(ldslot));
|
---|
| 939 |
|
---|
| 940 | dslslot(ldslot, exp_c(LD_SELC), ldrow);
|
---|
| 941 | return(SUCCESS);
|
---|
| 942 | }
|
---|
| 943 | }
|
---|
| 944 | }
|
---|
| 945 |
|
---|
| 946 | clrlsel();
|
---|
| 947 | return(FAILURE);
|
---|
| 948 | }
|
---|
| 949 | /* |
---|
| 950 |
|
---|
| 951 | */
|
---|
| 952 | case 3: /* file name field */
|
---|
| 953 |
|
---|
| 954 | if (lcancel(3))
|
---|
| 955 | return(SUCCESS);
|
---|
| 956 |
|
---|
| 957 | if (lmwtype NE 1) {
|
---|
| 958 |
|
---|
| 959 | lmwvtyp(); /* setup for the typewriter */
|
---|
| 960 | ldswin(10); /* display the typewriter */
|
---|
| 961 |
|
---|
| 962 | vtsetup(librob, vtdisp, 10, ldfile, 22, 33,
|
---|
| 963 | advlcur, bsplcur, nokey, nokey, endltyp,
|
---|
| 964 | ldbox[n][4], ldbox[n][5]);
|
---|
| 965 |
|
---|
| 966 | } else {
|
---|
| 967 |
|
---|
| 968 | vtyper();
|
---|
| 969 | }
|
---|
| 970 |
|
---|
| 971 | return(SUCCESS);
|
---|
| 972 |
|
---|
| 973 | case 5: /* comment field */
|
---|
| 974 |
|
---|
| 975 | if (lcancel(3))
|
---|
| 976 | return(SUCCESS);
|
---|
| 977 |
|
---|
| 978 | if (lmwtype NE 1) {
|
---|
| 979 |
|
---|
| 980 | lmwvtyp(); /* setup for the typewriter */
|
---|
| 981 | ldswin(10); /* display the typewriter */
|
---|
| 982 |
|
---|
| 983 | vtsetup(librob, vtdisp, 27, ldcmnt, 22, 33,
|
---|
| 984 | advlcur, bsplcur, nokey, nokey, endltyp,
|
---|
| 985 | ldbox[n][4], ldbox[n][5]);
|
---|
| 986 |
|
---|
| 987 | } else {
|
---|
| 988 |
|
---|
| 989 | vtyper();
|
---|
| 990 | }
|
---|
| 991 |
|
---|
| 992 | return(SUCCESS);
|
---|
| 993 |
|
---|
| 994 | /* |
---|
| 995 |
|
---|
| 996 | */
|
---|
| 997 |
|
---|
| 998 | case 6: /* "Index" */
|
---|
| 999 |
|
---|
| 1000 | if (lcancel(0))
|
---|
| 1001 | return(SUCCESS);
|
---|
| 1002 |
|
---|
| 1003 | clrlsel();
|
---|
| 1004 | return(fcindex());
|
---|
| 1005 |
|
---|
| 1006 | case 7: /* "Content" */
|
---|
| 1007 |
|
---|
| 1008 | if (lselsw AND lrasw)
|
---|
| 1009 | return(getit());
|
---|
| 1010 |
|
---|
| 1011 | lrasw = NOT lrasw;
|
---|
| 1012 | ldswin(7);
|
---|
| 1013 | return(SUCCESS);
|
---|
| 1014 |
|
---|
| 1015 | case 8: /* "Hi Orch" / "Lo Orch" */
|
---|
| 1016 |
|
---|
| 1017 | lorchl = NOT lorchl;
|
---|
| 1018 | ldswin(8);
|
---|
| 1019 | return(SUCCESS);
|
---|
| 1020 |
|
---|
| 1021 | /* |
---|
| 1022 |
|
---|
| 1023 | */
|
---|
| 1024 | case 9: /* "Store" */
|
---|
| 1025 |
|
---|
| 1026 | if (lcancel(1))
|
---|
| 1027 | return(SUCCESS);
|
---|
| 1028 |
|
---|
| 1029 | if (cyval < 321) {
|
---|
| 1030 |
|
---|
| 1031 | /* row 22: "Store", "Score", or "Hi Orch" */
|
---|
| 1032 |
|
---|
| 1033 | if (cxval < 120) {
|
---|
| 1034 |
|
---|
| 1035 | /* "Store" */
|
---|
| 1036 |
|
---|
| 1037 | if (lstrsw) {
|
---|
| 1038 |
|
---|
| 1039 | storit();
|
---|
| 1040 |
|
---|
| 1041 | } else {
|
---|
| 1042 |
|
---|
| 1043 | lstrsw = TRUE;
|
---|
| 1044 | ldswin(9);
|
---|
| 1045 | }
|
---|
| 1046 |
|
---|
| 1047 | return(SUCCESS);
|
---|
| 1048 |
|
---|
| 1049 | } else if ((cxval > 135) AND (cxval < 176)) {
|
---|
| 1050 |
|
---|
| 1051 | /* "Score" */
|
---|
| 1052 |
|
---|
| 1053 | lscrsw = NOT lscrsw;
|
---|
| 1054 | ldswin(9);
|
---|
| 1055 |
|
---|
| 1056 | if (lstrsw)
|
---|
| 1057 | storit();
|
---|
| 1058 |
|
---|
| 1059 | return(SUCCESS);
|
---|
| 1060 |
|
---|
| 1061 | } else if (cxval > 191) {
|
---|
| 1062 |
|
---|
| 1063 | /* "Hi Orch" */
|
---|
| 1064 |
|
---|
| 1065 | lorchsw = NOT lorchsw;
|
---|
| 1066 | ldswin(9);
|
---|
| 1067 |
|
---|
| 1068 | if (lstrsw)
|
---|
| 1069 | storit();
|
---|
| 1070 |
|
---|
| 1071 | return(SUCCESS);
|
---|
| 1072 | }
|
---|
| 1073 | /* |
---|
| 1074 |
|
---|
| 1075 | */
|
---|
| 1076 | } else if ((cyval > 321) AND (cyval < 335)) {
|
---|
| 1077 |
|
---|
| 1078 | /* row 23: "Waves", "Patch", or "Lo Orch" */
|
---|
| 1079 |
|
---|
| 1080 | if (cxval < 120) { /* "Waves" */
|
---|
| 1081 |
|
---|
| 1082 | lwavsw = NOT lwavsw;
|
---|
| 1083 | ldswin(9);
|
---|
| 1084 |
|
---|
| 1085 | if (lstrsw)
|
---|
| 1086 | storit();
|
---|
| 1087 |
|
---|
| 1088 | return(SUCCESS);
|
---|
| 1089 |
|
---|
| 1090 | } else if ((cxval > 135) AND (cxval < 176)) {
|
---|
| 1091 |
|
---|
| 1092 | /* "Patch" */
|
---|
| 1093 |
|
---|
| 1094 | lpatsw = NOT lpatsw;
|
---|
| 1095 | ldswin(9);
|
---|
| 1096 |
|
---|
| 1097 | if (lstrsw)
|
---|
| 1098 | storit();
|
---|
| 1099 |
|
---|
| 1100 | return(SUCCESS);
|
---|
| 1101 |
|
---|
| 1102 | } else if (cxval > 191) { /* "Lo Orch" */
|
---|
| 1103 |
|
---|
| 1104 | lorclsw = NOT lorclsw;
|
---|
| 1105 | ldswin(9);
|
---|
| 1106 |
|
---|
| 1107 | if (lstrsw)
|
---|
| 1108 | storit();
|
---|
| 1109 |
|
---|
| 1110 | return(SUCCESS);
|
---|
| 1111 | }
|
---|
| 1112 | /* |
---|
| 1113 |
|
---|
| 1114 | */
|
---|
| 1115 | } else if (cyval > 335) {
|
---|
| 1116 |
|
---|
| 1117 | /* row 24: "Assgn", "Seqnc", or "Tunings" */
|
---|
| 1118 |
|
---|
| 1119 | if (cxval < 120) { /* "Assgn" */
|
---|
| 1120 |
|
---|
| 1121 | lasgsw = NOT lasgsw;
|
---|
| 1122 | ldswin(9);
|
---|
| 1123 |
|
---|
| 1124 | if (lstrsw)
|
---|
| 1125 | storit();
|
---|
| 1126 |
|
---|
| 1127 | return(SUCCESS);
|
---|
| 1128 |
|
---|
| 1129 | } else if ((cxval > 135) AND (cxval < 176)) {
|
---|
| 1130 |
|
---|
| 1131 | /* "Seqnc" */
|
---|
| 1132 |
|
---|
| 1133 | lseqsw = NOT lseqsw;
|
---|
| 1134 | ldswin(9);
|
---|
| 1135 |
|
---|
| 1136 | if (lstrsw)
|
---|
| 1137 | storit();
|
---|
| 1138 |
|
---|
| 1139 | return(SUCCESS);
|
---|
| 1140 |
|
---|
| 1141 | } else if (cxval > 191) { /* "Tunings" */
|
---|
| 1142 |
|
---|
| 1143 | ltunsw = NOT ltunsw;
|
---|
| 1144 | ldswin(9);
|
---|
| 1145 |
|
---|
| 1146 | if (lstrsw)
|
---|
| 1147 | storit();
|
---|
| 1148 |
|
---|
| 1149 | return(SUCCESS);
|
---|
| 1150 | }
|
---|
| 1151 | }
|
---|
| 1152 |
|
---|
| 1153 | return(FAILURE);
|
---|
| 1154 |
|
---|
| 1155 | default:
|
---|
| 1156 |
|
---|
| 1157 | lcancel(3);
|
---|
| 1158 | return(FAILURE);
|
---|
| 1159 | }
|
---|
| 1160 | }
|
---|