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