TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: BARRY BLOCK
from: DENIS BOYLES
date: 1997-05-13 13:31:00
subject: The Scroller... :)

Hi Barry,
Remember waay back when, when I posted my BIGHIYA.ASM program which displayed
BIG text? You suggested I try turning that idea, of using the ROM font, into
a scroller program.
Well, I've *finally* managed it in assembler, it was a little easier after
doing my C and QBASIC versions. The program that follows, in seperate
messages, is the result of my ASM scroller.
This uses the same idea as BIGHIYA.ASM, using the CGA ROM FONT to display
letters. However this time, I used it in MCGA graphics mode to "plot" the
font onto the screen. Where it is "scrolled" to the left and plotted again to
achieve the scrolling effect.
Here's some background on what I did, to make the program a bit more "clear"
as to what's happening.
Firstly, I'm using MODE 13h, which is the 320x200x256 video, which makes it
easy to plot pixels. Since a pixel is one byte, you simply calculate an
offset into VRAM then put a byte there.
ie:
  offset = x + 320 * y
I also changed the scanline per pixel setting, thus giving a "larger" image
than really. The default is 2 scanlines per pixel, giving you 200 lines, I
changed it to 3. Thus giving me about 132 lines, which makes the font a bit
bigger and easier to read.
The FONT, is an 8x8 monochrome image, so it is really 1 byte x 8, or rather
8-bits by 8 bytes.
Like so:      For the scroller, I'm plotting one vertical line of the
              font image at the right hand side of the screen. X=319
 76543210     0---------------------------------------------------319
0..##....                                                          .
1.####...                                                          .
2##..##..                                                          #
3##..##..                                                          #
4######..                                                          #
5######..                                                          #
6##..##..                                                          #
7##..##..                                                          #
              0---------------------------------------------------319
Then the screen is shifted to the left one pixel, and the next line of the
font is drawn. ie:
 76543210     0---------------------------------------------------319
0..##....                                                         ..
1.####...                                                         .#
2##..##..                                                         ##
3##..##..                                                         ##
4######..                                                         ##
5######..                                                         ##
6##..##..                                                         ##
7##..##..                                                         ##
              0---------------------------------------------------319
This is repeated for all 8 lines of the font image. For this I used a bit
table of the 8-bit values. The fist character of the message is loaded, it's
image found in the font table and then plotted.
The bit table goes through all 8-bits, plotting and shifting the screen. When
it's done, the next character is loaded, and the process starts again. During
this time, the keyboard is checked for a keypress. If a keypress was
detected, then the program will stop and terminate.
Once the program reaches the end of the message, by checking for a NUL
character, the program resets and the message starts over. Thus the message
is scrolled repeatedly until you press a key to quit.
BTW: About the SYSREQ.ASM program. All in all the idea seems fine, but the
     major problem is memory. (and the stack) The stack is easier to fix, but
     the memory is a bit more problematic.
     You need to free memory in order for COMMAND.COM to load and execute the
     command given by INT 2E. Something tricky to do when the program is a
     TSR and might be called while in another program. Somehow, you would
     need to swap the interrupted programs memory to disk. Free it so that
     COMMAND.COM can use it to run it's command. Then swap the program's
     memory back in, all without crashing the program or the system! :)
Kind Regards,
  Denis Boyles
 * OLX 2.1 TD * Back Up My Hard Drive? I Can't Find The Reverse Switch!
--- Maximus/2 3.01
---------------
* Origin: Frog Hollow Port Moody BC 604-469-0264/0284 (1:153/290)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.