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