[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | smscrl.c -- MIDAS-VII smooth scrolling functions
|
---|
| 4 | Version 37 -- 1989-11-16 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #define OLDSCRL 0
|
---|
| 9 |
|
---|
[b28a12e] | 10 | #include "ram.h"
|
---|
[e225e77] | 11 |
|
---|
[f40a309] | 12 | #define SS_NSL 16 /* number of scrolled lines */
|
---|
| 13 | #define SS_TOP (2 * (SS_NSL + 1)) /* total line count */
|
---|
| 14 | #define SS_LIM (SS_TOP - SS_NSL) /* top line limit */
|
---|
| 15 | #define SS_LEN 48 /* length of a scrolled line */
|
---|
| 16 | #define NSCANS 14 /* number of scan lines */
|
---|
| 17 | #define TOPSCAN (NSCANS - 1) /* top scan line */
|
---|
| 18 |
|
---|
[7258c6a] | 19 | int8_t TheBuf[66]; /* display build buffer */
|
---|
[f40a309] | 20 |
|
---|
[7258c6a] | 21 | int8_t *(*BakLine)(void); /* next line backward function pointer */
|
---|
| 22 | int8_t *(*FwdLine)(void); /* next line forward function pointer */
|
---|
[f40a309] | 23 |
|
---|
[7258c6a] | 24 | int16_t PdScDnF; /* scroll down flag */
|
---|
| 25 | int16_t PdScUpF; /* scroll up flag */
|
---|
[f40a309] | 26 |
|
---|
[7258c6a] | 27 | int16_t CurLine; /* top line being displayed */
|
---|
| 28 | int16_t CurScan; /* current scan line */
|
---|
| 29 | int16_t DupLine; /* write pointer for other page */
|
---|
| 30 | int16_t ScrlObj; /* object descriptor table index */
|
---|
[f40a309] | 31 |
|
---|
[7258c6a] | 32 | int8_t *LinePtr; /* line to scroll onto screen */
|
---|
[f40a309] | 33 |
|
---|
[7258c6a] | 34 | uint16_t LineAtr; /* attribute for the new line */
|
---|
[f40a309] | 35 |
|
---|
[7258c6a] | 36 | uint16_t *LineBuf; /* current display memory pointer */
|
---|
| 37 | uint16_t *OldLine; /* old display memory pointer */
|
---|
| 38 | uint16_t *ScObAdr; /* display memory base pointer */
|
---|
[f40a309] | 39 |
|
---|
[7258c6a] | 40 | int16_t LineCon = SS_LEN * 3; /* line offset constant */
|
---|
| 41 | int16_t LineLen = SS_LEN; /* length of a scrolled line */
|
---|
| 42 | int16_t SmScLim = SS_LIM; /* top line limit */
|
---|
| 43 | int16_t SmScNsl = SS_NSL; /* number of scrolled lines */
|
---|
| 44 | int16_t SmScTop = SS_TOP; /* total line count */
|
---|
[f40a309] | 45 |
|
---|
| 46 | /* |
---|
| 47 |
|
---|
| 48 | */
|
---|
| 49 |
|
---|
| 50 | /*
|
---|
| 51 | =============================================================================
|
---|
| 52 | LineFwd() -- return the next patch line in the forward direction
|
---|
| 53 | =============================================================================
|
---|
| 54 | */
|
---|
[7258c6a] | 55 |
|
---|
[f40a309] | 56 | int8_t *LineFwd(void)
|
---|
[7258c6a] | 57 | {
|
---|
[f40a309] | 58 | register int16_t j, k;
|
---|
| 59 |
|
---|
| 60 | for (j = 0; j < 48; j++)
|
---|
| 61 | TheBuf[j] = ' ';
|
---|
| 62 |
|
---|
| 63 | TheBuf[0] = '\260';
|
---|
| 64 | TheBuf[48] = '\0';
|
---|
| 65 |
|
---|
[7258c6a] | 66 | if (0 EQ ptecpos)
|
---|
[f40a309] | 67 | return((int8_t *)NULL);
|
---|
| 68 |
|
---|
[7258c6a] | 69 | if (0 EQ (j = findnxt(ptecpos)))
|
---|
[f40a309] | 70 | return((int8_t *)NULL);
|
---|
| 71 |
|
---|
| 72 | ptecpos = j;
|
---|
| 73 |
|
---|
| 74 | memcpyw(&ptebuf.defnum, &patches[ptecpos].defnum, 6);
|
---|
| 75 | pteset = TRUE;
|
---|
| 76 | pte2buf();
|
---|
| 77 |
|
---|
| 78 | k = ptecpos;
|
---|
| 79 |
|
---|
| 80 | for (j = 0; j < 8; j++)
|
---|
| 81 | if (0 EQ (k = findnxt(k)))
|
---|
| 82 | return(TheBuf);
|
---|
| 83 |
|
---|
| 84 | dspdfst(&TheBuf[ 2], patches[k].defnum);
|
---|
| 85 | dspdfst(&TheBuf[15], patches[k].stmnum);
|
---|
| 86 | dspdest(&TheBuf[28], &patches[k]);
|
---|
| 87 |
|
---|
| 88 | for (j = 0; j < 50; j++)
|
---|
| 89 | if(TheBuf[j] EQ '\0')
|
---|
| 90 | TheBuf[j] = ' ';
|
---|
| 91 |
|
---|
| 92 | TheBuf[48] = '\0';
|
---|
| 93 | return(TheBuf);
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | /* |
---|
| 97 |
|
---|
| 98 | */
|
---|
| 99 |
|
---|
| 100 | /*
|
---|
| 101 | =============================================================================
|
---|
| 102 | LineBak() -- return the next patch line in the backward direction
|
---|
| 103 | =============================================================================
|
---|
[7258c6a] | 104 | */
|
---|
[f40a309] | 105 |
|
---|
[7258c6a] | 106 | int8_t *LineBak(void)
|
---|
[f40a309] | 107 | {
|
---|
| 108 | register int16_t j, k;
|
---|
| 109 |
|
---|
| 110 | for (j = 0; j < 48; j++)
|
---|
| 111 | TheBuf[j] = ' ';
|
---|
| 112 |
|
---|
| 113 | TheBuf[0] = '\260';
|
---|
| 114 | TheBuf[48] = '\0';
|
---|
[7258c6a] | 115 |
|
---|
[f40a309] | 116 | if (0 EQ ptecpos)
|
---|
| 117 | return((int8_t *)NULL);
|
---|
[7258c6a] | 118 |
|
---|
[f40a309] | 119 | if (0 EQ (j = findprv(ptecpos)))
|
---|
| 120 | return((int8_t *)NULL);
|
---|
| 121 |
|
---|
| 122 | ptecpos = j;
|
---|
| 123 |
|
---|
| 124 | memcpyw(&ptebuf.defnum, &patches[ptecpos].defnum, 6);
|
---|
| 125 | pteset = TRUE;
|
---|
| 126 | pte2buf();
|
---|
| 127 |
|
---|
| 128 | k = ptecpos;
|
---|
| 129 |
|
---|
| 130 | for (j = 0; j < 7; j++)
|
---|
| 131 | if (0 EQ (k = findprv(k)))
|
---|
| 132 | return(TheBuf);
|
---|
| 133 |
|
---|
| 134 | dspdfst(&TheBuf[ 2], patches[k].defnum);
|
---|
| 135 | dspdfst(&TheBuf[15], patches[k].stmnum);
|
---|
| 136 | dspdest(&TheBuf[28], &patches[k]);
|
---|
| 137 |
|
---|
| 138 | for (j = 0; j < 50; j++)
|
---|
| 139 | if(TheBuf[j] EQ '\0')
|
---|
| 140 | TheBuf[j] = ' ';
|
---|
| 141 |
|
---|
| 142 | TheBuf[48] = '\0';
|
---|
| 143 | return(TheBuf);
|
---|
| 144 | }
|
---|
| 145 |
|
---|
| 146 | /* |
---|
| 147 |
|
---|
| 148 | */
|
---|
| 149 |
|
---|
| 150 | /*
|
---|
| 151 | =============================================================================
|
---|
| 152 | WrVideo() -- write a line to the video display
|
---|
[7258c6a] | 153 | =============================================================================
|
---|
[f40a309] | 154 | */
|
---|
[7258c6a] | 155 |
|
---|
[f40a309] | 156 | void WrVideo(int16_t row, int16_t col, int8_t *str, uint16_t atr)
|
---|
| 157 | {
|
---|
| 158 | register int8_t chr;
|
---|
| 159 |
|
---|
| 160 | if (v_regs[5] & 0x0180)
|
---|
| 161 | vbank(0);
|
---|
| 162 |
|
---|
| 163 | while ('\0' NE (chr = *str++)) {
|
---|
| 164 |
|
---|
| 165 | vputcv(ScObAdr, row, col, chr,
|
---|
| 166 | (col EQ 0) ? PTBATR : atr, LineLen);
|
---|
| 167 |
|
---|
| 168 | col++;
|
---|
| 169 | }
|
---|
| 170 | }
|
---|
| 171 |
|
---|
| 172 | /* |
---|
| 173 |
|
---|
| 174 | */
|
---|
| 175 |
|
---|
| 176 | /*
|
---|
| 177 | =============================================================================
|
---|
[7258c6a] | 178 | SetDTop() -- set the top line of the display
|
---|
[f40a309] | 179 | =============================================================================
|
---|
| 180 | */
|
---|
| 181 |
|
---|
| 182 | void SetDTop(int16_t row, int16_t scan)
|
---|
[7258c6a] | 183 | {
|
---|
[f40a309] | 184 | if (v_regs[5] & 0x0180)
|
---|
| 185 | vbank(0);
|
---|
[7258c6a] | 186 |
|
---|
[f40a309] | 187 | LineBuf = (uint16_t *)((int8_t *)ScObAdr + (row * LineCon));
|
---|
| 188 |
|
---|
| 189 | if (OldLine NE LineBuf)
|
---|
| 190 | v_odtab[ScrlObj][2] = ((int32_t)LineBuf >> 1) & 0xFFFF;
|
---|
| 191 |
|
---|
| 192 | OldLine = LineBuf;
|
---|
| 193 |
|
---|
| 194 | v_odtab[ScrlObj][0] = (v_odtab[ScrlObj][0] & 0x0FFF) | (scan << 12);
|
---|
| 195 | }
|
---|
| 196 |
|
---|
| 197 | /* |
---|
| 198 |
|
---|
| 199 | */
|
---|
| 200 |
|
---|
| 201 | /*
|
---|
[7258c6a] | 202 | =============================================================================
|
---|
[f40a309] | 203 | UpdVid() -- update the video display on both pages
|
---|
| 204 | =============================================================================
|
---|
| 205 | */
|
---|
| 206 |
|
---|
| 207 | void UpdVid(int16_t row, int16_t col, int8_t *str, uint16_t atr)
|
---|
| 208 | {
|
---|
| 209 | WrVideo(CurLine + row, col, str, atr);
|
---|
| 210 |
|
---|
| 211 | DupLine = CurLine + SmScNsl + 2 + row;
|
---|
| 212 |
|
---|
| 213 | if (DupLine < SmScTop)
|
---|
| 214 | WrVideo(DupLine, col, str, PTPATR);
|
---|
| 215 |
|
---|
| 216 | DupLine = CurLine - SmScNsl - 2 + row;
|
---|
| 217 |
|
---|
| 218 | if (DupLine GE 0)
|
---|
| 219 | WrVideo(DupLine, col, str, PTPATR);
|
---|
| 220 | }
|
---|
| 221 |
|
---|
| 222 | /* |
---|
| 223 |
|
---|
| 224 | */
|
---|
| 225 |
|
---|
[0580615] | 226 | /*
|
---|
[f40a309] | 227 | =============================================================================
|
---|
[7258c6a] | 228 | bgncm() -- begin patch display cursor motion
|
---|
[f40a309] | 229 | =============================================================================
|
---|
| 230 | */
|
---|
| 231 |
|
---|
| 232 | void bgncm(void)
|
---|
| 233 | {
|
---|
| 234 | register int16_t j;
|
---|
| 235 |
|
---|
| 236 | memcpyw(&ptebuf.defnum, &patches[ptecpos].defnum, 6);
|
---|
| 237 | pteset = TRUE;
|
---|
| 238 | pte2buf();
|
---|
| 239 |
|
---|
| 240 | memcpy(TheBuf, ptdebuf, 48);
|
---|
| 241 |
|
---|
| 242 | for (j = 0; j < 50; j++)
|
---|
| 243 | if(TheBuf[j] EQ '\0')
|
---|
| 244 | TheBuf[j] = ' ';
|
---|
| 245 |
|
---|
| 246 | TheBuf[0] = '\260';
|
---|
| 247 | TheBuf[1] = ' ';
|
---|
| 248 | TheBuf[48] = '\0';
|
---|
| 249 |
|
---|
| 250 | UpdVid(7, 0, TheBuf, PTPATR);
|
---|
| 251 | ctcoff();
|
---|
| 252 | }
|
---|
| 253 |
|
---|
| 254 | /* |
---|
| 255 |
|
---|
| 256 | */
|
---|
[0580615] | 257 |
|
---|
[f40a309] | 258 | /*
|
---|
[7258c6a] | 259 | =============================================================================
|
---|
[f40a309] | 260 | stopcm() -- stop patch display cursor motion
|
---|
| 261 | =============================================================================
|
---|
| 262 | */
|
---|
| 263 |
|
---|
| 264 | void stopcm(void)
|
---|
| 265 | {
|
---|
| 266 | register int16_t i;
|
---|
| 267 |
|
---|
| 268 | if (PdScDnF)
|
---|
| 269 | SetDTop(CurLine, CurScan = TOPSCAN);
|
---|
| 270 | else if (PdScUpF)
|
---|
| 271 | SetDTop(++CurLine, CurScan = TOPSCAN);
|
---|
| 272 |
|
---|
| 273 | if (NOT ctcsw) { /* if we scrolled ... */
|
---|
| 274 |
|
---|
| 275 | if (ptecpos) { /* if something is there ... */
|
---|
| 276 |
|
---|
| 277 | /* refresh editing variables */
|
---|
| 278 |
|
---|
| 279 | memcpyw(&ptebuf.defnum, &patches[ptecpos].defnum, 6);
|
---|
| 280 | pteset = TRUE;
|
---|
| 281 | pte2buf();
|
---|
| 282 | setptcv();
|
---|
| 283 |
|
---|
| 284 | } else { /* ... nothing there */
|
---|
| 285 |
|
---|
| 286 | voidpb(); /* void the patch buffer */
|
---|
| 287 | }
|
---|
| 288 | }
|
---|
| 289 |
|
---|
| 290 | ctcon(); /* re-enable cursor */
|
---|
| 291 |
|
---|
| 292 | PdScDnF = FALSE; /* turn off the scrolling flags */
|
---|
| 293 | PdScUpF = FALSE;
|
---|
| 294 | }
|
---|
| 295 |
|
---|
| 296 | /* |
---|
| 297 |
|
---|
[0580615] | 298 | */
|
---|
[f40a309] | 299 |
|
---|
[7258c6a] | 300 | /*
|
---|
[f40a309] | 301 | =============================================================================
|
---|
| 302 | stopsm() -- stop sequence display cursor motion
|
---|
| 303 | =============================================================================
|
---|
| 304 | */
|
---|
| 305 |
|
---|
| 306 | void stopsm(void)
|
---|
| 307 | {
|
---|
| 308 | register int16_t i;
|
---|
| 309 |
|
---|
| 310 | if (PdScDnF)
|
---|
| 311 | SetDTop(CurLine, CurScan = TOPSCAN);
|
---|
| 312 | else if (PdScUpF)
|
---|
| 313 | SetDTop(++CurLine, CurScan = TOPSCAN);
|
---|
| 314 |
|
---|
| 315 | memcpyw(&seqbuf, &seqtab[curslin], NSEQW);
|
---|
| 316 | dsqlin(sqdebuf, curslin);
|
---|
| 317 | sqdeflg = TRUE;
|
---|
| 318 | ctcon();
|
---|
| 319 |
|
---|
| 320 | PdScDnF = FALSE;
|
---|
| 321 | PdScUpF = FALSE;
|
---|
| 322 | }
|
---|
| 323 |
|
---|
| 324 | /* |
---|
[0580615] | 325 |
|
---|
[f40a309] | 326 | */
|
---|
| 327 |
|
---|
| 328 | /*
|
---|
| 329 | =============================================================================
|
---|
| 330 | smscrl() -- smooth scroll the text display up or down
|
---|
[7258c6a] | 331 | =============================================================================
|
---|
[f40a309] | 332 | */
|
---|
| 333 |
|
---|
| 334 | void smscrl(void)
|
---|
| 335 | {
|
---|
| 336 | if (PdScUpF) { /* SCROLL UP (toward NEW data) ? */
|
---|
| 337 |
|
---|
| 338 | if (CurScan EQ TOPSCAN) { /* ready for a new line ? */
|
---|
| 339 |
|
---|
| 340 | if ((int8_t *)NULL NE (LinePtr = (*FwdLine)())) { /* get a line */
|
---|
| 341 |
|
---|
| 342 | if (CurLine EQ SmScLim) { /* *** swap display pages *** */
|
---|
| 343 |
|
---|
| 344 | /* update page we're going to */
|
---|
| 345 |
|
---|
| 346 | WrVideo(SmScNsl, 0, LinePtr, LineAtr);
|
---|
| 347 |
|
---|
| 348 | /* point at new page */
|
---|
| 349 |
|
---|
| 350 | SetDTop(CurLine = 0, CurScan = TOPSCAN);
|
---|
| 351 |
|
---|
| 352 | } else { /* *** stay on this page *** */
|
---|
| 353 |
|
---|
| 354 | /* update scroll target line */
|
---|
| 355 |
|
---|
| 356 | WrVideo(CurLine + SmScNsl, 0, LinePtr, LineAtr);
|
---|
| 357 |
|
---|
| 358 | /* update other page if it's in range */
|
---|
| 359 |
|
---|
| 360 | DupLine = CurLine - 2;
|
---|
| 361 |
|
---|
| 362 | if (DupLine GE 0)
|
---|
| 363 | WrVideo(DupLine, 0, LinePtr, LineAtr);
|
---|
| 364 | }
|
---|
| 365 |
|
---|
| 366 | /* do first scroll up of new line */
|
---|
| 367 |
|
---|
| 368 | SetDTop(CurLine, --CurScan);
|
---|
| 369 | }
|
---|
| 370 |
|
---|
| 371 | } else { /* scrolling -- scroll some more */
|
---|
| 372 |
|
---|
| 373 | if (CurScan EQ 0)
|
---|
| 374 | SetDTop(++CurLine, CurScan = TOPSCAN);
|
---|
[7258c6a] | 375 | else
|
---|
[f40a309] | 376 | SetDTop(CurLine, --CurScan);
|
---|
| 377 | }
|
---|
| 378 | /* |
---|
| 379 |
|
---|
| 380 | */
|
---|
| 381 | } else if (PdScDnF) { /* SCROLL DOWN (toward old data) ? */
|
---|
| 382 |
|
---|
| 383 | if (CurScan EQ TOPSCAN) { /* ready for a new line ? */
|
---|
| 384 |
|
---|
| 385 | if ((int8_t *)NULL NE (LinePtr = (*BakLine)())) { /* get a line */
|
---|
| 386 |
|
---|
| 387 | if (CurLine EQ 0) { /* *** swap display pages *** */
|
---|
| 388 |
|
---|
| 389 | /* update page we're going to */
|
---|
| 390 |
|
---|
| 391 | WrVideo(SmScLim - 1, 0, LinePtr, LineAtr);
|
---|
| 392 |
|
---|
| 393 | /* point at new page */
|
---|
| 394 |
|
---|
| 395 | SetDTop(CurLine = SmScLim - 1, CurScan = 0);
|
---|
| 396 |
|
---|
| 397 | } else { /* *** stay on this page *** */
|
---|
| 398 |
|
---|
| 399 | /* update scroll target line */
|
---|
| 400 |
|
---|
| 401 | WrVideo(CurLine - 1, 0, LinePtr, LineAtr);
|
---|
| 402 |
|
---|
| 403 | /* update other page if it's in range */
|
---|
| 404 |
|
---|
| 405 | DupLine = CurLine + SmScNsl + 1;
|
---|
| 406 |
|
---|
| 407 | if (DupLine < SmScTop)
|
---|
| 408 | WrVideo(DupLine, 0, LinePtr, LineAtr);
|
---|
| 409 |
|
---|
| 410 | /* do first scroll down of new line */
|
---|
| 411 |
|
---|
| 412 | SetDTop(--CurLine, CurScan = 0);
|
---|
| 413 | }
|
---|
| 414 | }
|
---|
| 415 |
|
---|
| 416 | } else { /* scrolling -- scroll some more */
|
---|
| 417 |
|
---|
| 418 | if (CurScan NE TOPSCAN)
|
---|
| 419 | SetDTop(CurLine, ++CurScan);
|
---|
| 420 | }
|
---|
| 421 | }
|
---|
| 422 | }
|
---|
[0580615] | 423 |
|
---|
[f40a309] | 424 | /* |
---|
[7258c6a] | 425 |
|
---|
[f40a309] | 426 | */
|
---|
| 427 |
|
---|
| 428 | /*
|
---|
| 429 | =============================================================================
|
---|
| 430 | smxupd() -- patch / sequence smooth scroll X axis update
|
---|
| 431 | =============================================================================
|
---|
| 432 | */
|
---|
| 433 |
|
---|
| 434 | void smxupd(void)
|
---|
| 435 | {
|
---|
| 436 | int16_t oldcx;
|
---|
| 437 |
|
---|
| 438 | oldcx = cxval;
|
---|
| 439 |
|
---|
| 440 | if (submenu) {
|
---|
| 441 |
|
---|
| 442 | vtccol = XTOC(vtxval += cxrate);
|
---|
| 443 |
|
---|
| 444 | if (vtccol > 60)
|
---|
| 445 | vtxval = CTOX(vtccol = 60);
|
---|
| 446 | else if (vtccol < 2)
|
---|
| 447 | vtxval = CTOX(vtccol = 2);
|
---|
| 448 |
|
---|
| 449 | } else {
|
---|
| 450 |
|
---|
| 451 | cxval += cxrate;
|
---|
| 452 |
|
---|
| 453 | if (cxval > CTOX(48))
|
---|
| 454 | cxval = CTOX(48);
|
---|
| 455 | else if (cxval < CTOX(2))
|
---|
| 456 | cxval = CTOX(2);
|
---|
| 457 |
|
---|
| 458 | if (cxval EQ oldcx)
|
---|
| 459 | return;
|
---|
| 460 |
|
---|
| 461 | if (47 EQ XTOC(cxval)) {
|
---|
| 462 |
|
---|
| 463 | if (v_regs[5] & 0x0180)
|
---|
| 464 | vbank(0);
|
---|
| 465 |
|
---|
| 466 | vvputsv(obj10, 16, PDBORFG, PDSEQBG,
|
---|
| 467 | 7, 0, "\260", 14, 14, cg3);
|
---|
| 468 |
|
---|
| 469 | vsplot4(obj10, 16, PDPTRFG,
|
---|
| 470 | 7, 0, "\274", 14, 14, cg3);
|
---|
| 471 |
|
---|
| 472 | } else if (48 EQ XTOC(cxval)) {
|
---|
[9519422] | 473 |
|
---|
[f40a309] | 474 | if (v_regs[5] & 0x0180)
|
---|
| 475 | vbank(0);
|
---|
| 476 |
|
---|
| 477 | vvputsv(obj10, 16, PDBORFG, PDSEQBG,
|
---|
| 478 | 7, 0, "\260", 14, 14, cg3);
|
---|
| 479 |
|
---|
| 480 | vsplot4(obj10, 16, PDPTRFG,
|
---|
| 481 | 7, 0, "\277", 14, 14, cg3);
|
---|
| 482 |
|
---|
| 483 | }
|
---|
| 484 |
|
---|
| 485 | return;
|
---|
| 486 | }
|
---|
[7258c6a] | 487 | }
|
---|
[f40a309] | 488 |
|
---|
| 489 | /* |
---|
| 490 |
|
---|
| 491 | */
|
---|
| 492 |
|
---|
| 493 | /*
|
---|
| 494 | =============================================================================
|
---|
| 495 | smy_up() -- patch display smooth scrolling
|
---|
| 496 | =============================================================================
|
---|
| 497 | */
|
---|
| 498 |
|
---|
| 499 | void smy_up(int16_t tag)
|
---|
| 500 | {
|
---|
| 501 |
|
---|
| 502 | if (0 EQ ptecpos) { /* see if anything is there */
|
---|
| 503 |
|
---|
| 504 | dptw(); /* try to find something ... */
|
---|
| 505 | return; /* ... may scroll next time */
|
---|
| 506 | }
|
---|
| 507 |
|
---|
| 508 | if (ctcsw) /* if we haven't scrolled yet ... */
|
---|
| 509 | bgncm(); /* ... setup for scrolling */
|
---|
| 510 |
|
---|
| 511 | if (tag < 0) { /* scroll up */
|
---|
| 512 |
|
---|
| 513 | if (0 EQ findnxt(ptecpos))
|
---|
| 514 | return;
|
---|
| 515 |
|
---|
| 516 | PdScUpF = TRUE;
|
---|
| 517 | PdScDnF = FALSE;
|
---|
| 518 | smscrl();
|
---|
| 519 |
|
---|
| 520 | } else if (tag > 0) { /* scroll down */
|
---|
| 521 |
|
---|
| 522 | if (0 EQ findprv(ptecpos))
|
---|
| 523 | return;
|
---|
| 524 |
|
---|
| 525 | PdScDnF = TRUE;
|
---|
| 526 | PdScUpF = FALSE;
|
---|
| 527 | smscrl();
|
---|
[0580615] | 528 | }
|
---|
[f40a309] | 529 | }
|
---|
| 530 |
|
---|
| 531 | /* |
---|
| 532 |
|
---|
| 533 | */
|
---|
| 534 |
|
---|
| 535 | /*
|
---|
| 536 | =============================================================================
|
---|
| 537 | smyupd() -- patch display smooth scroll Y axis update
|
---|
| 538 | =============================================================================
|
---|
| 539 | */
|
---|
| 540 |
|
---|
| 541 | void smyupd(void)
|
---|
| 542 | {
|
---|
| 543 | if (submenu) {
|
---|
| 544 |
|
---|
| 545 | vtcrow = YTOR(vtyval += cyrate);
|
---|
| 546 |
|
---|
| 547 | if (vtcrow > 23)
|
---|
| 548 | vtyval = RTOY(vtcrow = 23);
|
---|
| 549 | else if (vtcrow < 19)
|
---|
| 550 | vtyval = RTOY(vtcrow = 19);
|
---|
| 551 |
|
---|
| 552 | }
|
---|
| 553 |
|
---|
| 554 | #if OLDSCRL
|
---|
[7258c6a] | 555 | smy_up(cyrate);
|
---|
[f40a309] | 556 | #endif
|
---|
| 557 | }
|
---|
| 558 |
|
---|
| 559 | /* |
---|
| 560 |
|
---|
| 561 | */
|
---|
| 562 |
|
---|
| 563 | /*
|
---|
| 564 | =============================================================================
|
---|
| 565 | sqy_up() -- sequence smooth scrolling
|
---|
| 566 | =============================================================================
|
---|
| 567 | */
|
---|
| 568 |
|
---|
| 569 | void sqy_up(int16_t tag)
|
---|
| 570 | {
|
---|
| 571 | if (ctcsw)
|
---|
| 572 | ctcoff();
|
---|
| 573 |
|
---|
| 574 | if (tag < 0) { /* scroll up */
|
---|
| 575 |
|
---|
| 576 | PdScUpF = TRUE;
|
---|
| 577 | PdScDnF = FALSE;
|
---|
| 578 | smscrl();
|
---|
| 579 |
|
---|
| 580 | } else if (tag > 0) { /* scroll down */
|
---|
| 581 |
|
---|
| 582 | PdScDnF = TRUE;
|
---|
[0580615] | 583 | PdScUpF = FALSE;
|
---|
[f40a309] | 584 | smscrl();
|
---|
| 585 | }
|
---|
| 586 | }
|
---|
| 587 |
|
---|
| 588 | /* |
---|
| 589 |
|
---|
| 590 | */
|
---|
| 591 |
|
---|
| 592 | /*
|
---|
| 593 | =============================================================================
|
---|
| 594 | sqyupd() -- sequence smooth scroll Y axis update
|
---|
| 595 | =============================================================================
|
---|
| 596 | */
|
---|
| 597 |
|
---|
| 598 | void sqyupd(void)
|
---|
| 599 | {
|
---|
[6262b5c] | 600 | if (submenu) {
|
---|
| 601 |
|
---|
| 602 | vtcrow = YTOR(vtyval += cyrate);
|
---|
| 603 |
|
---|
| 604 | if (vtcrow > 23)
|
---|
| 605 | vtyval = RTOY(vtcrow = 23);
|
---|
| 606 | else if (vtcrow < 19)
|
---|
| 607 | vtyval = RTOY(vtcrow = 19);
|
---|
| 608 |
|
---|
| 609 | }
|
---|
| 610 |
|
---|
| 611 | #if OLDSCRL
|
---|
| 612 | sqy_up(cyrate);
|
---|
| 613 | #endif
|
---|
| 614 | }
|
---|
| 615 |
|
---|