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