| 1 | /*
|
|---|
| 2 | =============================================================================
|
|---|
| 3 | ldfield.c -- librarian display field processing and cursor motion
|
|---|
| 4 | Version 47 -- 1989-11-15 -- D.N. Lynx Crowe
|
|---|
| 5 | =============================================================================
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #define DEBUGIT 0
|
|---|
| 9 |
|
|---|
| 10 | #include "stddefs.h"
|
|---|
| 11 | #include "fields.h"
|
|---|
| 12 | #include "vsdd.h"
|
|---|
| 13 | #include "graphdef.h"
|
|---|
| 14 | #include "charset.h"
|
|---|
| 15 | #include "panel.h"
|
|---|
| 16 | #include "hwdefs.h"
|
|---|
| 17 | #include "fpu.h"
|
|---|
| 18 | #include "curpak.h"
|
|---|
| 19 |
|
|---|
| 20 | #include "midas.h"
|
|---|
| 21 | #include "instdsp.h"
|
|---|
| 22 | #include "libdsp.h"
|
|---|
| 23 | #include "score.h"
|
|---|
| 24 |
|
|---|
| 25 | #include "vsddsw.h"
|
|---|
| 26 |
|
|---|
| 27 | extern void select(void);
|
|---|
| 28 | extern int16_t whatbox(void);
|
|---|
| 29 | extern void nokey(void);
|
|---|
| 30 | extern int16_t nonf(int16_t k);
|
|---|
| 31 | extern void cxkstd(void);
|
|---|
| 32 | extern void cykstd(void);
|
|---|
| 33 | extern void stdmkey(void);
|
|---|
| 34 | extern int16_t et_null(int16_t n);
|
|---|
| 35 | extern int16_t ef_null(int16_t n);
|
|---|
| 36 | extern int16_t rd_null(int16_t n);
|
|---|
| 37 | extern int16_t nd_null(int16_t n, int16_t k);
|
|---|
| 38 | extern void lmwclr(void);
|
|---|
| 39 | extern int16_t ftkind(int16_t ns);
|
|---|
| 40 | extern void _clsvol(void);
|
|---|
| 41 | extern int16_t lcancel(int16_t lct);
|
|---|
| 42 | extern int16_t stdctp0(void);
|
|---|
| 43 | extern int16_t ldline(int16_t cy);
|
|---|
| 44 | extern int16_t lin2slt(int16_t line);
|
|---|
| 45 | extern void dslslot(int16_t slot, uint16_t fg, int16_t row);
|
|---|
| 46 | extern int16_t putcat(void);
|
|---|
| 47 | extern int16_t showcat(void);
|
|---|
| 48 | extern int16_t showsiz(void);
|
|---|
| 49 |
|
|---|
| 50 | extern uint16_t exp_c(uint16_t c);
|
|---|
| 51 |
|
|---|
| 52 | extern void *memset(void *vp, int8_t c, int16_t n);
|
|---|
| 53 | extern int8_t *slotnam(uint16_t slot, uint16_t kind);
|
|---|
| 54 |
|
|---|
| 55 | /* |
|---|
| 56 |
|
|---|
| 57 | */
|
|---|
| 58 |
|
|---|
| 59 | #if DEBUGIT
|
|---|
| 60 | extern short debugsw;
|
|---|
| 61 | #endif
|
|---|
| 62 |
|
|---|
| 63 | extern int16_t astat;
|
|---|
| 64 | extern int16_t catin;
|
|---|
| 65 | extern int16_t cmfirst;
|
|---|
| 66 | extern int16_t cxrate;
|
|---|
| 67 | extern int16_t cxval;
|
|---|
| 68 | extern int16_t cyrate;
|
|---|
| 69 | extern int16_t cyval;
|
|---|
| 70 | extern int16_t ldelsw;
|
|---|
| 71 | extern int16_t lderrsw;
|
|---|
| 72 | extern int16_t ldkind;
|
|---|
| 73 | extern int16_t ldpass;
|
|---|
| 74 | extern int16_t ldrow;
|
|---|
| 75 | extern int16_t ldslot;
|
|---|
| 76 | extern int16_t lmwtype;
|
|---|
| 77 | extern int16_t loadrow;
|
|---|
| 78 | extern int16_t loadsw;
|
|---|
| 79 | extern int16_t lorchl;
|
|---|
| 80 | extern int16_t lrasw;
|
|---|
| 81 | extern int16_t lselsw;
|
|---|
| 82 | extern int16_t ltagged;
|
|---|
| 83 | extern int16_t ndisp;
|
|---|
| 84 | extern int16_t oldltag;
|
|---|
| 85 | extern int16_t oldpk;
|
|---|
| 86 | extern int16_t oldsl;
|
|---|
| 87 | extern int16_t pkctrl;
|
|---|
| 88 | extern int16_t sliders;
|
|---|
| 89 | extern int16_t stcrow;
|
|---|
| 90 | extern int16_t stccol;
|
|---|
| 91 | extern int16_t submenu;
|
|---|
| 92 | extern int16_t tagslot;
|
|---|
| 93 | extern int16_t thcwval;
|
|---|
| 94 | extern int16_t tvcwval;
|
|---|
| 95 |
|
|---|
| 96 | extern uint16_t *librob;
|
|---|
| 97 |
|
|---|
| 98 | extern int8_t bfs[];
|
|---|
| 99 | extern int8_t ldfile[];
|
|---|
| 100 | extern int8_t ldcmnt[];
|
|---|
| 101 |
|
|---|
| 102 | extern int16_t crate1[];
|
|---|
| 103 | extern int16_t ldmap[];
|
|---|
| 104 |
|
|---|
| 105 | extern LPF (*swpt)[];
|
|---|
| 106 | extern LPF (*oldsw)[];
|
|---|
| 107 |
|
|---|
| 108 | extern struct selbox *csbp;
|
|---|
| 109 | extern struct selbox ldboxes[];
|
|---|
| 110 |
|
|---|
| 111 | /* forward reference */
|
|---|
| 112 |
|
|---|
| 113 | void ld_prmv(void);
|
|---|
| 114 | void ldxkey(void);
|
|---|
| 115 | void ldmkey(void);
|
|---|
| 116 | void ldkey(int16_t k);
|
|---|
| 117 | void ldcxupd(void);
|
|---|
| 118 | void ldcyupd(void);
|
|---|
| 119 |
|
|---|
| 120 | extern int16_t getcat(int16_t msgsw);
|
|---|
| 121 | extern int16_t getit(void);
|
|---|
| 122 | extern int16_t ocslot(int16_t slot);
|
|---|
| 123 | extern int16_t unlink(int8_t *name);
|
|---|
| 124 | extern void clrerms(void);
|
|---|
| 125 | extern void curset(struct curpak *s);
|
|---|
| 126 | extern void dpy_scr(uint16_t color, int16_t ns);
|
|---|
| 127 | extern void lcdlbls(void);
|
|---|
| 128 | extern void ldswin(int16_t n);
|
|---|
| 129 | extern void m7menu(void);
|
|---|
| 130 | extern void setleds(void);
|
|---|
| 131 | extern void vtcxupd(void);
|
|---|
| 132 | extern void vtcyupd(void);
|
|---|
| 133 |
|
|---|
| 134 | /* |
|---|
| 135 |
|
|---|
| 136 | */
|
|---|
| 137 |
|
|---|
| 138 | struct fet ld_fet1[] = {
|
|---|
| 139 |
|
|---|
| 140 | {21, 10, 17, 0x0000, et_null, ef_null, rd_null, nd_null}, /* name */
|
|---|
| 141 | {21, 27, 63, 0x0000, et_null, ef_null, rd_null, nd_null}, /* comment */
|
|---|
| 142 |
|
|---|
| 143 | { 0, 0, 0, 0x0000, FN_NULL, FN_NULL, FN_NULL, FN_NULL}
|
|---|
| 144 | };
|
|---|
| 145 |
|
|---|
| 146 | int16_t ldbox[][8] = { /* display box parameters */
|
|---|
| 147 |
|
|---|
| 148 | { 1, 1, 510, 13, LCFBX00, LCBBX00, 0, 1}, /* 0 - index area label */
|
|---|
| 149 | { 1, 14, 510, 292, LCFBX01, LCBBX01, 1, 1}, /* 1 - index area */
|
|---|
| 150 | { 1, 294, 78, 307, LCFBX02, LCBBX02, 21, 1}, /* 2 - file name label */
|
|---|
| 151 | { 80, 294, 143, 307, LCFBX03, LCBBX03, 21, 10}, /* 3 - file name */
|
|---|
| 152 | {145, 294, 214, 307, LCFBX04, LCBBX04, 21, 19}, /* 4 - comment label */
|
|---|
| 153 | {216, 294, 510, 307, LCFBX05, LCBBX05, 21, 27}, /* 5 - comment */
|
|---|
| 154 | { 1, 309, 70, 321, LCFBX06, LCBBX06, 22, 1}, /* 6 - fetch */
|
|---|
| 155 | { 1, 322, 70, 335, LCFBX07, LCBBX07, 23, 1}, /* 7 - replace / append */
|
|---|
| 156 | { 1, 336, 70, 348, LCFBX08, LCBBX08, 24, 1}, /* 8 - lo orch / hi orch */
|
|---|
| 157 | { 72, 309, 255, 348, LCFBX09, LCBBX09, 22, 10}, /* 9 - store */
|
|---|
| 158 | {257, 309, 510, 348, LCFBX10, LCBBX10, 22, 33} /* 10 - message window */
|
|---|
| 159 | };
|
|---|
| 160 |
|
|---|
| 161 | int8_t *ldbxlb0[] = { /* display box labels */
|
|---|
| 162 |
|
|---|
| 163 | "RecrdType L FileName Comment Mem", /* 0 */
|
|---|
| 164 | "", /* 1 */
|
|---|
| 165 | "FileName", /* 2 */
|
|---|
| 166 | "", /* 3 */
|
|---|
| 167 | "Comment", /* 4 */
|
|---|
| 168 | "", /* 5 */
|
|---|
| 169 | "Index", /* 6 */
|
|---|
| 170 | "", /* 7 */
|
|---|
| 171 | "", /* 8 */
|
|---|
| 172 | "", /* 9 */
|
|---|
| 173 | "" /* 10 */
|
|---|
| 174 | };
|
|---|
| 175 |
|
|---|
| 176 | /* |
|---|
| 177 |
|
|---|
| 178 | */
|
|---|
| 179 |
|
|---|
| 180 | struct curpak ld_flds = {
|
|---|
| 181 |
|
|---|
| 182 | stdctp0, /* curtype */
|
|---|
| 183 | ld_prmv, /* premove */
|
|---|
| 184 | nokey, /* pstmove */
|
|---|
| 185 | cxkstd, /* cx_key */
|
|---|
| 186 | cykstd, /* cy_key */
|
|---|
| 187 | ldcxupd, /* cx_upd */
|
|---|
| 188 | ldcyupd, /* cy_upd */
|
|---|
| 189 | nokey, /* xy_up */
|
|---|
| 190 | nokey, /* xy_dn */
|
|---|
| 191 | ldxkey, /* x_key */
|
|---|
| 192 | select, /* e_key */
|
|---|
| 193 | ldmkey, /* m_key */
|
|---|
| 194 | ldkey, /* d_key */
|
|---|
| 195 | nonf, /* not_fld */
|
|---|
| 196 | ld_fet1, /* curfet */
|
|---|
| 197 | ldboxes, /* csbp */
|
|---|
| 198 | crate1, /* cratex */
|
|---|
| 199 | crate1, /* cratey */
|
|---|
| 200 | CT_TEXT, /* cmtype */
|
|---|
| 201 | LCURX, /* cxval */
|
|---|
| 202 | LCURY /* cyval */
|
|---|
| 203 | };
|
|---|
| 204 |
|
|---|
| 205 | /* |
|---|
| 206 |
|
|---|
| 207 | */
|
|---|
| 208 |
|
|---|
| 209 | /*
|
|---|
| 210 | =============================================================================
|
|---|
| 211 | ldxkey() -- handle the 'X' (delete) key
|
|---|
| 212 | =============================================================================
|
|---|
| 213 | */
|
|---|
| 214 |
|
|---|
| 215 | void ldxkey(void)
|
|---|
| 216 | {
|
|---|
| 217 | register int8_t *fn;
|
|---|
| 218 | register int16_t slot;
|
|---|
| 219 | int8_t buf[4];
|
|---|
| 220 |
|
|---|
| 221 | if (NOT astat) /* only on key closure */
|
|---|
| 222 | return; /* FAILURE */
|
|---|
| 223 |
|
|---|
| 224 | clrerms();
|
|---|
| 225 | stcrow = cyval / 14;
|
|---|
| 226 | stccol = cxval >> 3;
|
|---|
| 227 |
|
|---|
| 228 | if (lselsw AND lrasw) {
|
|---|
| 229 |
|
|---|
| 230 | if (0 NE (slot = ldline(cyval))) {
|
|---|
| 231 |
|
|---|
| 232 | slot -= 1;
|
|---|
| 233 | ldmap[slot] = -1;
|
|---|
| 234 | dpy_scr(ldbox[1][4], slot);
|
|---|
| 235 | return; /* SUCCESS */
|
|---|
| 236 |
|
|---|
| 237 | } else
|
|---|
| 238 | return; /* FAILURE */
|
|---|
| 239 | }
|
|---|
| 240 |
|
|---|
| 241 | if (lcancel(2))
|
|---|
| 242 | return; /* SUCCESS */
|
|---|
| 243 |
|
|---|
| 244 | if (NOT ldelsw) { /* deletion not yet selected ? */
|
|---|
| 245 |
|
|---|
| 246 | if (0 NE (ldrow = ldline(cyval))) { /* index area ? */
|
|---|
| 247 |
|
|---|
| 248 | if (stccol EQ 11) { /* load tag ? */
|
|---|
| 249 |
|
|---|
| 250 | if (-1 EQ (slot = lin2slt(stcrow)))
|
|---|
| 251 | return; /* FAILURE */
|
|---|
| 252 |
|
|---|
| 253 | if (ltagged) {
|
|---|
| 254 |
|
|---|
| 255 | if (slot NE tagslot) {
|
|---|
| 256 |
|
|---|
| 257 | filecat[tagslot].fcp0 = oldltag;
|
|---|
| 258 | ltagged = FALSE;
|
|---|
| 259 | showcat();
|
|---|
| 260 | return; /* FAILURE */
|
|---|
| 261 | }
|
|---|
| 262 |
|
|---|
| 263 | putcat();
|
|---|
| 264 | ltagged = FALSE;
|
|---|
| 265 | showcat();
|
|---|
| 266 |
|
|---|
| 267 | } else {
|
|---|
| 268 |
|
|---|
| 269 | oldltag = filecat[slot].fcp0;
|
|---|
| 270 | filecat[slot].fcp0 = ' ';
|
|---|
| 271 | ltagged = TRUE;
|
|---|
| 272 | tagslot = slot;
|
|---|
| 273 |
|
|---|
| 274 | buf[0] = oldltag;
|
|---|
| 275 | buf[1] = '\0';
|
|---|
| 276 |
|
|---|
| 277 | if (v_regs[5] & 0x0180)
|
|---|
| 278 | vbank(0);
|
|---|
| 279 |
|
|---|
| 280 | vcputsv(librob, 64, exp_c(LD_DELC), ldbox[1][5],
|
|---|
| 281 | stcrow, 11, buf, 14);
|
|---|
| 282 | }
|
|---|
| 283 |
|
|---|
| 284 | return; /* SUCCESS */
|
|---|
| 285 | }
|
|---|
| 286 |
|
|---|
| 287 | if ((stccol < 13) OR (stccol > 20)) /* name ? */
|
|---|
| 288 | return; /* FAILURE */
|
|---|
| 289 |
|
|---|
| 290 | if (-1 NE (ldslot = lin2slt(ldrow))) {
|
|---|
| 291 |
|
|---|
| 292 | /* select file to delete */
|
|---|
| 293 |
|
|---|
| 294 | dslslot(ldslot, exp_c(LD_DELC), ldrow);
|
|---|
| 295 | ldelsw = TRUE;
|
|---|
| 296 | return; /* SUCCESS */
|
|---|
| 297 | }
|
|---|
| 298 | /* |
|---|
| 299 |
|
|---|
| 300 | */
|
|---|
| 301 | } else { /* not in the index area */
|
|---|
| 302 |
|
|---|
| 303 | if (21 EQ stcrow) { /* filename or comment ? */
|
|---|
| 304 |
|
|---|
| 305 | if ((stccol GE 10) AND (stccol LE 17)) {
|
|---|
| 306 |
|
|---|
| 307 | /* clear filename field */
|
|---|
| 308 |
|
|---|
| 309 | memset(ldfile, ' ', 8);
|
|---|
| 310 | ldswin(3);
|
|---|
| 311 | return; /* SUCCESS */
|
|---|
| 312 |
|
|---|
| 313 | } else if (stccol GE 27) {
|
|---|
| 314 |
|
|---|
| 315 | /* clear comment field */
|
|---|
| 316 |
|
|---|
| 317 | memset(ldcmnt, ' ', 37);
|
|---|
| 318 | ldswin(5);
|
|---|
| 319 | return; /* SUCCESS */
|
|---|
| 320 | }
|
|---|
| 321 | }
|
|---|
| 322 |
|
|---|
| 323 | return; /* FAILURE */
|
|---|
| 324 | }
|
|---|
| 325 |
|
|---|
| 326 | /* |
|---|
| 327 |
|
|---|
| 328 | */
|
|---|
| 329 |
|
|---|
| 330 | } else { /* file selected for deletion */
|
|---|
| 331 |
|
|---|
| 332 | /* delete the file if cursor hasn't moved */
|
|---|
| 333 |
|
|---|
| 334 | if (ldrow EQ ldline(cyval)) {
|
|---|
| 335 |
|
|---|
| 336 | filecat[ldslot].fcsize[0] = 0;
|
|---|
| 337 | fn = slotnam(ldslot, ftkind(ldslot));
|
|---|
| 338 |
|
|---|
| 339 | unlink(fn);
|
|---|
| 340 |
|
|---|
| 341 | ldelsw = FALSE;
|
|---|
| 342 | putcat();
|
|---|
| 343 |
|
|---|
| 344 | _clsvol();
|
|---|
| 345 | showcat();
|
|---|
| 346 | showsiz();
|
|---|
| 347 |
|
|---|
| 348 | return; /* SUCCESS */
|
|---|
| 349 | }
|
|---|
| 350 |
|
|---|
| 351 | ldelsw = FALSE;
|
|---|
| 352 | showcat();
|
|---|
| 353 | return; /* SUCCESS */
|
|---|
| 354 | }
|
|---|
| 355 | }
|
|---|
| 356 |
|
|---|
| 357 | /* |
|---|
| 358 |
|
|---|
| 359 | */
|
|---|
| 360 |
|
|---|
| 361 | /*
|
|---|
| 362 | =============================================================================
|
|---|
| 363 | ld_prmv() -- librarian cursor pre-move function
|
|---|
| 364 | =============================================================================
|
|---|
| 365 | */
|
|---|
| 366 |
|
|---|
| 367 | void ld_prmv(void)
|
|---|
| 368 | {
|
|---|
| 369 | if (lderrsw) /* clear any error messages in the window */
|
|---|
| 370 | clrerms();
|
|---|
| 371 |
|
|---|
| 372 | if (ltagged) { /* clear any non-stored load tag */
|
|---|
| 373 |
|
|---|
| 374 | filecat[tagslot].fcp0 = oldltag;
|
|---|
| 375 | ltagged = FALSE;
|
|---|
| 376 | showcat();
|
|---|
| 377 | }
|
|---|
| 378 | }
|
|---|
| 379 |
|
|---|
| 380 | /* |
|---|
| 381 |
|
|---|
| 382 | */
|
|---|
| 383 |
|
|---|
| 384 | /*
|
|---|
| 385 | =============================================================================
|
|---|
| 386 | ldcyupd() -- update cursor y location
|
|---|
| 387 | =============================================================================
|
|---|
| 388 | */
|
|---|
| 389 |
|
|---|
| 390 | void ldcyupd(void)
|
|---|
| 391 | {
|
|---|
| 392 | if (lmwtype EQ 1) {
|
|---|
| 393 |
|
|---|
| 394 | vtcyupd(); /* update virtual typewriter cursor y */
|
|---|
| 395 |
|
|---|
| 396 | } else {
|
|---|
| 397 |
|
|---|
| 398 | cyval += cyrate;
|
|---|
| 399 |
|
|---|
| 400 | if (cyval GT (CYMAX - 1))
|
|---|
| 401 | cyval = CYMAX - 1;
|
|---|
| 402 | else if (cyval LT 1)
|
|---|
| 403 | cyval = 1;
|
|---|
| 404 | }
|
|---|
| 405 | }
|
|---|
| 406 |
|
|---|
| 407 | /* |
|---|
| 408 |
|
|---|
| 409 | */
|
|---|
| 410 |
|
|---|
| 411 | /*
|
|---|
| 412 | =============================================================================
|
|---|
| 413 | ldcxupd() -- update cursor x location
|
|---|
| 414 | =============================================================================
|
|---|
| 415 | */
|
|---|
| 416 |
|
|---|
| 417 | void ldcxupd(void)
|
|---|
| 418 | {
|
|---|
| 419 | if (lmwtype EQ 1 ) {
|
|---|
| 420 |
|
|---|
| 421 | vtcxupd(); /* update virtual typewriter cursor x */
|
|---|
| 422 |
|
|---|
| 423 | } else {
|
|---|
| 424 |
|
|---|
| 425 | cxval += cxrate;
|
|---|
| 426 |
|
|---|
| 427 | if (cxval GT (CXMAX - 1))
|
|---|
| 428 | cxval = CXMAX - 1;
|
|---|
| 429 | else if (cxval LT 1)
|
|---|
| 430 | cxval = 1;
|
|---|
| 431 | }
|
|---|
| 432 | }
|
|---|
| 433 |
|
|---|
| 434 | /* |
|---|
| 435 |
|
|---|
| 436 | */
|
|---|
| 437 |
|
|---|
| 438 | /*
|
|---|
| 439 | =============================================================================
|
|---|
| 440 | ldmkey() -- librarian menu key processor
|
|---|
| 441 | =============================================================================
|
|---|
| 442 | */
|
|---|
| 443 |
|
|---|
| 444 | void ldmkey(void)
|
|---|
| 445 | {
|
|---|
| 446 | if (astat) {
|
|---|
| 447 |
|
|---|
| 448 | ltagged = FALSE;
|
|---|
| 449 |
|
|---|
| 450 | if ((sliders EQ LS_LIBR) OR (pkctrl EQ PK_LIBR)) {
|
|---|
| 451 |
|
|---|
| 452 | sliders = oldsl;
|
|---|
| 453 | swpt = oldsw;
|
|---|
| 454 | pkctrl = oldpk;
|
|---|
| 455 | lcdlbls();
|
|---|
| 456 | setleds();
|
|---|
| 457 | }
|
|---|
| 458 | }
|
|---|
| 459 |
|
|---|
| 460 | stdmkey();
|
|---|
| 461 | }
|
|---|
| 462 |
|
|---|
| 463 | /* |
|---|
| 464 |
|
|---|
| 465 | */
|
|---|
| 466 |
|
|---|
| 467 | /*
|
|---|
| 468 | =============================================================================
|
|---|
| 469 | loadem() -- load multiple files
|
|---|
| 470 | =============================================================================
|
|---|
| 471 | */
|
|---|
| 472 |
|
|---|
| 473 | void loadem(int16_t key)
|
|---|
| 474 | {
|
|---|
| 475 | register int16_t c, i, rc, slot;
|
|---|
| 476 |
|
|---|
| 477 | rc = FALSE;
|
|---|
| 478 |
|
|---|
| 479 | if (getcat(0)) /* get the file catalog */
|
|---|
| 480 | return;
|
|---|
| 481 |
|
|---|
| 482 | for (ldslot = 0; ldslot < 20; ldslot++) { /* check each slot */
|
|---|
| 483 |
|
|---|
| 484 | if (ocslot(ldslot) AND
|
|---|
| 485 | ((c = filecat[ldslot].fcp0) & 0x007F) EQ (key & 0x007F)) {
|
|---|
| 486 |
|
|---|
| 487 | ldkind = ftkind(ldslot);
|
|---|
| 488 |
|
|---|
| 489 | if ((ldkind EQ FT_ORC) OR
|
|---|
| 490 | (ldkind EQ FT_ORL) OR
|
|---|
| 491 | (ldkind EQ FT_ORH))
|
|---|
| 492 | lorchl = (c & 0x0080) ? 1 : 0;
|
|---|
| 493 |
|
|---|
| 494 | if (ldkind EQ FT_SCR)
|
|---|
| 495 | for (i = 0; i < N_SCORES; i++)
|
|---|
| 496 | ldmap[i] = i;
|
|---|
| 497 |
|
|---|
| 498 | if(getit())
|
|---|
| 499 | return;
|
|---|
| 500 |
|
|---|
| 501 | rc = TRUE;
|
|---|
| 502 | }
|
|---|
| 503 | }
|
|---|
| 504 |
|
|---|
| 505 | if (rc AND (ndisp EQ -1))
|
|---|
| 506 | m7menu();
|
|---|
| 507 | }
|
|---|
| 508 |
|
|---|
| 509 | /* |
|---|
| 510 |
|
|---|
| 511 | */
|
|---|
| 512 |
|
|---|
| 513 | /*
|
|---|
| 514 | =============================================================================
|
|---|
| 515 | ldkey() -- process data key entry
|
|---|
| 516 | =============================================================================
|
|---|
| 517 | */
|
|---|
| 518 |
|
|---|
| 519 | void ldkey(int16_t k)
|
|---|
| 520 | {
|
|---|
| 521 | register int16_t c, col, row, slot;
|
|---|
| 522 | int8_t buf[4];
|
|---|
| 523 |
|
|---|
| 524 | if (NOT astat) /* only on key closure */
|
|---|
| 525 | return;
|
|---|
| 526 |
|
|---|
| 527 | if (NOT catin) /* catalog must be valid */
|
|---|
| 528 | return;
|
|---|
| 529 |
|
|---|
| 530 | row = cyval / 14; /* determine cursor position */
|
|---|
| 531 | col = cxval >> 3;
|
|---|
| 532 |
|
|---|
| 533 | if (col NE 11) /* must be column 11 */
|
|---|
| 534 | return;
|
|---|
| 535 |
|
|---|
| 536 | if (-1 EQ (slot = lin2slt(row))) /* ... and a valid slot */
|
|---|
| 537 | return;
|
|---|
| 538 |
|
|---|
| 539 | if (NOT ltagged) {
|
|---|
| 540 |
|
|---|
| 541 | oldltag = filecat[slot].fcp0; /* save old tag */
|
|---|
| 542 | lcancel(3); /* cancel other selections */
|
|---|
| 543 | }
|
|---|
| 544 |
|
|---|
| 545 | /* |
|---|
| 546 |
|
|---|
| 547 | */
|
|---|
| 548 | /* process the key */
|
|---|
| 549 |
|
|---|
| 550 | if (k < 7)
|
|---|
| 551 | filecat[slot].fcp0 = (c = k + 'A');
|
|---|
| 552 | else if (k EQ 7)
|
|---|
| 553 | return;
|
|---|
| 554 | else if (k EQ 8)
|
|---|
| 555 | filecat[slot].fcp0 = (c = filecat[slot].fcp0 & 0x007F);
|
|---|
| 556 | else /* k EQ 9 */
|
|---|
| 557 | filecat[slot].fcp0 = (c = filecat[slot].fcp0 | 0x0080);
|
|---|
| 558 |
|
|---|
| 559 | loadrow = row;
|
|---|
| 560 | tagslot = slot;
|
|---|
| 561 | ltagged = TRUE;
|
|---|
| 562 |
|
|---|
| 563 | dslslot(slot, exp_c(LD_SELC), row);
|
|---|
| 564 | return;
|
|---|
| 565 | }
|
|---|
| 566 |
|
|---|
| 567 | /* |
|---|
| 568 |
|
|---|
| 569 | */
|
|---|
| 570 |
|
|---|
| 571 | /*
|
|---|
| 572 | =============================================================================
|
|---|
| 573 | ldfield() -- setup field routines for the librarian
|
|---|
| 574 | =============================================================================
|
|---|
| 575 | */
|
|---|
| 576 |
|
|---|
| 577 | void ldfield(void)
|
|---|
| 578 | {
|
|---|
| 579 | lmwtype = 0;
|
|---|
| 580 | ltagged = FALSE;
|
|---|
| 581 | submenu = FALSE;
|
|---|
| 582 |
|
|---|
| 583 | curset(&ld_flds);
|
|---|
| 584 | }
|
|---|