home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / asm_programming / VERTSCR.ZIP / VERTSCR.NFO < prev    next >
Text File  |  1993-07-24  |  5KB  |  127 lines

  1.  
  2.  
  3. COMMENTS:
  4.        
  5.        A cute little credits type verticle scroll (or pan, if you like..)
  6.  
  7.              Written by Draeden /VLA - 7-25-93
  8.  
  9.  
  10. INCLUDED MAY BE ONE OR MORE OF THE FOLLOWING:
  11.  
  12.     VSCR2.EXE
  13.     VSCR2.ASM       <- Scrolly with small text
  14.     VSCR3.EXE
  15.     VSCR3.ASM       <- Scrolly w/ 4x as big text
  16.     VSCR4.EXE
  17.     VSCR4.ASM       <- Scrolly w/o shading
  18.     MODEX.INC       <- My modeX routines/ macros
  19.   MXFONT2.INC       <- Cheap and simple modeX text routines
  20.  
  21.   And possibly some more stuff... depending on where you got it..
  22.  
  23.     Alright.. been a while since our last tutorial code/text, but I think 
  24. this simple ditty is worth the wait.  I decided to write a verticle scrolly
  25. 2 days ago at 10pm and got it looking good around 11:30...  Today I decided
  26. that I should release the code, since what I did was SO DARN SIMPLE.  
  27.     OK, maybe the program is a little hairy at parts because of the messing
  28. with the palette, but the continuous scrolling IS pretty simple...
  29.  
  30.     Anyways, to the code...
  31.  
  32.     Well, first off, let me explain what I'm doing... I am panning
  33. downward (increasing the STARTING OFFSET register) by the width of the 
  34. screen for each frame.  When I reach the offset that would make it so I am 
  35. only showing the second page, I go back to the minimum offset.
  36. Lemme show off my ansi skills and draw a diagram. =)
  37.  
  38. SCRW = width of screen in bytes- for a 320 wide screen that would be 80 bytes
  39.  
  40. offset 
  41. ~~~~~~
  42. 0           ┌───────────
  43.             │   This is the split screen area
  44.             │
  45.             │
  46.             │
  47. base        ├─────────── <- The minimum of our start offset
  48.             │   This is the top of page 1
  49.             │
  50.             │
  51.             │
  52.             │
  53.             │
  54.             │
  55. base +      ├─────────── <- The maximum we let our START OFFSET get to
  56.  height of  │
  57.  scroll*SCRW│   And this is page 2
  58.             │
  59.             │
  60.             │
  61.             │
  62.             │
  63.             ├───────────
  64.             │        <- A varying amount of extra video memory
  65.             /        <- where you can put whaever you want
  66.             /        <- Possibly a font, so you can copy it quickly 
  67.             │        <- with write mode 1
  68.             ├─────────── <- This is the 'next line' buffer area
  69.             │            <- We want to write whatever we want displayed next
  70. 64k         └─────────── <- Right here
  71.  
  72.  
  73. CurOff = the current StartOffset
  74.  
  75.     What you do each time you pan the screen up on pixel is:
  76.  
  77.         1) Increase CurOff by SCRW and set START OFFSET register
  78.  
  79.         2a) Wait for a verticle retrace
  80.  
  81.         2b) Update the palette (this is only what I did.. obviously it is not
  82.             necessary if you don't want that palette trick.)
  83.  
  84.         3) Copy a line from the 'next line' area to CurOff - SCRW
  85.             (or the old CurOff)
  86.  
  87.         4) Copy the same line from the 'next line' area to 
  88.             CurOff + ScrollHeight*SCRW - SCRW
  89.  
  90.         5) Increase the pointer used to access the current line in the 
  91.             'next line' area, if it goes beyond the max, reset to the min
  92.             and clear out the 'next line' area and fill with next text...
  93.  
  94.  
  95.     This will cause a slight messup at the bottom of the scroll because you
  96.     are displaying stuff that hasn't been updated yet...
  97.  
  98.     You COULD fix that by carefully timing the writes to the video card, but
  99.     I say just cover it up with the split screen...  Kinda lazy, aren't I?
  100.     In this example I didn't have to mess with it cause the messed up area
  101.     was of the color black... and black on black isn't really noticable..
  102.  
  103.     Ok, to make a stupid story short... ;)
  104.  
  105.     I did the palette trick by setting up the screen similiar to the old 
  106.     palette induced 'copper bars'... Maybe that's not what to call them, 
  107.     but anyways, every line has a different palette color.  First line is
  108.     a 1, then 2, 3, 4, and so on...  Then I just change the palette in a
  109.     way similiar to the ol' palette bars, with the bars following the edge
  110.     of the scroll area...  Hmm.. maybe if you were really interested, you 
  111.     could go into the program and change the MAXCOLORS to 200 or so and
  112.     then set the split screen to 0, so you can see what is really happening
  113.     to the screen data and the palette...
  114.  
  115.     Enuff docs..  I'm getting bored... =)
  116.  
  117.     Oh, yeah, you can use this code for whatever you want.  Just give VLA
  118.     some credit for our hard(?) work...  And we take no responsibility
  119.     for whatever this code does, known or unknown.  If you don't like our
  120.     color selection, tough.  =)
  121.  
  122.     BTW, I don't care if you rip our code as long as you greet us.
  123.     
  124.     Blah blah blah blah blah.  (That says it all.)
  125.     
  126. END COMMENTS
  127.